jxnl / instructor

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

feat: new cli for batch jobs #754

Closed ivanleomk closed 2 weeks ago

ivanleomk commented 3 weeks ago

This targets #604 by implementing two main new features

  1. A new BatchJob class which allows users to create .jsonl files which are compatible with OpenAI's new batch job function
  2. a batch cli command that allows users to see all outstanding jobs, create a new batch job and cancel an existing batch jobs

:rocket: This description was created by Ellipsis for commit db0ba2880f8a6f1eff96ff27cc27dca75e7dd191

Summary:

This PR introduces a new BatchJob class and CLI commands for managing batch jobs with OpenAI's API.

Key points:


Generated with :heart: by ellipsis.dev

cloudflare-pages[bot] commented 3 weeks ago

Deploying instructor with  Cloudflare Pages  Cloudflare Pages

Latest commit: 50eabf2
Status: ✅  Deploy successful!
Preview URL: https://7a5f9188.instructor.pages.dev
Branch Preview URL: https://add-batch-cli.instructor.pages.dev

View logs

jxnl commented 2 weeks ago

please add a lil recording and doc pages before we're ready to merge

ivanleomk commented 2 weeks ago

This is a video recording of the cli in action where we use a generated output.jsonl file in order to create a batch job, cancel the same batch job and also list all existing batch jobs.

https://github.com/jxnl/instructor/assets/45760326/b56d4714-bea4-4a7d-bb5d-f673f5dc2550

Also added a docs page which shows a new snippet on how to generate these .jsonl files

slavakurilyak commented 1 week ago

When can we expect the next release to include this?

Excited to use this batch CLI command

ivanleomk commented 1 week ago

@slavakurilyak we just released v1.3.4 which has it!