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)
| 55 | // It reads whichever of 'streaming/tool-call' and 'non-streaming/tool-call' |
| 56 | // sections exist. |
| 57 | func 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. |
| 69 | type receivedRequest struct { |