( requestBody: string | undefined, workDir: string, toolResultNormalizers: ToolResultNormalizer[], )
| 733 | } |
| 734 | |
| 735 | async function parseAndNormalizeRequest( |
| 736 | requestBody: string | undefined, |
| 737 | workDir: string, |
| 738 | toolResultNormalizers: ToolResultNormalizer[], |
| 739 | ) { |
| 740 | const fakeRequest = { |
| 741 | request: { url: chatCompletionEndpoint, body: requestBody }, |
| 742 | } as CapturedExchange; |
| 743 | return await transformHttpExchanges( |
| 744 | [fakeRequest], |
| 745 | workDir, |
| 746 | toolResultNormalizers, |
| 747 | ); |
| 748 | } |
| 749 | |
| 750 | // Takes raw HTTP traffic and turns it into the normalized form that we store on disk |
| 751 | async function transformHttpExchanges( |
no test coverage detected
searching dependent graphs…