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

- Dominant language
- TypeScript
- Stars
- 2.6k
- Forks
- 731
- PR merge metrics
- No merged PRs in 30d
Description

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
Assessment
This issue has not been assessed yet.