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

Function annotateRequest

packages/ai/anthropic/src/AnthropicLanguageModel.ts:1333–1351  ·  view source on GitHub ↗
(
  span: Span,
  request: typeof Generated.BetaCreateMessageParams.Encoded
)

Source from the content-addressed store, hash-verified

1331// =============================================================================
1332
1333const annotateRequest = (
1334 span: Span,
1335 request: typeof Generated.BetaCreateMessageParams.Encoded
1336): void => {
1337 addGenAIAnnotations(span, {
1338 system: "anthropic",
1339 operation: { name: "chat" },
1340 request: {
1341 model: request.model,
1342 temperature: request.temperature,
1343 topK: request.top_k,
1344 topP: request.top_p,
1345 maxTokens: request.max_tokens,
1346 stopSequences: Arr.ensure(request.stop_sequences).filter(
1347 Predicate.isNotNullable
1348 )
1349 }
1350 })
1351}
1352
1353const annotateResponse = (span: Span, response: Generated.BetaMessage): void => {
1354 addGenAIAnnotations(span, {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected