Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new cli for batch jobs #754

Merged
merged 7 commits into from
Jun 19, 2024
Merged

feat: new cli for batch jobs #754

merged 7 commits into from
Jun 19, 2024

Conversation

ivanleomk
Copy link
Collaborator

@ivanleomk ivanleomk commented Jun 12, 2024

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

🚀 This description was created by Ellipsis for commit db0ba28

Summary:

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

Key points:

  • Added BatchJob class in instructor/batch.py for creating .jsonl files for batch jobs.
  • Added CLI commands in instructor/cli/batch.py to list, create, and cancel batch jobs.
  • Integrated new batch job commands into the main CLI in instructor/cli/cli.py.

Generated with ❤️ by ellipsis.dev

Copy link

cloudflare-workers-and-pages bot commented Jun 12, 2024

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

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 3badff5 in 1 minute and 15 seconds

More details
  • Looked at 211 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_3LI3kzPyGPA6FGJO


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

instructor/cli/batch.py Outdated Show resolved Hide resolved
instructor/cli/batch.py Outdated Show resolved Hide resolved
instructor/batch.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 7a63dfb in 1 minute and 56 seconds

More details
  • Looked at 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_5kWT7MemEldzO2Vz


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

instructor/cli/batch.py Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on f0f3e54 in 3 minutes and 11 seconds

More details
  • Looked at 49 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_bPuD4CewQk6OgWvI


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on db0ba28 in 2 minutes and 3 seconds

More details
  • Looked at 49 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. instructor/cli/batch.py:78
  • Draft comment:
    The use of ... in typer.Option is unnecessary when a help message is provided. It should be removed to avoid potential confusion.
    file_path: str = typer.Option(help="File containing the batch job requests"),
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 85%.
2. instructor/cli/batch.py:100
  • Draft comment:
    The use of ... in typer.Option is unnecessary when a help message is provided. It should be removed to avoid potential confusion.
batch_id: str = typer.Option(help="Batch job ID to cancel"),
  • Reason this comment was not posted:
    Confidence of 80% on close inspection, compared to threshold of 85%.

Workflow ID: wflow_6WUeznJX5ZWrqr2v


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@ivanleomk ivanleomk requested a review from jxnl June 13, 2024 08:23
@jxnl jxnl changed the title New CLI for batch jobs feat: new cli for batch jobs Jun 16, 2024
@jxnl
Copy link
Owner

jxnl commented Jun 16, 2024

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

@ivanleomk
Copy link
Collaborator Author

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.

batch_recording.mp4

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

@ivanleomk ivanleomk merged commit 79f6904 into main Jun 19, 2024
14 of 15 checks passed
@ivanleomk ivanleomk deleted the add-batch-cli branch June 19, 2024 07:39
nikhilsharma26500 added a commit to nikhilsharma26500/instructor that referenced this pull request Jun 19, 2024
@slavakurilyak
Copy link
Contributor

When can we expect the next release to include this?

Excited to use this batch CLI command

@ivanleomk
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants