isToolCallCorrect checks if an actual tool call matches an expected one
(expected models.ExpectedToolCall, actual models.ActualToolCall)
| 229 | |
| 230 | // isToolCallCorrect checks if an actual tool call matches an expected one |
| 231 | func (tr *TestRunner) isToolCallCorrect(expected models.ExpectedToolCall, actual models.ActualToolCall) bool { |
| 232 | if expected.Name != actual.Name { |
| 233 | return false |
| 234 | } |
| 235 | |
| 236 | // Check if all expected arguments are present and correct |
| 237 | for key, expectedValue := range expected.Arguments { |
| 238 | actualValue, exists := actual.Arguments[key] |
| 239 | if !exists { |
| 240 | return false |
| 241 | } |
| 242 | |
| 243 | // Simple equality check using case-insensitive comparison |
| 244 | if !strings.EqualFold(fmt.Sprintf("%v", expectedValue), fmt.Sprintf("%v", actualValue)) { |
| 245 | return false |
| 246 | } |
| 247 | } |
| 248 | |
| 249 | return true |
| 250 | } |
| 251 | |
| 252 | // getModelName returns the model name to use for test results |
| 253 | func (tr *TestRunner) getModelName() string { |