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

ENG-849 ENG-819 Refactor Anthropic parsing code for async and sync with httpx client #183

Merged
merged 33 commits into from
Jun 21, 2024

Conversation

kxtran
Copy link
Collaborator

@kxtran kxtran commented Jun 10, 2024

Description:

  • Update anthropic version to 0.29.0
  • Update parsing tools streaming anthropic response logic to work with the 0.29.0 version
  • Refactor parsing anthropic response to use httpx client
  • Update anthropic tests
  • Encapsulate initialize patcher in a class

@kxtran kxtran changed the title Refactor Anthropic parsing code for async and sync with httpx client ENG-849 ENG-819 Refactor Anthropic parsing code for async and sync with httpx client Jun 10, 2024
@kxtran kxtran requested a review from wenzhe-log10 June 11, 2024 19:27
log10/load.py Outdated Show resolved Hide resolved
log10/load.py Outdated Show resolved Hide resolved
log10/_httpx_utils.py Outdated Show resolved Hide resolved
log10/_httpx_utils.py Outdated Show resolved Hide resolved
log10/_httpx_utils.py Outdated Show resolved Hide resolved
log10/_httpx_utils.py Outdated Show resolved Hide resolved
log10/_httpx_utils.py Outdated Show resolved Hide resolved
log10/_httpx_utils.py Outdated Show resolved Hide resolved
log10/_httpx_utils.py Outdated Show resolved Hide resolved
@kxtran kxtran force-pushed the kt/update-anthropic-funcion-calls branch from 72a249f to 1cb5bc0 Compare June 12, 2024 20:23
@kxtran kxtran force-pushed the kt/update-anthropic-funcion-calls branch from 1cb5bc0 to d190b96 Compare June 12, 2024 21:02
@kxtran kxtran requested a review from wenzhe-log10 June 12, 2024 22:32
tests/test_anthropic.py Outdated Show resolved Hide resolved
Comment on lines -12 to +9
from log10.load import log10
from log10.load import Anthropic, AsyncAnthropic
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering if we should keep testing log10(anthropic) assume that's the main use case. Then add separate from log10.load import Anthropic, AsyncAnthropic tests (could be in a follow up PR).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we use log10(anthropic) in test_magentic.py, would that be enough coverage?

tests/pytest.ini Outdated Show resolved Hide resolved
examples/logging/anthropic_messages_not_given.py Outdated Show resolved Hide resolved
log10/load.py Outdated Show resolved Hide resolved
log10/load.py Show resolved Hide resolved
log10/_httpx_utils.py Show resolved Hide resolved
tests/test_magentic.py Outdated Show resolved Hide resolved


@pytest.fixture
def _fixt(llm_provider, magentic_models, request):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe rename chat_model?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated to _magentic_model_obj, is it okay?

@wenzhe-log10
Copy link
Collaborator

anthropic released 0.29.0 today. should we check if 0.29 works in this PR?

@kxtran
Copy link
Collaborator Author

kxtran commented Jun 21, 2024

anthropic released 0.29.0 today. should we check if 0.29 works in this PR?

I updated anthropic version to 0.29.0 and some of examples with the latest model. They all work as expected.

@kxtran kxtran requested a review from wenzhe-log10 June 21, 2024 19:47
Copy link
Collaborator

@wenzhe-log10 wenzhe-log10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! 💯

@kxtran kxtran merged commit e229ea4 into main Jun 21, 2024
2 checks passed
@kxtran kxtran deleted the kt/update-anthropic-funcion-calls branch June 21, 2024 20:33
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.

2 participants