-
released this
2025-04-29 11:56:49 +00:00 | 10978 commits to 2.0 since this release- Add support for OpenRouter as a new model provider
- Introduced
ProviderOpenRouterin themodelspackage. - Added OpenRouter-specific models, including
GPT41,GPT41Mini,GPT4o, and others, with their configurations and costs. - Updated
generateSchemato include OpenRouter as a provider. - Added OpenRouter-specific environment variable handling (
OPENROUTER_API_KEY) inconfig.go. - Implemented default model settings for OpenRouter agents in
setDefaultModelForAgent. - Updated
getProviderAPIKeyto retrieve the OpenRouter API key. - Extended
SupportedModelsto include OpenRouter models. - Added OpenRouter client initialization in the
providerpackage. - Modified
processGenerationto handleFinishReasonUnknownin addition toFinishReasonToolUse.
- [feature/openrouter-provider] Add new models and provider to schema
- Added "deepseek-chat-free" and "deepseek-r1-free" to the list of supported models in
opencode-schema.json.
- [feature/openrouter-provider] Add OpenRouter provider support and integrate new models
- Updated README.md to include OpenRouter as a supported provider and its configuration details.
- Added
OPENROUTER_API_KEYto environment variable configuration. - Introduced OpenRouter-specific models in
internal/llm/models/openrouter.gowith mappings to existing cost and token configurations. - Updated
internal/config/config.goto set default models for OpenRouter agents. - Extended
opencode-schema.jsonto include OpenRouter models in the schema definitions. - Refactored model IDs and names to align with OpenRouter naming conventions.
- [feature/openrouter-provider] Refactor finish reason handling and tool call logic in agent and OpenAI provider
- Simplified finish reason check in
agent.goby removing redundant variable assignment. - Updated
openai.goto override the finish reason toFinishReasonToolUsewhen tool calls are present. - Ensured consistent finish reason handling in both
sendandstreammethods of the OpenAI provider.
[feature/openrouter-provider] Refactor finish reason handling and tool call logic in agent and OpenAI provider
- Simplified finish reason check in
agent.goby removing redundant variable assignment. - Updated
openai.goto override the finish reason toFinishReasonToolUsewhen tool calls are present. - Ensured consistent finish reason handling in both
sendandstreammethods of the OpenAI provider.
- [feature/openrouter-provider] Add support for custom headers in OpenAI client configuration
- Introduced a new
extraHeadersfield in theopenaiOptionsstruct to allow specifying additional HTTP headers. - Added logic in
newOpenAIClientto applyextraHeadersto the OpenAI client configuration. - Implemented a new option function
WithOpenAIExtraHeadersto set custom headers inopenaiOptions. - Updated the OpenRouter provider configuration in
NewProviderto include default headers (HTTP-RefererandX-Title) for OpenRouter API requests.
-
Update OpenRouter model config and remove unsupported models
-
[feature/openrouter-provider] Update OpenRouter models and default configurations
- Added new OpenRouter models:
claude-3.5-sonnet,claude-3-haiku,claude-3.7-sonnet,claude-3.5-haiku, andclaude-3-opusinopenrouter.go. - Updated default agent models in
config.go:agents.coder.modelnow usesclaude-3.7-sonnet.agents.task.modelnow usesclaude-3.7-sonnet.agents.title.modelnow usesclaude-3.5-haiku.
- Updated
opencode-schema.jsonto include the new models in the allowed list for schema validation. - Adjusted logic in
setDefaultModelForAgentto reflect the new default models.
- [feature/openrouter-provider] Remove unused ProviderEvent emission in stream function
The changes remove the emission of a
ProviderEventwith typeEventContentStopin thestreamfunction of theopenaiClientimplementation. This event was sent upon successful stream completion but is no longer used.Downloads