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

Function lowerToolConfig

packages/llm/src/protocols/gemini.ts:177–183  ·  view source on GitHub ↗
(toolChoice: NonNullable<LLMRequest["toolChoice"]>)

Source from the content-addressed store, hash-verified

175})
176
177const lowerToolConfig = (toolChoice: NonNullable<LLMRequest["toolChoice"]>) =>
178 ProviderShared.matchToolChoice("Gemini", toolChoice, {
179 auto: () => ({ functionCallingConfig: { mode: "AUTO" as const } }),
180 none: () => ({ functionCallingConfig: { mode: "NONE" as const } }),
181 required: () => ({ functionCallingConfig: { mode: "ANY" as const } }),
182 tool: (name) => ({ functionCallingConfig: { mode: "ANY" as const, allowedFunctionNames: [name] } }),
183 })
184
185const lowerUserPart = Effect.fn("Gemini.lowerUserPart")(function* (part: TextPart | MediaPart) {
186 if (part.type === "text") return { text: part.text }

Callers 1

gemini.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected