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

translator: add toolUse support in streaming #151

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wengyao04
Copy link
Contributor

In this PR, I convert toolUse in bedrock converse streaming response to openai chat completions tool_calls. ToolUseBlockDelta is added toConverseStreamEventContentBlockDelta as documented in ContentBlockDelta. ContentBlockStart is added as documented in ContentBlockStart

The role in ChatCompletionResponseChunkChoiceDelta is not nullable as documented in https://platform.openai.com/docs/api-reference/chat/streaming

Unit test is updated to cover streaming response with toolUse. The base64 encoded streaming test data if from calling bedrock anthropic Claude model with toolConfig.

@wengyao04 wengyao04 requested a review from a team as a code owner January 21, 2025 02:32
@wengyao04 wengyao04 changed the title Translator: add toolUse support in streaming translator: add toolUse support in streaming Jan 21, 2025
@mathetake mathetake removed their assignment Jan 21, 2025
@mathetake
Copy link
Member

looks good to me in general, so deferring to Dan for the rest

@mathetake
Copy link
Member

so i made it easy to add the end-to-end transformation testing with testupstream here:

for _, tc := range []struct {

feel free to add more cases to cover this PR (maybe some fix might be necessary for the test as well as testupstream)

@wengyao04
Copy link
Contributor Author

so i made it easy to add the end-to-end transformation testing with testupstream here:

for _, tc := range []struct {

feel free to add more cases to cover this PR (maybe some fix might be necessary for the test as well as testupstream)

Thank you, I will add more test cases to cover this PR and previous one for toolCalls

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.

4 participants