MCPcopy Create free account
hub / github.com/CaviraOSS/OpenReason / callGoogle

Function callGoogle

src/api/google.ts:3–7  ·  view source on GitHub ↗
(prompt: string, apiKey: string, model: string)

Source from the content-addressed store, hash-verified

1import { ChatGoogleGenerativeAI } from "@langchain/google-genai"
2
3export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected