mirror of
https://github.com/luckyyzh/pi-agent-integrated.git
synced 2026-10-03 11:09:34 +00:00
21 lines
931 B
TypeScript
21 lines
931 B
TypeScript
import { anthropicMessagesApi } from "../api/anthropic-messages.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 { createProvider, type Provider } from "../models.ts";
|
|
import { OPENCODE_GO_MODELS } from "./opencode-go.models.ts";
|
|
|
|
export function opencodeGoProvider(): Provider<"anthropic-messages" | "openai-completions" | "openai-responses"> {
|
|
return createProvider<"anthropic-messages" | "openai-completions" | "openai-responses">({
|
|
id: "opencode-go",
|
|
name: "OpenCode Go",
|
|
auth: { apiKey: envApiKeyAuth("OpenCode API key", ["OPENCODE_API_KEY"]) },
|
|
models: Object.values(OPENCODE_GO_MODELS),
|
|
api: {
|
|
"anthropic-messages": anthropicMessagesApi(),
|
|
"openai-completions": openAICompletionsApi(),
|
|
"openai-responses": openAIResponsesApi(),
|
|
},
|
|
});
|
|
}
|