google-gemini / google-gemini/live-api-web-console

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

Open
#158 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.6k
Forks
731
PR merge metrics
No merged PRs in 30d

Description

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

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.

```suggestion
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 https://github.com/google-gemini/gemini-fullstack-langgraph-quickstart/pull/203#discussion_r2971865354_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.