Read OpenCode Go training from go.training on the models list #676
Mergedtombeckenhammerged 2 commits into
main fromrefs/pull/676/headmerged by tombeckenham View on GitHubtombeckenham linked this to fix #675
tanstack-source added labelsbug
- .changeset/opencode-go-training.md line 5Outdated@@ -0,0 +1,5 @@1+---2+'@modelschemas/client': patch3+---4+5+OpenCode Go `trainsOnRequestData` is the models list `go.training` boolean. The Go docs privacy table now states retention only, and a retention period is not a no.src/server/providers/adapters/opencode-go.ts line 54Outdated@@ -68,14 +47,8 @@68- trainsOnRequestData: {69- derivation: 'docs-derived' as const,70- sourceUrl: OPENCODE_GO_DOCS_URL,71- sourceHash: privacy?.hash,72- path: 'Privacy',73- },74- }75- : facts?.factSources76- const absent = {77- ...(facts?.releasedAt == null78- ? { releasedAt: 'cleared' as const }79- : {}),80- ...(privacy ? {} : { trainsOnRequestData: 'unavailable' as const }),47+ const stated = training.get(model.rawId)48+ if (stated === undefined) {49+ throw new Error(50+ `opencode-go: ${model.rawId} has no go.training boolean`,51+ )8152 }53+ // A stated no is stored as null, the same as the old "Not used" cell.54+ const trainsOnRequestData = stated ? true : nullsrc/server/providers/adapters/opencode-go.ts line 91Outdated@@ -94,11 +81,11 @@9481 // models.dev `cost` is left unread: it is not a confirmed billed price.9582 pricing: null,9683 ...(factSources ? { factSources } : {}),97- ...(Object.keys(absent).length > 0 ? { absent } : {}),84+ ...(absent ? { absent } : {}),9885 }9986 },10087 )10188 if (!models.some((model) => model.activity === 'chat')) {10289 throw new Error('opencode-go: catalog classified 0 listed models')10390 }104- return { models, docsFailures: docsReport(docs) }91+ return { models }src/server/providers/opencode-go-facts.ts line 184Outdated@@ -71,15 +172,13 @@71172 if (!name) continue72- if (stated !== 'Yes' && stated !== 'Not used') {173+ const stated = cells[retentionCol]174+ if (!stated || !RETENTION_CELL.test(stated)) {73175 throw new Error(74- `opencode-go: privacy training cell ${JSON.stringify(stated)} for ${name}`,176+ `opencode-go: privacy retention cell ${JSON.stringify(stated)} for ${name}`,75177 )76178 }77- const id = ids.get(name)78- if (!id) {79- throw new Error(`opencode-go: privacy model ${name} has no endpoint id`)80- }81- training.set(id, stated === 'Yes')179+ named.add(name)82180 }83- if (training.size === 0) {181+ if (named.size === 0) {84182 throw new Error('opencode-go: privacy table names no models')85183 }184+ for (const match of privacy.matchAll(/^- \*\*([^*]+):\*\* (.*)$/gm)) {
tombeckenham merged this044efb3
tombeckenham closed this
Sign in to join this conversation.
🦋 Changeset detected#
Latest commit: 1441d6be374864c1f370dfb9adb2171dd4d2b8d2
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR