MCPcopy Create free account
hub / github.com/coder/coder / newFixtureToolResponse

Function newFixtureToolResponse

aibridge/internal/integrationtest/mockupstream.go:57–66  ·  view source on GitHub ↗

newFixtureToolResponse creates an upstreamResponse from the tool-call fixture files. It reads whichever of 'streaming/tool-call' and 'non-streaming/tool-call' sections exist.

(fix fixtures.Fixture)

Source from the content-addressed store, hash-verified

55// It reads whichever of 'streaming/tool-call' and 'non-streaming/tool-call'
56// sections exist.
57func newFixtureToolResponse(fix fixtures.Fixture) upstreamResponse {
58 var resp upstreamResponse
59 if fix.Has(fixtures.SectionStreamingToolCall) {
60 resp.Streaming = fix.StreamingToolCall()
61 }
62 if fix.Has(fixtures.SectionNonStreamToolCall) {
63 resp.Blocking = fix.NonStreamingToolCall()
64 }
65 return resp
66}
67
68// receivedRequest captures the details of a single request handled by mockUpstream.
69type receivedRequest struct {

Callers 4

setupInjectedToolTestFunction · 0.85

Calls 3

StreamingToolCallMethod · 0.80
NonStreamingToolCallMethod · 0.80
HasMethod · 0.45

Tested by 3