Open anandanand84 opened 1 week ago
Hey @anandanand84, can you share the complete code? I will try my best to help you with this issue
@manthanguptaa you can reproduce by just changing the model to Gemini 1.5 flash as shown above after creating a new project using phi ws up --group api
. You can try using the swagger and you will be able to reproduce. it doesnt work with any other model other than open ai.
if you want an simpler example. create a file main.py
with contents
from phi.agent import Agent # noqa
#from phi.model.ollama import Ollama
from phi.playground import Playground, serve_playground_app
from phi.storage.agent.sqlite import SqlAgentStorage
from phi.model.google import Gemini
from phi.model.groq import Groq
from phi.model.openai import OpenAIChat
from phi.model.openai.like import OpenAILike
from phi.model.groq import Groq
from phi.model.sambanova import Sambanova
example = Agent(
name="example",
agent_id="exmaple",
# model=Sambanova(id="Meta-Llama-3.2-3B-Instruct"), # Not working, doesn't follow tool call and redirect to other agents
# model=Groq(id="llama3-groq-70b-8192-tool-use-preview"),
# model=Ollama(id="llama3.1"),
model=Gemini(id="gemini-1.5-flash"),#gemini-1.5-pro-exp-0827
# model = OpenAIChat(id="gpt-4o"),
# model = OpenAILike(
# id="mistral-nemo:latest",
# base_url="http://localhost:11434/v1",
# ),
description="You are a helpful assistant that can answer questions.",
instructions=[],
add_history_to_messages=True,
stream=False,
# additional_context=files.read_file('./prompts/router.context.md'),
storage=SqlAgentStorage(table_name="example_agent", db_file="agents.db"),
show_tool_calls=True,
debug_mode=True,
)
app = Playground(agents=[example]).get_app()
if __name__ == "__main__":
serve_playground_app("main:app", reload=True)
pip install phidata==2.5.3
python main.py
Try it from the playground
https://www.phidata.app/playground?port=7777&endpoint=localhost%253A7777&agent=exmaple
you will get error
A sample agent with following configuration fails when calling using localhost:8000/docs /run endpoint with the following error.