fix(ai): support responses API for OpenCode Go
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
import { anthropicMessagesApi } from "../api/anthropic-messages.lazy.ts";
|
import { anthropicMessagesApi } from "../api/anthropic-messages.lazy.ts";
|
||||||
import { openAICompletionsApi } from "../api/openai-completions.lazy.ts";
|
import { openAICompletionsApi } from "../api/openai-completions.lazy.ts";
|
||||||
|
import { openAIResponsesApi } from "../api/openai-responses.lazy.ts";
|
||||||
import { envApiKeyAuth } from "../auth/helpers.ts";
|
import { envApiKeyAuth } from "../auth/helpers.ts";
|
||||||
import { createProvider, type Provider } from "../models.ts";
|
import { createProvider, type Provider } from "../models.ts";
|
||||||
import { OPENCODE_GO_MODELS } from "./opencode-go.models.ts";
|
import { OPENCODE_GO_MODELS } from "./opencode-go.models.ts";
|
||||||
|
|
||||||
export function opencodeGoProvider(): Provider<"anthropic-messages" | "openai-completions"> {
|
export function opencodeGoProvider(): Provider<"anthropic-messages" | "openai-completions" | "openai-responses"> {
|
||||||
return createProvider({
|
return createProvider<"anthropic-messages" | "openai-completions" | "openai-responses">({
|
||||||
id: "opencode-go",
|
id: "opencode-go",
|
||||||
name: "OpenCode Zen Go",
|
name: "OpenCode Zen Go",
|
||||||
auth: { apiKey: envApiKeyAuth("OpenCode API key", ["OPENCODE_API_KEY"]) },
|
auth: { apiKey: envApiKeyAuth("OpenCode API key", ["OPENCODE_API_KEY"]) },
|
||||||
@@ -13,6 +14,7 @@ export function opencodeGoProvider(): Provider<"anthropic-messages" | "openai-co
|
|||||||
api: {
|
api: {
|
||||||
"anthropic-messages": anthropicMessagesApi(),
|
"anthropic-messages": anthropicMessagesApi(),
|
||||||
"openai-completions": openAICompletionsApi(),
|
"openai-completions": openAICompletionsApi(),
|
||||||
|
"openai-responses": openAIResponsesApi(),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user