(
res: Response,
id: string,
created: number,
model: string,
text: string,
)
| 550 | } |
| 551 | |
| 552 | function writeOpenAITextDelta( |
| 553 | res: Response, |
| 554 | id: string, |
| 555 | created: number, |
| 556 | model: string, |
| 557 | text: string, |
| 558 | ): void { |
| 559 | if (!text) return; |
| 560 | writeOpenAISSE(res, { |
| 561 | id, |
| 562 | object: 'chat.completion.chunk', |
| 563 | created, |
| 564 | model, |
| 565 | choices: [{ |
| 566 | index: 0, |
| 567 | delta: { content: text }, |
| 568 | finish_reason: null, |
| 569 | }], |
| 570 | }); |
| 571 | } |
| 572 | |
| 573 | function buildOpenAIUsage( |
| 574 | anthropicReq: AnthropicRequest, |
no test coverage detected