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

Fixes streaming for anthropic tool call. #119

Merged
merged 6 commits into from
Aug 2, 2024

Conversation

3coins
Copy link
Collaborator

@3coins 3coins commented Jul 23, 2024

Fixes #80
Replaces #81

@pratik60
Copy link

Any timelines on when we could merge this? The pr looks good to me, and the problem is blocking usage of Bedrock sonnet on our end.

@xAlstrat
Copy link

Just tried it in langgraph, but I had to adjust a little bit how to use it.

Here are the docs. I'm not sure if part of this PR or not. But I thought it would work seamlessly, and it didn't.

https://langchain-ai.github.io/langgraph/how-tos/streaming-tokens/#streaming-llm-tokens

langgraph==0.1.14
sonnet3.5 through Bedrock

@3coins 3coins force-pushed the fix-anthropic-tool-call branch from 3cc9bdc to ccb1b74 Compare July 30, 2024 04:47
@Bagel213
Copy link

Bagel213 commented Aug 1, 2024

Just ran into this same problem with Claude using ChatBedrock, good to see it close to being corrected! Thanks!

@ccurme
Copy link
Contributor

ccurme commented Aug 2, 2024

@3coins what work remains on this? Can we push it through?

@ccurme ccurme marked this pull request as ready for review August 2, 2024 16:32
@ccurme ccurme merged commit 0fe4dd9 into langchain-ai:main Aug 2, 2024
12 checks passed
@Bagel213
Copy link

Bagel213 commented Aug 2, 2024

I am still getting the same error using ChatBedrock with streaming=True.

File "/home/ec2-user/miniconda3/envs/intrepid/lib/python3.11/site-packages/langchain_aws/llms/bedrock.py", line 594, in _get_provider
if self.model_id.startswith("arn"):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded while calling a Python object

It works without issue with streaming not set.

@ccurme
Copy link
Contributor

ccurme commented Aug 2, 2024

I am still getting the same error using ChatBedrock with streaming=True.

File "/home/ec2-user/miniconda3/envs/intrepid/lib/python3.11/site-packages/langchain_aws/llms/bedrock.py", line 594, in _get_provider if self.model_id.startswith("arn"): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RecursionError: maximum recursion depth exceeded while calling a Python object

It works without issue with streaming not set.

Could you try again? This wasn't released at the time of your comment. Just released in langchain-aws==0.1.14.

@Bagel213
Copy link

Bagel213 commented Aug 3, 2024

Got it working with out the error.......realized I updated langchain and not langchain-aws. User error!

@3coins 3coins deleted the fix-anthropic-tool-call branch December 4, 2024 03:39
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.

Recursion depth error: Tool calling with streaming model
5 participants