-
-
Notifications
You must be signed in to change notification settings - Fork 602
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
Tentative Fix for Mistral Fix #985
Conversation
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.
❌ Changes requested. Reviewed everything up to ad7482b in 10 seconds
More details
- Looked at
73
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_VdcR91DiSFwFC2KT
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/client_mistral.py
Outdated
**kwargs: Any, | ||
) -> instructor.Instructor | instructor.AsyncInstructor: | ||
assert mode in { | ||
instructor.Mode.MISTRAL_TOOLS, | ||
}, "Mode be one of {instructor.Mode.MISTRAL_TOOLS}" | ||
|
||
assert isinstance( | ||
client, (mistralai.client.MistralClient, mistralaiasynccli.MistralAsyncClient) | ||
), "Client must be an instance of mistralai.client.MistralClient or mistralai.async_cli.MistralAsyncClient" | ||
client, (Mistral) |
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.
The isinstance
check should use a tuple for the second argument. Use (Mistral,)
instead of (Mistral)
. This ensures it's treated as a tuple.
client, (Mistral) | |
client, (Mistral,) |
Deploying instructor with Cloudflare Pages
|
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 754f707 in 13 seconds
More details
- Looked at
36
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. instructor/client_mistral.py:36
- Draft comment:
The assertion message is unclear. Consider rephrasing it for clarity.
}, "Mode must be one of {instructor.Mode.MISTRAL_TOOLS}"
- Reason this comment was not posted:
Confidence changes required:50%
The assertion message on line 36 is missing a verb, which makes it unclear. It should be corrected for better readability.
Workflow ID: wflow_MWhajUgEn6u3ycNi
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 0ceb7b7 in 12 seconds
More details
- Looked at
27
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. instructor/client_vertexai.py:9
- Draft comment:
Ensure that removing# type: ignore
from thejsonref
import does not introduce type checking issues. This change is also present ininstructor/utils.py
. - Reason this comment was not posted:
Confidence changes required:50%
The import statement forjsonref
was changed to remove the# type: ignore
comment. This change was made in two files,instructor/client_vertexai.py
andinstructor/utils.py
. The# type: ignore
comment is typically used to suppress type checking errors. Removing it might cause type checking errors ifjsonref
is not properly typed. However, if the library is now properly typed, this change is fine. It's important to ensure that the removal of# type: ignore
does not introduce any type checking issues.
Workflow ID: wflow_xWd3nCujgk3F6tP4
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 dcca805 in 28 seconds
More details
- Looked at
66
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. pyproject.toml:35
- Draft comment:
The version formistralai
is inconsistent with the PR description. The description mentions updating to version^1.0.3
, but the file shows^0.1.8
. Please ensure the correct version is specified. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The comment is about a change made in the diff, specifically the version change ofmistralai
. However, it references the PR description, which I cannot verify. The comment is speculative as it asks to ensure the correct version is specified, which violates the rules. Without access to the PR description, I cannot confirm the discrepancy, so I should assume the comment is not useful.
I might be missing the context of the PR description, which could validate the comment. However, the rules state not to ask for confirmation or verification, so the comment might still be invalid even if the discrepancy exists.
Even if the PR description mentions a different version, the comment is speculative and asks for verification, which is against the rules.
Delete the comment as it is speculative and asks for verification, which is against the rules.
Workflow ID: wflow_dkqbeNPtT3djzLq4
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 64111c7 in 13 seconds
More details
- Looked at
22
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. pyproject.toml:35
- Draft comment:
Ensure that themistralai
version update to^1.0.3
is consistent across all relevant sections in thepyproject.toml
. It appears correct here and in other sections like[tool.poetry.group.test-docs.dependencies]
. - Reason this comment was not posted:
Confidence changes required:10%
The PR updates themistralai
dependency version inpyproject.toml
from^0.1.8
to^1.0.3
. This change is consistent across the file, which is good. However, it's important to ensure that all instances of the version update are correct and consistent.
Workflow ID: wflow_gshY1kmo22Zr2BA4
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Skipped PR review on c9461b0 because no changed files had a supported extension. If you think this was in error, please contact us and we'll fix it right away. Generated with ❤️ by ellipsis.dev |
This PR allows us to make requests to Mistral as seen below import instructor
from mistralai import Mistral
from pydantic import BaseModel
import os
client = Mistral(api_key=os.getenv("MISTRAL_API_KEY"))
client = instructor.from_mistral(client)
class User(BaseModel):
name: str
age: int
resp = client.chat.completions.create(
model="mistral-large-latest",
messages=[
{
"role": "user",
"content": "Extract the user information from the following text: John is 25 years old and works as a software engineer.",
}
],
response_model=User,
)
print(resp)
# > name='John' age=25 |
This also works for the async version
|
This seems to fix the issue with mistral - we just need to set the new dependency to their new client version.
fix: update Mistral client version and add async support
Summary:
Fix Mistral client issue by updating client version, adding async support, and updating dependencies.
Key points:
from_mistral()
inclient_mistral.py
.use_async
parameter for sync/async operations.client.chat.complete
for sync andclient.chat.complete_async
for async operations.mistralai
to^1.0.3
,openai
to^1.45.0
, andanthropic
to^0.34.0
inpyproject.toml
.client_vertexai.py
andutils.py
.Generated with ❤️ by ellipsis.dev