@@ -21,6 +21,11 @@ import (
2121
2222const PromptsPath = "/v1/traceloop/prompts"
2323
24+ const (
25+ ToolType = "tool"
26+ AgentType = "agent"
27+ )
28+
2429type Traceloop struct {
2530 config Config
2631 promptRegistry model.PromptRegistry
@@ -184,17 +189,14 @@ func (llmSpan *LLMSpan) LogCompletion(ctx context.Context, completion Completion
184189 return nil
185190}
186191
187- // LogToolCall logs a tool call with the specified name and prompt
188- func (instance * Traceloop ) LogToolCall (ctx context.Context , attrs ToolCallAttributes , prompt Prompt , workflowAttrs WorkflowAttributes ) (LLMSpan , error ) {
192+ // LogToolCall logs a tool call with the specified name
193+ func (instance * Traceloop ) LogToolCall (ctx context.Context , attrs ToolCallAttributes , workflowAttrs WorkflowAttributes ) (LLMSpan , error ) {
189194 spanName := fmt .Sprintf ("%s.tool" , attrs .Name )
190195 _ , span := instance .getTracer ().Start (ctx , spanName )
191196
192197 spanAttrs := []attribute.KeyValue {
193- semconvai .LLMVendor .String (prompt .Vendor ),
194- semconvai .LLMRequestModel .String (prompt .Model ),
195- semconvai .LLMRequestType .String (prompt .Mode ),
196198 semconvai .TraceloopWorkflowName .String (workflowAttrs .Name ),
197- semconvai .TraceloopSpanKind .String ("tool" ),
199+ semconvai .TraceloopSpanKind .String (ToolType ),
198200 semconvai .TraceloopEntityName .String (attrs .Name ),
199201 }
200202
@@ -204,25 +206,20 @@ func (instance *Traceloop) LogToolCall(ctx context.Context, attrs ToolCallAttrib
204206 }
205207
206208 span .SetAttributes (spanAttrs ... )
207- setMessagesAttribute (span , "llm.prompts" , prompt .Messages )
208- setToolsAttribute (span , prompt .Tools )
209209
210210 return LLMSpan {
211211 span : span ,
212212 }, nil
213213}
214214
215- // LogAgent logs an agent with the specified name and prompt
216- func (instance * Traceloop ) LogAgent (ctx context.Context , attrs AgentAttributes , prompt Prompt , workflowAttrs WorkflowAttributes ) (LLMSpan , error ) {
215+ // LogAgent logs an agent with the specified name
216+ func (instance * Traceloop ) LogAgent (ctx context.Context , attrs AgentAttributes , workflowAttrs WorkflowAttributes ) (LLMSpan , error ) {
217217 spanName := fmt .Sprintf ("%s.agent" , attrs .Name )
218218 _ , span := instance .getTracer ().Start (ctx , spanName )
219219
220220 spanAttrs := []attribute.KeyValue {
221- semconvai .LLMVendor .String (prompt .Vendor ),
222- semconvai .LLMRequestModel .String (prompt .Model ),
223- semconvai .LLMRequestType .String (prompt .Mode ),
224221 semconvai .TraceloopWorkflowName .String (workflowAttrs .Name ),
225- semconvai .TraceloopSpanKind .String ("agent" ),
222+ semconvai .TraceloopSpanKind .String (AgentType ),
226223 semconvai .LLMAgentName .String (attrs .Name ),
227224 }
228225
@@ -232,8 +229,6 @@ func (instance *Traceloop) LogAgent(ctx context.Context, attrs AgentAttributes,
232229 }
233230
234231 span .SetAttributes (spanAttrs ... )
235- setMessagesAttribute (span , "llm.prompts" , prompt .Messages )
236- setToolsAttribute (span , prompt .Tools )
237232
238233 return LLMSpan {
239234 span : span ,
0 commit comments