最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

google cloud platform - Does gemini provide async prompting like anthropic and openai? - Stack Overflow

programmeradmin1浏览0评论

I've been using gemini for the summarization of multi-page pdfs and using the chunking technique, but as the parallel processing is being managed through the code, it's a bit slower. I believe Async API will solve my problem, but I couldn't find it in the documentation.

I've been using gemini for the summarization of multi-page pdfs and using the chunking technique, but as the parallel processing is being managed through the code, it's a bit slower. I believe Async API will solve my problem, but I couldn't find it in the documentation.

Share Improve this question edited Mar 27 at 13:34 VLAZ 29.1k9 gold badges63 silver badges84 bronze badges asked Mar 12 at 9:58 Abhishek PandaAbhishek Panda 314 bronze badges 2
  • 1 Hi @Abhishek Panda, Does this link1 and link2 helps you? – PUTHINEEDI RAMOJI RAO Commented Mar 12 at 12:23
  • Hello @PUTHINEEDIRAMOJIRAO, These 2 links are using the Python async, and I'm using that for now, but I wanted to know if there's any Gemini native async API just like OpenAI or Antrhopic has, where the workload would be on the Gemini server instead on the on-premise. Thanks for the help though. – Abhishek Panda Commented Mar 17 at 8:58
Add a comment  | 

1 Answer 1

Reset to default 1

Yes, Gemini GenerativeModel has a native async API implementation - generate_content_async. You can easily wrap it under async client framework such as Python asyncio.

This blog from Paul Balm went in detail with sample code on how to prompting Gemini async natively.

发布评论

评论列表(0)

  1. 暂无评论