v0.2.0 -> v0.3.0
Summary
Strengthens provider interoperability with typed reasoning controls and capability-aware model discovery. Response conversion now preserves complete content and reports provider failures consistently.
翻譯
透過型別化 reasoning 控制與能力感知的模型探索,強化各 provider 之間的互通性。回應轉換現在能保留完整內容,並一致回報 provider 錯誤。
⚠️ Breaking Changes
Agent reasoning arguments changed from string to core.Reasoning
The public Agent.Send and StreamAgent.SendStream methods no longer accept a string reasoning level. Callers must parse external input into core.Reasoning before invoking either method.
Before:
out, code, err := agent.Send(ctx, messages, tools, "high")
events, err := streamAgent.SendStream(ctx, messages, tools, "high")
After:
reasoning, ok := core.ParseReasoning("high")
if !ok {
return fmt.Errorf("unknown reasoning level")
}
out, code, err := agent.Send(ctx, messages, tools, reasoning)
events, err := streamAgent.SendStream(ctx, messages, tools, reasoning)
Update every custom implementation of core.Agent and core.StreamAgent to use core.Reasoning in these method signatures. The supported levels are represented by core.ReasoningNone, core.ReasoningLow, core.ReasoningMedium, core.ReasoningHigh, core.ReasoningXHigh, and core.ReasoningMax.
翻譯
公開的 Agent.Send 與 StreamAgent.SendStream 方法不再接受字串形式的 reasoning level。呼叫端必須先將外部輸入解析為 core.Reasoning,再呼���這兩個方法;所有自訂的 core.Agent 與 core.StreamAgent 實作也必須更新方法簽章。
Capability-aware text-only model discovery
Provider model discovery now accepts core.ModelFilter, including the TextOnly option. Set TextOnly: true when an application needs models suitable for text generation only; providers then exclude known non-text model families such as image, audio, video, realtime, embedding, transcription, and moderation models. The filter is applied while listing supported models, so callers receive a provider-compatible text-model list without maintaining provider-specific exclusion logic.
Example:
models, err := openai.Models(ctx, config, core.ModelFilter{TextOnly: true})
翻譯
具備能力感知的純文字模型探索
Provider 的模型探索現在接受 core.ModelFilter,其中包含 TextOnly 選項。當應用程式只需要適合文字生成的模型時,可設定 TextOnly: true;各 provider 會在列出支援模型時排除已知的圖片、音訊、影片、即時、embedding、轉錄與 moderation 等非純文字模型系列。過濾會在模型列表階段執行,呼叫端不需要自行維護各 provider 的排除邏輯。
範例:
models, err := openai.Models(ctx, config, core.ModelFilter{TextOnly: true})
Changes
BREAKING
- Replace string reasoning parameters with typed reasoning values and provider-specific capability limits (@pardnchiu) [260cccc]
翻譯
- 以型別化 reasoning 值與各 provider 的能力限制取代字串 reasoning 參數
FIX
- Preserve complete provider response content and surface streaming failures during aggregation (@pardnchiu) [1eb2456]
翻譯
- 保留完整的 provider 回應內容,並在彙整時回報串流失敗
Scope
core/— BREAKING, FIXcore/claude/— BREAKING, FIXcore/copilot/— BREAKING, FIXcore/gemini/— BREAKING, FIXcore/grok/— BREAKING, FIXcore/grokOauth/— BREAKING, FIXcore/openai/— BREAKINGcore/openaiCodex/— BREAKING, FIXcore/openRouter/— BREAKINGcore/cloudflare/— BREAKINGcore/compat/— BREAKINGcore/deepseek/— BREAKINGcore/nvidia/— BREAKING
Generated by SKILL