(
llm: unknown,
prompts: string[],
runId: string,
_parentRunId?: string,
_extraParams?: Record<string, unknown>,
tags?: string[],
metadata?: Record<string, unknown>,
_runName?: string,
)
| 80 | awaitHandlers: true, |
| 81 | |
| 82 | handleLLMStart( |
| 83 | llm: unknown, |
| 84 | prompts: string[], |
| 85 | runId: string, |
| 86 | _parentRunId?: string, |
| 87 | _extraParams?: Record<string, unknown>, |
| 88 | tags?: string[], |
| 89 | metadata?: Record<string, unknown>, |
| 90 | _runName?: string, |
| 91 | ) { |
| 92 | const invocationParams = getInvocationParams(tags); |
| 93 | const attributes = extractLLMRequestAttributes( |
| 94 | llm as LangChainSerialized, |
| 95 | prompts, |
| 96 | recordInputs, |
| 97 | enableTruncation, |
| 98 | invocationParams, |
| 99 | metadata, |
| 100 | ); |
| 101 | const modelName = attributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE]; |
| 102 | const operationName = attributes[GEN_AI_OPERATION_NAME_ATTRIBUTE]; |
| 103 | |
| 104 | startSpanManual( |
| 105 | { |
| 106 | name: `${operationName} ${modelName}`, |
| 107 | op: 'gen_ai.chat', |
| 108 | attributes: { |
| 109 | ...getAgentNameFromMetadata(metadata), |
| 110 | ...attributes, |
| 111 | [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'gen_ai.chat', |
| 112 | }, |
| 113 | }, |
| 114 | span => { |
| 115 | spanMap.set(runId, span); |
| 116 | return span; |
| 117 | }, |
| 118 | ); |
| 119 | }, |
| 120 | |
| 121 | // Chat Model Start Handler |
| 122 | handleChatModelStart( |
nothing calls this directly
no test coverage detected