(span: Span, input: CopilotAgentInputMessages)
| 161 | } |
| 162 | |
| 163 | function setAgentInputMessages(span: Span, input: CopilotAgentInputMessages): void { |
| 164 | if (!isGenAIMessageCaptureEnabled()) return |
| 165 | const messages: GenAIAgentMessage[] = [] |
| 166 | if (input.systemPrompt) { |
| 167 | messages.push({ |
| 168 | role: 'system', |
| 169 | parts: [{ type: 'text', content: input.systemPrompt }], |
| 170 | }) |
| 171 | } |
| 172 | if (input.userMessage) { |
| 173 | messages.push({ |
| 174 | role: 'user', |
| 175 | parts: [{ type: 'text', content: input.userMessage }], |
| 176 | }) |
| 177 | } |
| 178 | const serialized = marshalAgentMessages(messages) |
| 179 | if (serialized) { |
| 180 | span.setAttribute(TraceAttr.GenAiInputMessages, serialized) |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | function setAgentOutputMessages(span: Span, output: CopilotAgentOutputMessages): void { |
| 185 | if (!isGenAIMessageCaptureEnabled()) return |
no test coverage detected