instructor-ai / instructor

structured outputs for llms
https://python.useinstructor.com/
MIT License
8.29k stars 660 forks source link

Implemennt the anthropic batch api in batch.py #1063

Open jxnl opened 1 month ago

jxnl commented 1 month ago

https://www.anthropic.com/news/message-batches-api

The batch API is now available in Anthropic. I would be interested in someone helping out and being able to support this.

josca42 commented 1 month ago

I can create a pr for this and help maintain it. Since I need this functionality in my project, where I use instructor quite a lot.

If no in else is chiming in today. I'll look into it and hopefully submit a pr tomorrow.

josca42 commented 1 month ago

Created pr here: https://github.com/instructor-ai/instructor/pull/1075

Arrhh, just saw you created a pull request 3 days ago.. Shoot... Hmm, ok.. I guess that's it then.

Thanks for creating the library it s really useful.

jxnl commented 1 month ago

this is my fault for not tagging :(

economy commented 1 week ago

Not sure if this is working yet, on create-from-file getting:

BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'requests.0.params: Field required'}}

Am I missing something? Happy to help improve this if needed

economy commented 1 week ago

https://github.com/instructor-ai/instructor/pull/1193 addresses changes to create_from_messages to match what Anthropic's API is expecting