Commit graph

48 commits

Author SHA1 Message Date
adamdottv
014400465b
feat: openai responses api & codex-mini-latest 2025-05-16 15:59:54 -05:00
adamdottv
b112216241
fix: build 2025-05-15 13:36:58 -05:00
mineo
87237b6462
feat: support VertexAI provider (#153)
* support: vertexai

fix

fix

set default for vertexai

added comment

fix

fix

* create schema

* fix README.md

* fix order

* added pupularity

* set tools if tools is exists

restore commentout

* fix comment

* set summarizer model
2025-05-15 13:35:06 -05:00
adamdottv
ddbb217d0d
feat: better status bar 2025-05-15 12:04:15 -05:00
adamdottv
2391e338b4
chore: rename 2025-05-13 10:02:39 -05:00
adamdottv
8cbfc581b5
chore: cleanup 2025-05-12 10:45:03 -05:00
mineo
f92b2b76dc
replace github.com/google/generative-ai-go with github.com/googleapis/go-genai (#138)
* replace to github.com/googleapis/go-genai

* fix history logic

* small fixes

---------

Co-authored-by: Kujtim Hoxha <kujtimii.h@gmail.com>
2025-05-12 09:56:30 -05:00
adamdottv
f100777199
wip: logging improvements 2025-05-09 13:37:13 -05:00
adamdottv
f41b7bbd0a
chore: refactoring status updates 2025-05-08 12:03:59 -05:00
adamdottv
051d7d7936
chore: logging token usage 2025-05-06 14:40:00 -05:00
adamdottv
e387b1f16c
fix: openrouter require_parameters 2025-05-06 11:17:32 -05:00
adamdottv
71a68dd56d
feat: add qwen3 models 2025-05-06 10:19:07 -05:00
adamdottv
afcdabd095
fix: anthropic non-empty blocks 2025-05-05 12:00:09 -05:00
phantomreactor
ff0ef3bb43
feat: add support for images 2025-05-02 15:29:46 -05:00
adamdottv
f004a0b8c3 fix: anthropic non-empty blocks 2025-05-02 15:24:47 -05:00
Kujtim Hoxha
a61b2026eb
add xai support (#135) 2025-05-01 11:08:26 -05:00
Isaac Scarrott
98e2910e82
feat: Add support for OpenRouter (#92)
* Add support for OpenRouter as a new model provider

- Introduced `ProviderOpenRouter` in the `models` package.
- Added OpenRouter-specific models, including `GPT41`, `GPT41Mini`, `GPT4o`, and others, with their configurations and costs.
- Updated `generateSchema` to include OpenRouter as a provider.
- Added OpenRouter-specific environment variable handling (`OPENROUTER_API_KEY`) in `config.go`.
- Implemented default model settings for OpenRouter agents in `setDefaultModelForAgent`.
- Updated `getProviderAPIKey` to retrieve the OpenRouter API key.
- Extended `SupportedModels` to include OpenRouter models.
- Added OpenRouter client initialization in the `provider` package.
- Modified `processGeneration` to handle `FinishReasonUnknown` in addition to `FinishReasonToolUse`.

* [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_KEY` to environment variable configuration.
- Introduced OpenRouter-specific models in `internal/llm/models/openrouter.go` with mappings to existing cost and token configurations.
- Updated `internal/config/config.go` to set default models for OpenRouter agents.
- Extended `opencode-schema.json` to 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.go` by removing redundant variable assignment.
- Updated `openai.go` to override the finish reason to `FinishReasonToolUse` when tool calls are present.
- Ensured consistent finish reason handling in both `send` and `stream` methods 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.go` by removing redundant variable assignment.
- Updated `openai.go` to override the finish reason to `FinishReasonToolUse` when tool calls are present.
- Ensured consistent finish reason handling in both `send` and `stream` methods of the OpenAI provider.

* **[feature/openrouter-provider] Add support for custom headers in OpenAI client configuration**

- Introduced a new `extraHeaders` field in the `openaiOptions` struct to allow specifying additional HTTP headers.
- Added logic in `newOpenAIClient` to apply `extraHeaders` to the OpenAI client configuration.
- Implemented a new option function `WithOpenAIExtraHeaders` to set custom headers in `openaiOptions`.
- Updated the OpenRouter provider configuration in `NewProvider` to include default headers (`HTTP-Referer` and `X-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`, and `claude-3-opus` in `openrouter.go`.
- Updated default agent models in `config.go`:
  - `agents.coder.model` now uses `claude-3.7-sonnet`.
  - `agents.task.model` now uses `claude-3.7-sonnet`.
  - `agents.title.model` now uses `claude-3.5-haiku`.
- Updated `opencode-schema.json` to include the new models in the allowed list for schema validation.
- Adjusted logic in `setDefaultModelForAgent` to reflect the new default models.

* [feature/openrouter-provider] Remove unused ProviderEvent emission in stream function

The changes remove the emission of a `ProviderEvent` with type `EventContentStop` in the `stream` function of the `openaiClient` implementation. This event was sent upon successful stream completion but is no longer used.
2025-04-29 13:56:49 +02:00
YJG
805aeff83c
feat: add azure openai models (#74) 2025-04-28 15:42:57 +02:00
Kujtim Hoxha
4415220555 fix minor issue 2025-04-27 19:24:46 +02:00
Kujtim Hoxha
a3a04d8a54 fix gemini provider 2025-04-27 19:12:02 +02:00
Lukáš Loukota
792e2b164b fix: gemini tool calling 2025-04-27 19:12:02 +02:00
Kujtim Hoxha
b3a8dbd0d9 fix retry warning 2025-04-27 14:08:09 +02:00
Kujtim Hoxha
a35466cdb3 fix acc error 2025-04-25 21:58:14 +02:00
Kujtim Hoxha
170c7ad67a small fixes 2025-04-25 14:42:47 +02:00
Hunter Casten
7a62ab7675 feat(groq): add support for Groq using the OpenAI provider 2025-04-25 11:11:52 +02:00
Kujtim Hoxha
b106787a50 change package name 2025-04-24 18:26:16 +02:00
Kujtim Hoxha
1da298e755 fix anthropic 2025-04-21 13:42:29 +02:00
Kujtim Hoxha
8e160488ff improve cache 2025-04-21 13:42:29 +02:00
Kujtim Hoxha
2de5127417 initial tool call stream 2025-04-21 13:42:29 +02:00
Kujtim Hoxha
2b5a33e476 lsp improvements 2025-04-21 13:42:29 +02:00
Kujtim Hoxha
333ea6ec4b implement patch, update ui, improve rendering 2025-04-21 13:42:27 +02:00
Kujtim Hoxha
cc07f7a186 rename to opencode 2025-04-21 13:42:02 +02:00
Kujtim Hoxha
bbfa60c787 reimplement agent,provider and add file history 2025-04-21 13:42:00 +02:00
Kujtim Hoxha
cdc5f209dc cleanup diff, cleanup agent 2025-04-21 13:41:27 +02:00
Kujtim Hoxha
c08f5a7902 fix cancell 2025-04-10 15:27:42 +02:00
Kujtim Hoxha
21cfe9a243 default the region to us 2025-04-09 20:05:22 +02:00
Kujtim Hoxha
65055c7687 minor fixes 2025-04-09 20:04:44 +02:00
Kujtim Hoxha
2af1bbb828 Merge pull request #25 from kujtimiihoxha/cleanup-logs-status
Cleanup Logs and Status
2025-04-09 19:19:45 +02:00
Kujtim Hoxha
d39d52d95d finish logs page 2025-04-09 19:07:39 +02:00
Kujtim Hoxha
939ae03f42 add bedrock support 2025-04-09 17:45:41 +02:00
Kujtim Hoxha
0d8d324ac6 cleanup retry 2025-04-08 20:46:40 +02:00
adamdottv
4385fb3219 fix: status messages 2025-04-08 11:45:26 -05:00
Kujtim Hoxha
f463ce6694 improve status message handling 2025-04-07 19:43:31 +02:00
adamdottv
57a2210d8d fix: handle anthropic 429s 2025-04-07 10:43:54 -05:00
adamdottv
50d8fbbb40 fix(anthropic): increase max retries 2025-04-05 15:07:43 -05:00
adamdottv
781b296180 fix(anthropic): skip empty messages 2025-04-04 14:33:55 -05:00
Kujtim Hoxha
cfdd687216 add initial lsp support 2025-04-03 17:23:41 +02:00
Kujtim Hoxha
afd9ad0560 rework llm 2025-04-01 13:38:54 +02:00