This commit is contained in:
Cold
2025-11-27 18:03:01 +08:00
committed by 张斌
parent ad1ccc2bc1
commit d8410fab37
2 changed files with 27 additions and 29 deletions

View File

@@ -82,7 +82,7 @@ func (c *Client) request(ctx context.Context, method, path string, body interfac
return fmt.Errorf("http request failed with status: %d", resp.StatusCode)
}
respBody, err := resp.ReadAll()
respBody := resp.ReadAll()
if err != nil {
return fmt.Errorf("read response body failed: %w", err)
}
@@ -106,4 +106,3 @@ func buildQueryString(params map[string]interface{}) string {
}
return strings.Join(parts, "&")
}

View File

@@ -91,7 +91,7 @@ func (c *Client) CreateAgentCompletion(ctx context.Context, agentID string, req
// 注意:流式响应需要特殊处理,这里返回一个可用于读取流的接口
func (c *Client) CreateChatCompletionStream(ctx context.Context, chatID string, req *ChatCompletionRequest) (*StreamReader, error) {
req.Stream = true
apiPath := fmt.Sprintf("/api/v1/chats_openai/%s/chat/completions", chatID)
_ = fmt.Sprintf("/api/v1/chats_openai/%s/chat/completions", chatID)
// TODO: 实现流式读取逻辑
return nil, fmt.Errorf("stream mode not implemented yet")
@@ -119,4 +119,3 @@ func (sr *StreamReader) Close() error {
}
return nil
}