-
-
Notifications
You must be signed in to change notification settings - Fork 734
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: support anthropic tools #569
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.
👍 Looks good to me!
- Reviewed the entire pull request up to 3dc0958
- Looked at
405
lines of code in8
files - Took 2 minutes and 10 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
4
additional comments because they didn't meet confidence threshold of85%
.
1. instructor/client_anthropic.py:37
:
- Assessed confidence :
50%
- Comment:
The changes in this file seem to be logically correct. However, it would be beneficial to update the tests to ensure the correct functioning of these changes. - Reasoning:
The PR is about supporting anthropic tools. The changes include modifications in the existing files and deletion of a file. The changes seem to be logically correct. However, there are no updates in the documentation or tests to reflect these changes.
2. instructor/function_calls.py:19
:
- Assessed confidence :
50%
- Comment:
The changes in this file seem to be logically correct. However, it would be beneficial to update the tests to ensure the correct functioning of these changes. - Reasoning:
The PR includes changes in the 'function_calls.py' file. The changes seem to be logically correct. However, it would be beneficial to update the tests to ensure the correct functioning of these changes.
3. instructor/test.py:1
:
- Assessed confidence :
50%
- Comment:
This file seems to be a test file. Please ensure that this file is added to the test suite. - Reasoning:
The PR includes a new file 'test.py'. This file seems to be a test file. However, it is not clear if this file is added to the test suite.
4. tests/llm/test_anthropic/evals/test_simple.py:7
:
- Assessed confidence :
50%
- Comment:
The changes in this file seem to be logically correct. However, it would be beneficial to run the tests to ensure the correct functioning of these changes. - Reasoning:
The PR includes changes in the 'test_simple.py' file. The changes seem to be logically correct. However, it would be beneficial to run the tests to ensure the correct functioning of these changes.
Workflow ID: wflow_lOO6Khiub3d7gpFw
Not what you expected? You can customize the content of the reviews using rules. Learn more here.
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.
- Performed an incremental review on 11aa65e
- Looked at
16
lines of code in1
files - Took 1 minute and 41 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
0
additional comments because they didn't meet confidence threshold of85%
.
Workflow ID: wflow_kiQfh9ZEWT6L9CzK
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. We'll respond in a few minutes. Learn more here.
@@ -56,6 +56,9 @@ mkdocs-rss-plugin = "^1.12.0" | |||
mkdocs-minify-plugin = "^0.8.0" | |||
mkdocs-redirects = "^1.2.1" | |||
|
|||
[tool.poetry.group.anthropic.dependencies] | |||
anthropic = "^0.23.1" |
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 anthropic
dependency is declared twice in this file. It's already declared as an optional dependency on line 30. Please remove this redundant declaration.
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!
- Performed an incremental review on 75a3598
- Looked at
31
lines of code in1
files - Took 2 minutes and 12 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
1
additional comments because they didn't meet confidence threshold of85%
.
1. pyproject.toml:70
:
- Assessed confidence :
100%
- Grade:
0%
- Comment:
The PR introduces a new dependency 'anthropic'. Please ensure that the documentation is updated to reflect this new dependency. - Reasoning:
The PR introduces a new dependency 'anthropic' in the pyproject.toml file. However, the PR description does not mention any changes in the documentation to reflect this new dependency. As per the best practices, any change in the library code, especially the addition of a new dependency, should be accompanied by corresponding updates in the documentation.
Workflow ID: wflow_buu45pbA8ToOGUhQ
Not what you expected? You can customize the content of the reviews using rules. Learn more here.
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!
- Performed an incremental review on b3853c2
- Looked at
16
lines of code in1
files - Took 2 minutes and 4 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
1
additional comments because they didn't meet confidence threshold of85%
.
1. pyproject.toml:71
:
- Assessed confidence :
100%
- Grade:
0%
- Comment:
The PR diff suggests that the[tool.poetry.extras]
section was removed, but the provided file content still includes it. Please double-check the changes made in thepyproject.toml
file. - Reasoning:
The PR diff shows that the[tool.poetry.extras]
section was removed from thepyproject.toml
file. However, the file content provided does not reflect this change. It seems like there might be a mistake in the diff. I need to comment on this discrepancy and suggest the author to double-check the changes made in thepyproject.toml
file.
Workflow ID: wflow_DfEUIXM4pP8FsPjI
Not what you expected? You can customize the content of the reviews using rules. Learn more here.
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!
- Performed an incremental review on ad36fa6
- Looked at
86
lines of code in2
files - Took 1 minute and 41 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
2
additional comments because they didn't meet confidence threshold of85%
.
1. instructor/function_calls.py:65
:
- Assessed confidence :
80%
- Comment:
Theanthropic_schema
method is now directly accessing theopenai_schema
method after the removal of themodel_schema
method. This could potentially lead to incorrect behavior as theanthropic_schema
method might not be expecting the same output as theopenai_schema
method. Please ensure that this change is intended and that it does not introduce any bugs. - Reasoning:
The changes in theOpenAISchema
class infunction_calls.py
seem to be a bit confusing. Themodel_schema
method has been removed and its logic has been moved to theopenai_schema
method. However, themodel_schema
method was also being called in theanthropic_schema
method, which now directly accesses theopenai_schema
method. This could potentially lead to incorrect behavior as theanthropic_schema
method might not be expecting the same output as theopenai_schema
method.
2. instructor/dsl/partial.py:131
:
- Assessed confidence :
50%
- Comment:
Themodel_from_chunks
andmodel_from_chunks_async
methods have been updated to handle cases wherepotential_object
is None. Please ensure that this change doesn't introduce any unexpected behavior in other parts of the code that use these methods. - Reasoning:
In thepartial.py
file, themodel_from_chunks
andmodel_from_chunks_async
methods have been updated to handle cases wherepotential_object
is None. This is a good change as it prevents potentialNoneType
errors. However, it's important to ensure that this change doesn't introduce any unexpected behavior in other parts of the code that use these methods.
Workflow ID: wflow_DaLtnUKTn7raMrNj
Not what you expected? You can customize the content of the reviews using rules. Learn more here.
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!
- Performed an incremental review on 7a01c07
- Looked at
199
lines of code in1
files - Took 2 minutes and 48 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
1
additional comments because they didn't meet confidence threshold of85%
.
1. poetry.lock:125
:
- Assessed confidence :
80%
- Comment:
It seems like the 'optional' field for all dependencies has been changed from 'true' to 'false'. Could you please clarify why this change was necessary? If these dependencies are not required for all installations, it might be better to keep them as optional. - Reasoning:
The PR description mentions that a new dependency has been added, and the diff confirms this. However, it's not clear why the 'optional' field for all dependencies in the poetry.lock file has been changed from 'true' to 'false'. This could potentially cause issues if these dependencies are not actually required for all installations of the project.
Workflow ID: wflow_bGZpnsQs6gaz2sXm
Not what you expected? You can customize the content of the reviews using rules. Learn more here.
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!
- Performed an incremental review on 1bbd8db
- Looked at
346
lines of code in12
files - Took 1 minute and 40 seconds to review
More info
- Skipped
1
files when reviewing. - Skipped posting
0
additional comments because they didn't meet confidence threshold of85%
.
Workflow ID: wflow_eTkFb8v1i5TyBbL0
Not what you expected? You can customize the content of the reviews using rules. Learn more here.
"role": "assistant", | ||
"content": f"Validation Errors found:\n{exception}\nRecall the function correctly, fix the errors", | ||
"role": "user", | ||
"content": f"Validation Errors found:\n{exception}\nReca ll the function correctly, fix the errors from\n{response.content}", |
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.
Small typo: Rec all
"role": "assistant", | ||
"content": f"Validation Errors found:\n{exception}\nRecall the function correctly, fix the errors", | ||
"role": "user", | ||
"content": f"Validation Errors found:\n{exception}\nReca ll the function correctly, fix the errors from\n{response.content}", |
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.
Might be better to use the following format from official documentation to indicate an error?
{
"role": "user",
"content": [
{
"type": "tool_result",
"tool_use_id": "toolu_01A09q90qw90lq917835lq9",
"content": "ConnectionError: the weather service API is not available (HTTP 500)",
"is_error": true
}
]
}
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.
oh this is great are you able to kick of a 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.
Ok I will take a look at it tomorrow
Summary:
This PR introduces support for anthropic tools in the instructor library, updates several functions and classes, adds and updates tests, includes a new dependency, updates the
poetry.lock
file, and updates documentation files.Key points:
from_anthropic
function inclient_anthropic.py
to supportANTHROPIC_TOOLS
mode.OpenAISchema
class infunction_calls.py
to handle anthropic schema.process_response
function inprocess_response.py
to handle responses in the anthropic tools mode.test.py
and updatedtest_simple.py
.pyproject.toml
to include anthropic dependency.poetry.lock
file, changing the optional status of several dependencies to false.docs
directory and added a newmd
filedocs/hub/anthropic.md
.README.md
file.Generated with ❤️ by ellipsis.dev