@@ -53,7 +53,6 @@ func ingredientValidatorTool(ctx context.Context, agent *sdk.Agent, client *open
5353
5454 llmSpan := tool .LogPrompt (prompt )
5555
56- // Make API call
5756 resp , err := client .CreateChatCompletion (ctx , openai.ChatCompletionRequest {
5857 Model : "gpt-3.5-turbo" ,
5958 Messages : []openai.ChatCompletionMessage {
@@ -67,7 +66,6 @@ func ingredientValidatorTool(ctx context.Context, agent *sdk.Agent, client *open
6766 return "" , fmt .Errorf ("CreateChatCompletion error: %w" , err )
6867 }
6968
70- // Log completion
7169 var completionMsgs []sdk.Message
7270 for _ , choice := range resp .Choices {
7371 completionMsgs = append (completionMsgs , sdk.Message {
@@ -121,7 +119,6 @@ func nutritionCalculatorTool(ctx context.Context, agent *sdk.Agent, client *open
121119
122120 llmSpan := tool .LogPrompt (prompt )
123121
124- // Make API call
125122 resp , err := client .CreateChatCompletion (ctx , openai.ChatCompletionRequest {
126123 Model : "gpt-3.5-turbo" ,
127124 Messages : []openai.ChatCompletionMessage {
@@ -135,7 +132,6 @@ func nutritionCalculatorTool(ctx context.Context, agent *sdk.Agent, client *open
135132 return "" , fmt .Errorf ("CreateChatCompletion error: %w" , err )
136133 }
137134
138- // Log completion
139135 var completionMsgs []sdk.Message
140136 for _ , choice := range resp .Choices {
141137 completionMsgs = append (completionMsgs , sdk.Message {
@@ -191,7 +187,6 @@ func cookingTimeEstimatorTool(ctx context.Context, agent *sdk.Agent, client *ope
191187
192188 llmSpan := tool .LogPrompt (prompt )
193189
194- // Make API call
195190 resp , err := client .CreateChatCompletion (ctx , openai.ChatCompletionRequest {
196191 Model : "gpt-3.5-turbo" ,
197192 Messages : []openai.ChatCompletionMessage {
@@ -205,7 +200,6 @@ func cookingTimeEstimatorTool(ctx context.Context, agent *sdk.Agent, client *ope
205200 return "" , fmt .Errorf ("CreateChatCompletion error: %w" , err )
206201 }
207202
208- // Log completion
209203 var completionMsgs []sdk.Message
210204 for _ , choice := range resp .Choices {
211205 completionMsgs = append (completionMsgs , sdk.Message {
@@ -246,10 +240,10 @@ func runRecipeAgent() {
246240 agent := traceloop .NewAgent (ctx , "recipe_generator" , sdk.AgentAttributes {
247241 Name : "recipe_generator" ,
248242 AssociationProperties : associationProperties ,
249- }, abTest )
243+ ABTest : abTest ,
244+ })
250245 defer agent .End ()
251246
252- // User request
253247 userRequest := "Create a healthy pasta dish with vegetables"
254248 fmt .Printf ("User request: %s\n \n " , userRequest )
255249
@@ -284,7 +278,6 @@ func runRecipeAgent() {
284278 return
285279 }
286280
287- // Log completion
288281 var completionMsgs []sdk.Message
289282 for _ , choice := range resp .Choices {
290283 completionMsgs = append (completionMsgs , sdk.Message {
0 commit comments