New project with gemini thinking

This commit is contained in:
Madhu 2025-01-31 22:03:09 +05:30
parent 5d4bd68156
commit 64d4052e10
4 changed files with 42 additions and 0 deletions

View file

@ -0,0 +1,20 @@
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.models.google import Gemini
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.yfinance import YFinanceTools
import os
from dotenv import load_dotenv
load_dotenv()
thinking_agent = Agent(
name="Thinking Agent",
role="Think about the problem",
model=Gemini(id="gemini-2.0-flash-thinking-exp-1219", api_key=os.getenv("GOOGLE_API_KEY")),
instructions="Given the problem, think about it and provide a detailed explanation",
show_tool_calls=True,
markdown=True,
)
thinking_agent.print_response("Explain Deep Q Networks from first principles", stream=True)

View file

@ -0,0 +1,22 @@
from google import genai
import os
from dotenv import load_dotenv
load_dotenv()
client = genai.Client(api_key=os.getenv("GOOGLE_API_KEY"), http_options={'api_version':'v1alpha'})
import asyncio
config = {'thinking_config': {'include_thoughts': True}}
async def main():
chat = client.aio.chats.create(
model='gemini-2.0-flash-thinking-exp',
config=config
)
response = await chat.send_message('What is your name?')
print(response.text)
response = await chat.send_message('What did you just say before this?')
print(response.text)
asyncio.run(main())