Skip to content

![high](https://www.gstatic.com/codereviewagent/high-priority.svg) #158

@kristentr

Description

@kristentr

high

The genai_client.models.generate_content() call is synchronous and will block the event loop in your async function. The google-generativeai library provides an async version of this method. You should use await genai_client.models.generate_content_async(...) to maintain the non-blocking nature of your server.

            response = await genai_client.models.generate_content_async(
                model=RESEARCH_MODEL,
                contents=prompt,
                config={
                    "tools": [{"google_search": {}}],
                    "temperature": 0.1,  # Low temperature for factual accuracy
                },
            )

Originally posted by @gemini-code-assist[bot] in google-gemini/gemini-fullstack-langgraph-quickstart#203 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions