-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat(anthropic): Add support for container reuse for code execution #9109
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(anthropic): Add support for container reuse for code execution #9109
Conversation
Adds `container` parameter to `ChatAnthropicCallOptions` and passes it through to Anthropic client. See https://docs.claude.com/en/docs/agents-and-tools/tool-use/code-execution-tool#container-reuse
|
|
@pokey is attempting to deploy a commit to the LangChain Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
Do we want an integration test? |
christian-bromann
left a comment
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.
LGTM 👍
If you can come up with an easy one that validates the functionality and is stable, let's do it! |
hntrl
left a comment
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.
an integration test would be handy! And because this is a new feature add it would be good to add a changeset
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.
am fine to keep this, but as commentary I'm not sure how much benefit we get from testing invocationParams directly (it's only part of the messages + options -> sdk payload "chain")
ideal state is the conversion logic of messages + options is collapsed into something like getRequestPayload and that's what we test (this is how python does it iirc). Not needed for this PR though.
ok I'll get off my soap box now
…reuse-for-code-execution
|
I have a forthcoming PR that will add integration tests for this PR as well as #9108, because the end-to-end won't work without both changes and another forthcoming change. Which argues that maybe I went a bit too fine-grained with my PRs here 😅. Hopefully made them nice and easy to review tho Are we ok to merge this one without the integration test and I'll fast follow with the integration test? |
Anthropic has a bug where if we pass them back one of their bash_code_execution_output blocks which contains a file output, they return a 500. I have reported the error to them, but in the meantime this works around the problem by dropping the problematic content blocks before we send them to anthropic Also adds an integration test that exercises this PR as well as: - langchain-ai#9108 - langchain-ai#9109
…reuse-for-code-execution
christian-bromann
left a comment
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.
LGTM 👍
Anthropic has a bug where if we pass them back one of their bash_code_execution_output blocks which contains a file output, they return a 500. I have reported the error to them, but in the meantime this works around the problem by dropping the problematic content blocks before we send them to anthropic Also adds an integration test that exercises this PR as well as: - langchain-ai#9108 - langchain-ai#9109
Adds
containerparameter toChatAnthropicCallOptionsand passes it through to Anthropic client.See https://docs.claude.com/en/docs/agents-and-tools/tool-use/code-execution-tool#container-reuse