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)
```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)