MCPcopy Create free account
hub / github.com/Effect-TS/effect / annotateRequest

Function annotateRequest

packages/ai/openrouter/src/OpenRouterLanguageModel.ts:1644–1661  ·  view source on GitHub ↗
(
  span: Span,
  request: typeof Generated.ChatRequest.Encoded
)

Source from the content-addressed store, hash-verified

1642// =============================================================================
1643
1644const 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
1663const annotateResponse = (span: Span, response: Generated.SendChatCompletionRequest200): void => {
1664 addGenAIAnnotations(span, {

Callers 1

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected