MCPcopy Index your code
hub / github.com/coder/coder / newFixtureResponse

Function newFixtureResponse

aibridge/internal/integrationtest/mockupstream.go:43–52  ·  view source on GitHub ↗

newFixtureResponse creates an upstreamResponse from a parsed fixture archive. It reads whichever of 'streaming' and 'non-streaming' sections exist; not every fixture has both (e.g. error fixtures may only define one).

(fix fixtures.Fixture)

Source from the content-addressed store, hash-verified

41// It reads whichever of 'streaming' and 'non-streaming' sections exist;
42// not every fixture has both (e.g. error fixtures may only define one).
43func newFixtureResponse(fix fixtures.Fixture) upstreamResponse {
44 var resp upstreamResponse
45 if fix.Has(fixtures.SectionStreaming) {
46 resp.Streaming = fix.Streaming()
47 }
48 if fix.Has(fixtures.SectionNonStreaming) {
49 resp.Blocking = fix.NonStreaming()
50 }
51 return resp
52}
53
54// newFixtureToolResponse creates an upstreamResponse from the tool-call fixture files.
55// It reads whichever of 'streaming/tool-call' and 'non-streaming/tool-call'

Calls 3

NonStreamingMethod · 0.80
StreamingMethod · 0.65
HasMethod · 0.45