Skip to content

streaming tools protocol: native ToolCall format, ToolsStream, StreamingChunk.ToolCalls#30

Merged
JaimeStill merged 2 commits intomainfrom
23-streaming-tools-protocol
Feb 17, 2026
Merged

streaming tools protocol: native ToolCall format, ToolsStream, StreamingChunk.ToolCalls#30
JaimeStill merged 2 commits intomainfrom
23-streaming-tools-protocol

Conversation

@JaimeStill
Copy link
Copy Markdown
Contributor

Summary

  • Refactors ToolCall from flat canonical format with custom MarshalJSON/UnmarshalJSON to native LLM API format ({id, type, function: {name, arguments}}), aligning with OpenAI-compatible wire format
  • Adds ToolFunction named type and NewToolCall constructor
  • Extends StreamingChunk.Delta with ToolCalls field and ToolCalls() accessor
  • Adds ToolsStream to Agent interface, implementation, and mock
  • Embeds protocol.ToolCall in kernel's ToolCallRecord, eliminating field duplication
  • Adds NewStreamingToolsAgent mock helper

Closes #23

Test plan

  • All existing tests updated for native ToolCall format
  • New tests: TestNewToolCall, TestToolCall_Marshal_NativeFormat, TestToolCall_Marshal_RoundTrip
  • New tests: TestStreamingChunk_ToolCalls, TestStreamingChunk_ToolCalls_ContinuationChunk, TestParseToolsStreamChunk
  • New tests: TestMockAgent_ToolsStream, TestNewStreamingToolsAgent
  • go test ./... passes
  • go vet ./... passes

@JaimeStill JaimeStill merged commit de05a4e into main Feb 17, 2026
2 checks passed
@JaimeStill JaimeStill deleted the 23-streaming-tools-protocol branch February 17, 2026 13:01
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.

Streaming tools protocol

1 participant