Changeset 0.9.3 (#53)

This commit is contained in:
2026-02-23 23:55:22 +00:00
parent ac7c7c7d59
commit 90021157e6
20 changed files with 897 additions and 414 deletions

View File

@@ -134,6 +134,7 @@ func (p *OpenAIProvider) StreamCompletion(ctx context.Context, cfg ProviderConfi
ev := StreamEvent{
Delta: choice.Delta.Content,
Reasoning: choice.Delta.ReasoningContent,
Model: chunk.Model,
FinishReason: choice.FinishReason,
}
@@ -363,8 +364,9 @@ type openaiStreamChunk struct {
Model string `json:"model"`
Choices []struct {
Delta struct {
Content string `json:"content"`
ToolCalls []openaiToolCall `json:"tool_calls,omitempty"`
Content string `json:"content"`
ReasoningContent string `json:"reasoning_content"`
ToolCalls []openaiToolCall `json:"tool_calls,omitempty"`
} `json:"delta"`
FinishReason string `json:"finish_reason"`
} `json:"choices"`

View File

@@ -99,6 +99,7 @@ type CompletionResponse struct {
// StreamEvent is a single chunk from a streaming response.
type StreamEvent struct {
Delta string `json:"delta,omitempty"`
Reasoning string `json:"reasoning,omitempty"`
Done bool `json:"done,omitempty"`
FinishReason string `json:"finish_reason,omitempty"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`