Skip to content

Conversation

steebchen
Copy link
Member

Summary

  • Adds support for streaming function call deltas with generic handling of various naming conventions
  • Enhances transformStreamingToOpenai to transform function call delta events into OpenAI chat completion chunk format

Changes

Core Functionality

  • Added new case handling for function call delta events including:
    • response.function_call.delta
    • response.function_call_arguments.delta
    • response.function_call_arguments.appended
  • Extracts function call name, call ID, and arguments text from multiple possible fields to support varied data structures
  • Constructs transformed data with assistant role and tool call details formatted for OpenAI streaming response compatibility

Test plan

  • Verify streaming responses with function call deltas are correctly transformed and emitted
  • Test with different function call delta event types and data shapes to ensure robust handling
  • Confirm no regressions in existing streaming transformations for other event types

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/d938aaf5-6337-4608-91e4-118952ddee51

- Handle multiple function-call delta event types with flexible naming
- Transform these events into OpenAI chat completion chunk format
- Include function call id, name, and arguments in transformed data
- Provide fallback for call id generation and argument extraction

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
Copy link
Contributor

coderabbitai bot commented Sep 16, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch terragon/add-function-call-streaming-support

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot changed the title Add support for generic function call streaming in transformStreamingToOpenai feat(transform): add generic streaming support Sep 16, 2025
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.

1 participant