( span: Span, request: typeof Generated.ChatRequest.Encoded )
| 1642 | // ============================================================================= |
| 1643 | |
| 1644 | const annotateRequest = ( |
| 1645 | span: Span, |
| 1646 | request: typeof Generated.ChatRequest.Encoded |
| 1647 | ): void => { |
| 1648 | addGenAIAnnotations(span, { |
| 1649 | system: "openrouter", |
| 1650 | operation: { name: "chat" }, |
| 1651 | request: { |
| 1652 | model: request.model, |
| 1653 | temperature: request.temperature, |
| 1654 | topP: request.top_p, |
| 1655 | maxTokens: request.max_tokens, |
| 1656 | stopSequences: Arr.ensure(request.stop).filter( |
| 1657 | Predicate.isNotNullish |
| 1658 | ) |
| 1659 | } |
| 1660 | }) |
| 1661 | } |
| 1662 | |
| 1663 | const annotateResponse = (span: Span, response: Generated.SendChatCompletionRequest200): void => { |
| 1664 | addGenAIAnnotations(span, { |
no test coverage detected