Problem in the playground

Hi,
Can someone help me solve this problem please?
Everything seems OK on the interface and I have no errors when debugging, but as soon as I start a conversation, I have this error message!


Thank you for your help

Hi @adilsasse
Thank you for reaching out and using Phidata! I’ve tagged the relevant engineers to assist you with your query. We aim to respond within 24 hours.
If this is urgent, please feel free to let us know, and we’ll do our best to prioritize it.
Thanks for your patience!

Hey @adilsasse can you share the agent config you are running?

I just replaced the Gemini model with GTP-4o and it works.
the model must be configured to run text generation in streaming mode by default, otherwise it doesn’t work.
Gemini is not configured for streaming by default.
Can someone help me add this in the code?
Here is the code for one of the agents I use:

“”"
from phi.model.google import Gemini


web_search_agent = Agent(
name=“WebAgent”,
description=“This is the agent for searching content from the web”,
model=Gemini(id=“gemini-1.5-flash”),
tools=[DuckDuckGo()],
instructions=[“Always include the sources”],
storage=SqlAgentStorage(table_name=“web_search_agent”, db_file=“agents.db”),
add_history_to_messages=True,
show_tool_calls=True,
markdown=True,
debug_mode=True,


app = Playground(agents=[finance_agent, web_search_agent]).get_app()

if name == “main”:
serve_playground_app(“playground:app”, reload=True)

1 Like

sorry for the inconvenience. I just found the answer in the repo on github :
cookbook/playground/gemini_agents.py

you just have to put this parameter “get_app(use_async=False)” instead of “get_app()” at the line “app = Playground(agents=[finance_agent, web_search_agent]).get_app()”

Thanks

1 Like

I am getting the same error and i am using model=Groq(id=“llama3-70b-8192”)
Can someone suggest how to fix the issue

Hi @jaibhavani
Thank you for reaching out and using Phidata! I’ve tagged the relevant engineers to assist you with your query. We aim to respond within 48 hours.
If this is urgent, please feel free to let us know, and we’ll do our best to prioritize it.
Thanks for your patience!

@jaibhavani can you share your code?

from phi.agent import Agent
from phi.model.groq import Groq
from phi.tools.yfinance import YFinanceTools
from phi.tools.duckduckgo import DuckDuckGo
import openai
import os
from dotenv import load_dotenv
load_dotenv()
openai.api_key=os.getenv(“OPENAI_API_KEY”)

WebSearch Agent

web_search_agent = Agent(
name=“web search agent”,
role=“Search the web for information”,
model=Groq(id=“llama3-70b-8192”),
tools=[DuckDuckGo()],
instructions=[“Always include the source”],
show_tool_calls=True,
markdown=True

)

Financial agent llama3-70b-8192

finance_agent = Agent(
name=“Finance AI Agent”,
model=Groq(id=“llama3-70b-8192”),
tools=[
YFinanceTools(stock_price=True, analyst_recommendations=True, stock_fundamentals=True, company_news=True)
],
instructions=[“Use tables to display the data”],
show_tool_calls=True,
markdown=True
)

multi_ai_agent = Agent(
model=Groq(id=“llama3-70b-8192”),
team=[web_search_agent, finance_agent],
instructions=[“Always include sources”, “Use tables to display the data”],
show_tool_calls=True,
markdown=True
)

multi_ai_agent.print_response(“Summarize analyst recommendations and share the latest news for NVDA”, stream=True)

@manthanguptaa i have shared the code