update the llm wrappers example for google ai / gemini

This commit is contained in:
lochan paudel 2025-05-01 00:11:55 +05:30
parent 000dc61ef5
commit 8093d4bd2e
1 changed files with 7 additions and 7 deletions

View File

@ -45,13 +45,13 @@ Here, we provide some minimal example implementations:
3. Google (Generative AI Studio / PaLM API) 3. Google (Generative AI Studio / PaLM API)
```python ```python
def call_llm(prompt): def call_llm(prompt):
import google.generativeai as genai from google import genai
genai.configure(api_key="YOUR_API_KEY_HERE") client = genai.Client(api_key='GEMINI_API_KEY')
r = genai.generate_text( response = client.models.generate_content(
model="models/text-bison-001", model='gemini-2.0-flash-001',
prompt=prompt contents=prompt
) )
return r.result return response.text
``` ```
4. Azure (Azure OpenAI) 4. Azure (Azure OpenAI)