| 175 | }) |
| 176 | |
| 177 | const 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 | |
| 185 | const lowerUserPart = Effect.fn("Gemini.lowerUserPart")(function* (part: TextPart | MediaPart) { |
| 186 | if (part.type === "text") return { text: part.text } |