( requestBody: string, responseBody: string | undefined, requestHeaders?: Record<string, string | string[] | undefined>, )
| 955 | } |
| 956 | |
| 957 | async function parseHttpExchange( |
| 958 | requestBody: string, |
| 959 | responseBody: string | undefined, |
| 960 | requestHeaders?: Record<string, string | string[] | undefined>, |
| 961 | ): Promise<ParsedHttpExchange> { |
| 962 | const request = JSON.parse(requestBody) as ChatCompletionCreateParamsBase; |
| 963 | const response = await parseOpenAIResponse(responseBody); |
| 964 | return { request, response, requestHeaders }; |
| 965 | } |
| 966 | |
| 967 | // Converts a single HTTP exchange (request + response) into a normalized conversation |
| 968 | async function transformHttpExchange( |
no test coverage detected
searching dependent graphs…