Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow feature not working with Gemini and Groq model. #1693

Closed
samyogdhital opened this issue Jan 3, 2025 · 6 comments
Closed

Workflow feature not working with Gemini and Groq model. #1693

samyogdhital opened this issue Jan 3, 2025 · 6 comments

Comments

@samyogdhital
Copy link

samyogdhital commented Jan 3, 2025

I ran this workflow 05_playground.py code as well from github.

I changed the model from openai to google gemini. (I don't have openai subscription so can't check if that is working or not.)
(Groq also gives the similar kind of error.)

I am getting similar error here as well.
image

Error in terminal.

image

@samyogdhital
Copy link
Author

I also followed this workflow docs page code.

Did same as above replaced openai model with groq and gemini.

I am getting this error on console.
(This one is with groq)

image

And when I use gemini model 2.0 model instead of groq,
i get this error.

image

@dirkbrnd
Copy link
Contributor

@samyogdhital

  1. For Groq you have to remove the line structured_outputs=True. Our docs are not clear enough on this and the developer experience can be improved, we will work on this. After you do that, you should notice that it now has an error because Groq doesn't allow tool calling and structured outputs together. This is a limitation of Groq. So depending on your use-case you might have to adjust the example.
  2. For Gemini I got better results when I removed structured_outputs=True but the model would still occasionally get it wrong. We can look into better ways to engage with the Gemini model.

We want to improve the developer experience on structured outputs and make them more reliable. We'll work on this.

@samyogdhital
Copy link
Author

@dirkbrnd Getting this error with gemini model. Looking forward to worflow perfectly working with gemini model.
image

@samyogdhital
Copy link
Author

+1 for this

@dirkbrnd
Copy link
Contributor

I used this configuration and it worked for me.

searcher: Agent = Agent(
        model=Gemini(id="gemini-2.0-flash-exp"),
        tools=[DuckDuckGo()],
        instructions=["Given a topic, search for the top 5 articles."],
        response_model=SearchResults,
    )

    # Define an Agent that will write the blog post
    writer: Agent = Agent(
        model=Gemini(id="gemini-2.0-flash-exp"),
        instructions=[
            "You will be provided with a topic and a list of top articles on that topic.",
            "Carefully read each article and generate a New York Times worthy blog post on that topic.",
            "Break the blog post into sections and provide key takeaways at the end.",
            "Make sure the title is catchy and engaging.",
            "Always provide sources, do not make up information or sources.",
        ],
        markdown=True,
    )

@samyogdhital
Copy link
Author

Thanks. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants