-
Notifications
You must be signed in to change notification settings - Fork 64
new parser for json + thinking output + tests using deepseek r1 on groq #195
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
Conversation
…using deepseek r1 on groq
🦋 Changeset detectedLatest commit: e78b419 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
There was a problem hiding this 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 ffd8b76 in 1 minute and 37 seconds
More details
- Looked at
275
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
6
drafted comments based on config settings.
1. src/constants/providers.ts:12
- Draft comment:
Consider adding a default parser toMODE_TO_RESPONSE_PARSER
to handle modes that don't have a specific parser defined. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
While having a default parser might seem like a good practice, we don't have enough context to know if other modes need parsers or if they're handled differently elsewhere. The code specifically adds only thinkingJsonParser for THINKING_MD_JSON mode, which seems intentional. Adding a default parser could mask errors if a mode actually needs specific parsing.
The comment might be identifying a legitimate architectural concern - what happens when other modes don't have parsers? There could be potential runtime errors.
Without seeing how this code is used elsewhere, we can't be certain that a default parser is needed or even appropriate. The explicit mapping might be intentional to catch missing parser errors early.
The comment should be deleted as it makes assumptions about the architecture without sufficient context and may suggest a change that goes against the intentional design.
2. src/instructor.ts:192
- Draft comment:
Ensure that the default parser used inchatCompletionStandard
is appropriate for all modes or consider adding a warning if a mode-specific parser is not found. - Reason this comment was not posted:
Confidence changes required:70%
ThechatCompletionStandard
method usesOAIResponseParser
as a default parser, which might not be suitable for all modes. This could lead to incorrect parsing if a mode-specific parser is not defined.
3. src/types/index.ts:64
- Draft comment:
Ensure thethinking
property inCompletionMeta
is consistently used across the codebase. - Reason this comment was not posted:
Confidence changes required:50%
Thethinking
property is added toCompletionMeta
in multiple places. This should be consistent across the codebase to avoid potential issues.
4. tests/deepseek.test.ts:58
- Draft comment:
Consider using a configuration or environment variable for the model name to improve flexibility and maintainability. - Reason this comment was not posted:
Confidence changes required:60%
The test case forGROQ
provider indeepseek.test.ts
uses a hardcoded model name. This could lead to issues if the model name changes or is not available.
5. tests/deepseek.test.ts:50
- Draft comment:
The logic for creating anInstructor
instance and making a call toclient.chat.completions.create
is repeated here and intests/mode.test.ts
. Consider refactoring to avoid code duplication. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
While DRY is an important principle, I can't verify the duplication without seeing mode.test.ts. The setup code here seems like fairly standard test setup that might need to vary between tests. Test files often need similar but slightly different setups.
I might be too quick to dismiss potential duplication. If the setup is exactly the same, having a shared test utility function could make the tests more maintainable.
Without seeing the other file, I can't be confident enough that this is problematic duplication versus necessary test setup variation. The comment requires more context to be actionable.
Delete the comment since we can't verify the duplication claim without seeing the other file, and test setup code often needs to vary between test cases.
6. tests/mode.test.ts:128
- Draft comment:
The logic for creating anInstructor
instance and making a call toclient.chat.completions.create
is repeated here and intests/deepseek.test.ts
. Consider refactoring to avoid code duplication. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_ZMnFuo7QM9X6Nxgm
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Deploying instructor-js with
|
Latest commit: |
718d093
|
Status: | ✅ Deploy successful! |
Preview URL: | https://7b1946a7.instructor-js.pages.dev |
Branch Preview URL: | https://thinking-mode.instructor-js.pages.dev |
There was a problem hiding this 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 6e2de78 in 12 seconds
More details
- Looked at
25
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. .github/workflows/test-pr.yml:26
- Draft comment:
Ensure that theGROQ_API_KEY
is correctly set in the repository secrets to avoid runtime errors. - Reason this comment was not posted:
Confidence changes required:50%
The PR adds a new environment variableGROQ_API_KEY
to the GitHub Actions workflows. This is consistent across bothtest-pr.yml
andtest.yml
. The change seems correct and necessary for the new functionality.
2. .github/workflows/test-pr.yml:26
- Draft comment:
Ensure that documentation and tests are updated to reflect the addition of GROQ_API_KEY. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_IlBl15huF80s6ZYi
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this 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 718d093 in 16 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. tests/deepseek.test.ts:43
- Draft comment:
If the library code or functionality has changed, ensure that the documentation and tests are updated accordingly. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_Ey3tgEL4eB9E7LWu
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this 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 e78b419 in 20 seconds
More details
- Looked at
11
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. .changeset/little-cougars-bow.md:5
- Draft comment:
Ensure the description is clear and concise, explaining the purpose of the new mode. - Reason this comment was not posted:
Confidence changes required:0%
The changeset file is correctly formatted and provides a clear description of the change.
2. .changeset/little-cougars-bow.md:1
- Draft comment:
Ensure this new markdown file is added to mkdocs.yml. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_rcMJqHSSM3MYftRa
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Adds
THINKING_MD_JSON
mode for parsing JSON with thinking blocks, updates dependencies, and includes tests forGROQ
provider.THINKING_MD_JSON
mode to parse thinking blocks from markdown JSON responses inproviders.ts
andinstructor.ts
.MODE_TO_RESPONSE_PARSER
to includethinkingJsonParser
forTHINKING_MD_JSON
mode.THINKING_MD_JSON
mode forGROQ
provider with modeldeepseek-r1-distill-llama-70b
.deepseek.test.ts
to testTHINKING_MD_JSON
mode withGROQ
provider.mode.test.ts
to includeTHINKING_MD_JSON
mode in test cases.zod-stream
to3.0.0
inpackage.json
.GROQ_API_KEY
totest-pr.yml
andtest.yml
.Dimitri Kennedy
to contributors inpackage.json
.This description was created by
for e78b419. It will automatically update as commits are pushed.