From 8093d4bd2e6af1636ece77aad9de484385ff9f14 Mon Sep 17 00:00:00 2001 From: lochan paudel Date: Thu, 1 May 2025 00:11:55 +0530 Subject: [PATCH] update the llm wrappers example for google ai / gemini --- docs/utility_function/llm.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/utility_function/llm.md b/docs/utility_function/llm.md index 68f11b7..a849f79 100644 --- a/docs/utility_function/llm.md +++ b/docs/utility_function/llm.md @@ -45,13 +45,13 @@ Here, we provide some minimal example implementations: 3. Google (Generative AI Studio / PaLM API) ```python def call_llm(prompt): - import google.generativeai as genai - genai.configure(api_key="YOUR_API_KEY_HERE") - r = genai.generate_text( - model="models/text-bison-001", - prompt=prompt - ) - return r.result + from google import genai + client = genai.Client(api_key='GEMINI_API_KEY') + response = client.models.generate_content( + model='gemini-2.0-flash-001', + contents=prompt + ) + return response.text ``` 4. Azure (Azure OpenAI)