MCPcopy Index your code
hub / github.com/anomalyco/opencode / webSearchModelName

Function webSearchModelName

packages/opencode/src/tool/websearch.ts:45–52  ·  view source on GitHub ↗
(extra: Tool.Context["extra"])

Source from the content-addressed store, hash-verified

43}
44
45export function webSearchModelName(extra: Tool.Context["extra"]) {
46 const model = extra?.model
47 if (!model || typeof model !== "object") return undefined
48 const api = "api" in model && model.api && typeof model.api === "object" ? model.api : undefined
49 const apiID = api && "id" in api && typeof api.id === "string" ? api.id : undefined
50 const id = "id" in model && typeof model.id === "string" ? model.id : undefined
51 return (apiID ?? id)?.slice(0, 100)
52}
53
54function parallelAuthHeaders() {
55 const headers = { "User-Agent": `opencode/${InstallationVersion}` }

Callers 2

websearch.test.tsFile · 0.90
callProviderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected