MCPcopy Index your code
hub / github.com/simstudioai/sim / setAgentInputMessages

Function setAgentInputMessages

apps/sim/lib/copilot/request/otel.ts:163–182  ·  view source on GitHub ↗
(span: Span, input: CopilotAgentInputMessages)

Source from the content-addressed store, hash-verified

161}
162
163function 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
184function setAgentOutputMessages(span: Span, output: CopilotAgentOutputMessages): void {
185 if (!isGenAIMessageCaptureEnabled()) return

Callers 1

startCopilotOtelRootFunction · 0.85

Calls 3

marshalAgentMessagesFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected