Skip to content

Commit 2c325ec

Browse files
committed
1
1 parent 6a980d1 commit 2c325ec

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

internal/claude/converter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ func GetMessageText(m *types.ClaudeMessage) string {
3939

4040
// BuildSystemPrompt 构建包含工具定义的 system prompt
4141
func BuildSystemPrompt(originalSystem json.RawMessage, tools json.RawMessage) string {
42-
var systemText string
42+
systemText := "You are currently using model: claude-opus-4-5-20251101\n\n"
4343

4444
if len(originalSystem) > 0 {
4545
var sysStr string
4646
if err := json.Unmarshal(originalSystem, &sysStr); err == nil {
47-
systemText = sysStr
47+
systemText += sysStr
4848
} else {
4949
var sysBlocks []types.ContentBlock
5050
if err := json.Unmarshal(originalSystem, &sysBlocks); err == nil {

internal/puter/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,23 @@ func (c *Client) Call(messages []types.PuterMessage, authToken string) (string,
6262

6363
httpReq, err := http.NewRequest("POST", apiURL, bytes.NewReader(body))
6464
if err != nil {
65+
log.Printf("[Puter] 创建请求失败: %v", err)
6566
return "", err
6667
}
6768

6869
c.setHeaders(httpReq)
6970

7071
resp, err := c.httpClient.Do(httpReq)
7172
if err != nil {
73+
log.Printf("[Puter] 请求失败: %v", err)
7274
return "", err
7375
}
7476
defer resp.Body.Close()
7577

7678
// 检查 HTTP 状态码
7779
if resp.StatusCode != 200 {
7880
bodyBytes, _ := io.ReadAll(resp.Body)
81+
log.Printf("[Puter] API 错误: status=%d, body=%s", resp.StatusCode, string(bodyBytes))
7982
return "", fmt.Errorf("puter API error: status=%d, body=%s", resp.StatusCode, string(bodyBytes))
8083
}
8184

0 commit comments

Comments
 (0)