camel icon indicating copy to clipboard operation
camel copied to clipboard

feat: add batch api

Open renxinxing123 opened this issue 10 months ago • 0 comments

Description

This update introduces batch API functionality to openai_model.py, accompanied by a relevant example. The batch API enables users to process multiple requests simultaneously, improving efficiency and reducing costs by up to 50% compared to individual API calls. This is particularly beneficial for large-scale data processing tasks that are not time-sensitive.

#1546

Checklist

Please review the following items and mark them with an x where applicable.

  • [x] I have read the [CONTRIBUTION](https://github.com/camel-ai/camel/blob/master/CONTRIBUTING.md) guide (required)
  • [x] I have linked this PR to an issue using the Development section on the right sidebar or by adding Fixes #issue-number in the PR description (required)
  • [x] I have checked if any dependencies need to be added or updated in pyproject.toml and poetry.lock
  • [ ] I have updated the tests accordingly (required for a bug fix or a new feature)
  • [ ] I have updated the documentation if needed
  • [x] I have added examples if this is a new feature

renxinxing123 avatar Feb 25 '25 10:02 renxinxing123