chore(vendor): import pi 1.3.0
Imported as a linear vendor commit so forge rebases do not replay the upstream root tree. git-subtree-dir: third_party/pi git-subtree-split: 71023aec1546d6d677a65669c5665c0927ce0dd0
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
import { anthropicMessagesApi } from "../api/anthropic-messages.lazy.ts";
|
||||
import { googleGenerativeAIApi } from "../api/google-generative-ai.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";
|
||||
import { withOpenCodeSessionHeader } from "./opencode-headers.ts";
|
||||
|
||||
export function opencodeGoProvider(): Provider<"anthropic-messages" | "openai-completions" | "openai-responses"> {
|
||||
return createProvider<"anthropic-messages" | "openai-completions" | "openai-responses">({
|
||||
type OpenCodeGoApi = "anthropic-messages" | "google-generative-ai" | "openai-completions" | "openai-responses";
|
||||
|
||||
export function opencodeGoProvider(): Provider<OpenCodeGoApi> {
|
||||
return createProvider<OpenCodeGoApi>({
|
||||
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(),
|
||||
"anthropic-messages": withOpenCodeSessionHeader(anthropicMessagesApi()),
|
||||
"google-generative-ai": withOpenCodeSessionHeader(googleGenerativeAIApi()),
|
||||
"openai-completions": withOpenCodeSessionHeader(openAICompletionsApi()),
|
||||
"openai-responses": withOpenCodeSessionHeader(openAIResponsesApi()),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user