Merge pull request #48 from nahcol10/main

update the llm wrappers example for google ai / gemini
This commit is contained in:
Zachary Huang 2025-04-30 15:16:52 -04:00 committed by GitHub
commit 8418175881
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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)