Skip to content
Source
Sign inSign up
TanStack/schemas

Read OpenCode Go routes from the models list api field #682

Mergedtombeckenhammerged 1 commit intomain fromrefs/pull/682/headmerged by tombeckenham View on GitHub

Showing 7 changed files with 78 additions and 52 deletions (loading 4).

x
0 of 7 viewed, 7 left
74 additions and 48 deletionssrc/server/providers/adapters/opencode-go.test.tsModified
View file
@@ -1,20 +1,49 @@
import { OPENCODE_CATALOG_URL } from '../opencode-catalog.ts'
-import { OPENCODE_GO_ROUTE_DOCS_URL } from '../opencode-routes.ts'
​
import { afterEach, describe, expect, it } from 'vitest'
​
import { OPENCODE_GO_MODELS_URL, provider } from './opencode-go.ts'
​
-const LISTING = {
- object: 'list',
- data: ['mini', 'kimi', 'gpt', 'deepseek', 'absent'].map((id) => ({
+const OPENAI = 'https://opencode.ai/inference/go/openai/v1'
+const ANTHROPIC = 'https://opencode.ai/inference/go/anthropic/v1'
+const GOOGLE = 'https://opencode.ai/inference/go/google/v1beta'
+​
+function listingRow(id: string, protocol: string, base: string, sdk: string) {
+ return {
id,
object: 'model',
owned_by: 'opencode',
go: { training: id === 'mini' },
- })),
+ api: {
+ [protocol]: {
+ base_url: base,
+ sdk: { aisdk: sdk },
+ },
+ },