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

I've been using gemini for the summarization of multi-page pdfs and using the chunking technique,

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744760298a4592133.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信