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

Function newFixtureToolResponse

internal/integrationtest/mockupstream.go:56–65  ·  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

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

Callers 4

setupInjectedToolTestFunction · 0.85

Calls 3

HasMethod · 0.80
StreamingToolCallMethod · 0.80
NonStreamingToolCallMethod · 0.80

Tested by 3