(prompt: string, apiKey: string, model: string)
| 1 | import { ChatGoogleGenerativeAI } from "@langchain/google-genai" |
| 2 | |
| 3 | export async function callGoogle(prompt: string, apiKey: string, model: string): Promise<string> { |
| 4 | const client = new ChatGoogleGenerativeAI({ model, apiKey }) |
| 5 | const res = await (client as any).invoke(prompt) |
| 6 | return typeof res.content === "string" ? res.content : Array.isArray(res.content) ? res.content.map((c: any) => (typeof c === "string" ? c : c.text || "")).join("") : JSON.stringify(res.content) |
| 7 | } |
nothing calls this directly
no outgoing calls
no test coverage detected