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)
| 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). |
| 43 | func 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' |