-
Notifications
You must be signed in to change notification settings - Fork 175
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: Add model selection support for Anthropic handler #124 #125
base: main
Are you sure you want to change the base?
Conversation
The Anthropic handler currently uses a hardcoded model (claude-3-opus-20240229). This change allows model selection through configuration, matching the behavior of the OpenAI handler. Changes: - Remove hardcoded model string - Use config loader to get model name from configuration - Update model settings initialization
Hi @eli64s, hope you are getting a good time. This pr is quite simple and will help a lot to those how wants to custom Anthropic usage on the tool. Can you give a quick view? Only 2 lines of code, promise. |
@diekotto Awesome, good catch! Reviewing now. |
@diekotto Looks like a unit test failed for the anthropic handler: FAILED tests/models/test_anthropic.py::test_make_request_api_error - Failed: DID NOT RAISE <class 'tenacity.RetryError'>
FAILED tests/models/test_anthropic.py::test_make_request_success - AssertionError: assert ('index', '<code>❯ REPLACE-ME</code>') == ('index', 'Generated text')
At index 1 diff: '<code>❯ REPLACE-ME</code>' != 'Generated text'
Full diff:
(
'index',
- 'Generated text',
+ '<code>❯ REPLACE-ME</code>',
)
FAILED tests/models/test_anthropic.py::test_build_payload - AttributeError: 'AnthropicHandler' object has no attribute 'model' Can you check this out? |
Yes, working on it. |
fe4f7d2
to
8abe727
Compare
@eli64s ready. The constructor of the handler don't create the client if the api key is not present. |
Results (49.07s):
|
The Anthropic handler currently uses a hardcoded model (claude-3-opus-20240229). This change allows model selection through configuration, matching the behavior of the OpenAI handler.
Changes:
Fixes #124