MCPcopy Create free account
hub / github.com/anomalyco/opencode / useEnvModel

Function useEnvModel

github/index.ts:301–311  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

299}
300
301function useEnvModel() {
302 const value = process.env["MODEL"]
303 if (!value) throw new Error(`Environment variable "MODEL" is not set`)
304
305 const [providerID, ...rest] = value.split("/")
306 const modelID = rest.join("/")
307
308 if (!providerID?.length || !modelID.length)
309 throw new Error(`Invalid model ${value}. Model must be in the format "provider/model".`)
310 return { providerID, modelID }
311}
312
313function useEnvRunUrl() {
314 const { repo } = useContext()

Callers 2

chatFunction · 0.85
footerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected