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

Include Model Name in Completion Response #198

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Melbourneandrew
Copy link

@Melbourneandrew Melbourneandrew commented Feb 16, 2025

Including model name in non-streaming completion response. Desired outputs shaped like this:

{
  "...": "...",
  "_meta": {
    "usage": { ... }
  },
  "thinking": "...",
  "model": "<model name>",
}

Important

Add model name to non-streaming completion response in Instructor class.

  • Behavior:
    • Include model name in non-streaming completion response in chatCompletionStandard() in instructor.ts.
  • Misc:
    • Add changeset file blue-hats-behave.md for version tracking.

This description was created by Ellipsis for 91660c2. It will automatically update as commits are pushed.

Copy link

changeset-bot bot commented Feb 16, 2025

🦋 Changeset detected

Latest commit: 91660c2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@instructor-ai/instructor Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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! Reviewed everything up to 91660c2 in 1 minute and 21 seconds

More details
  • Looked at 23 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. src/instructor.ts:205
  • Draft comment:
    New model field inclusion in _meta looks appropriate. Consider adding tests or inline documentation confirming its expected source and behavior for future maintainability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 70%
    None
2. .changeset/blue-hats-behave.md:1
  • Draft comment:
    Changeset file looks good and clearly documents the patch.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 70%
    None
3. src/instructor.ts:205
  • Draft comment:
    The added 'model' field is nested under _meta, but the PR specification shows 'model' as a top‑level key. Ensure the response structure matches the desired output (i.e. 'model' and 'thinking' at the root level with only 'usage' inside _meta) or update the spec accordingly.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 70%
    The code shows a consistent pattern of keeping metadata fields under _meta. The comment suggests breaking this pattern without strong evidence. Moving 'model' to root level would be inconsistent with how 'usage' and 'thinking' are handled. The comment makes assumptions about a spec we can't see.
    I could be wrong about the spec - maybe there is documentation somewhere that explicitly requires 'model' to be at the root level.
    Without seeing clear evidence from a spec, we should assume the consistent pattern in the code is intentional. Breaking this pattern would reduce code consistency.
    Delete the comment. It suggests breaking a consistent pattern without strong evidence, and makes assumptions about requirements we can't verify.

Workflow ID: wflow_8mFUD6CWaHd7Tk5m


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

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.

1 participant