Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/docker/model-test
/ functions
Functions
68 in github.com/docker/model-test
⨍
Functions
68
◇
Types & classes
42
↓ 4 callers
Method
getOrCreateCart
getOrCreateCart gets an existing cart or creates a new one for the session
services/cart_service.go:115
↓ 3 callers
Method
getModelName
getModelName returns the model name to use for test results
services/test_runner.go:253
↓ 3 callers
Method
updateCartTotals
updateCartTotals recalculates the cart totals
services/cart_service.go:131
↓ 2 callers
Method
GetCartSummary
GetCartSummary returns the current cart summary for the given session
services/cart_service.go:82
↓ 2 callers
Function
NewTestRunnerWithLogger
NewTestRunnerWithLogger creates a new test runner instance with logging
services/test_runner.go:30
↓ 2 callers
Function
analyzeBatches
analyzeBatches analyzes all result files across multiple batch directories
cmd/analyze-batch/main.go:111
↓ 2 callers
Function
analyzeModelWithSource
analyzeModelWithSource analyzes all result files for a single model with batch source info
cmd/analyze-batch/main.go:267
↓ 2 callers
Function
calculateMetrics
calculateMetrics calculates precision, recall, and F1 from confusion matrix values
cmd/analyze-batch/main.go:456
↓ 2 callers
Method
getProductPrice
getProductPrice returns a mock price for a product
services/cart_service.go:191
↓ 2 callers
Method
writeLogEntry
writeLogEntry writes a log entry to the file
services/request_logger.go:100
↓ 1 callers
Method
AddToCart
AddToCart adds a product to the cart for the given session
services/cart_service.go:24
↓ 1 callers
Method
CheckoutCart
CheckoutCart processes checkout for the given session and clears the cart
services/cart_service.go:91
↓ 1 callers
Method
Close
Close closes the log file
services/request_logger.go:120
↓ 1 callers
Method
ExecuteToolCalls
ExecuteToolCalls executes the tool calls from OpenAI
services/tool_executor.go:27
↓ 1 callers
Method
GetToolDefinitions
GetToolDefinitions returns the tool definitions for OpenAI function calling
tools/shopping_tools.go:22
↓ 1 callers
Method
InitializeCartForTest
InitializeCartForTest initializes the cart with predefined state for testing
services/openai_service.go:229
↓ 1 callers
Method
InitializeCartState
InitializeCartState sets up the cart with predefined items for testing
services/cart_service.go:146
↓ 1 callers
Method
LogError
LogError logs a failed request
services/request_logger.go:79
↓ 1 callers
Method
LogRequest
LogRequest logs a successful request/response pair
services/request_logger.go:59
↓ 1 callers
Function
NewCartService
NewCartService creates a new cart service
services/cart_service.go:17
↓ 1 callers
Function
NewOpenAIServiceWithLogger
NewOpenAIServiceWithLogger creates a new OpenAI service instance with logging
services/openai_service.go:31
↓ 1 callers
Function
NewProductService
NewProductService creates a new product service with mock data
services/product_service.go:14
↓ 1 callers
Function
NewRequestLogger
NewRequestLogger creates a new request logger with the specified log file
services/request_logger.go:41
↓ 1 callers
Function
NewShoppingTools
NewShoppingTools creates a new instance of shopping tools
tools/shopping_tools.go:15
↓ 1 callers
Function
NewToolExecutor
NewToolExecutor creates a new tool executor
services/tool_executor.go:19
↓ 1 callers
Method
ProcessChatMessage
ProcessChatMessage processes a chat message with test case context for logging
services/openai_service.go:61
↓ 1 callers
Method
RemoveFromCart
RemoveFromCart removes a product from the cart for the given session
services/cart_service.go:63
↓ 1 callers
Method
RunAgentTestSuite
RunAgentTestSuite executes a test suite using the agent loop approach
services/test_runner.go:40
↓ 1 callers
Method
SaveResults
SaveResults saves test results to a JSON file
services/test_runner.go:261
↓ 1 callers
Method
SearchProducts
SearchProducts searches for products based on the provided filter
services/product_service.go:21
↓ 1 callers
Method
buildMessagesFromSession
buildMessagesFromSession converts chat session messages to OpenAI format
services/openai_service.go:181
↓ 1 callers
Function
calculateAverageResponseTime
calculateAverageResponseTime calculates the average response time in seconds
cmd/analyze-batch/main.go:440
↓ 1 callers
Function
calculateToolInvocationMetrics
calculateToolInvocationMetrics calculates binary tool invocation metrics
cmd/analyze-batch/main.go:318
↓ 1 callers
Function
calculateToolSelectionMetrics
calculateToolSelectionMetrics calculates specific tool selection metrics
cmd/analyze-batch/main.go:347
↓ 1 callers
Method
evaluateAgentResponse
evaluateAgentResponse checks if the agent response matches expected tool calls
services/test_runner.go:175
↓ 1 callers
Method
executeToolCall
executeToolCall executes a single tool call
services/tool_executor.go:39
↓ 1 callers
Function
findResultFiles
findResultFiles finds all agent test result files in the directory
cmd/analyze-batch/main.go:162
↓ 1 callers
Method
generateSessionID
generateSessionID generates a random session ID
services/openai_service.go:234
↓ 1 callers
Function
generateSummary
generateSummary generates a summary of the analysis
cmd/analyze-batch/main.go:539
↓ 1 callers
Function
generateTextReport
generateTextReport generates a human-readable text report
cmd/analyze-batch/main.go:483
↓ 1 callers
Function
getActualTools
getActualTools gets all actual tool names called
cmd/analyze-batch/main.go:402
↓ 1 callers
Function
getExpectedTools
getExpectedTools gets all expected tools from all variants
cmd/analyze-batch/main.go:391
↓ 1 callers
Function
getMockProducts
getMockProducts returns a list of mock products for testing
services/product_service.go:59
↓ 1 callers
Method
getSystemPrompt
getSystemPrompt returns the system prompt for the shopping assistant
services/openai_service.go:208
↓ 1 callers
Method
getToolDefinitions
getToolDefinitions returns the tool definitions for OpenAI function calling
services/openai_service.go:224
↓ 1 callers
Function
groupFilesByModelWithSource
groupFilesByModelWithSource groups result files by model name and determines batch source
cmd/analyze-batch/main.go:211
↓ 1 callers
Method
handleAddToCart
handleAddToCart handles add to cart tool calls
services/tool_executor.go:115
↓ 1 callers
Method
handleCheckout
handleCheckout handles checkout tool calls
services/tool_executor.go:204
↓ 1 callers
Method
handleRemoveFromCart
handleRemoveFromCart handles remove from cart tool calls
services/tool_executor.go:156
↓ 1 callers
Method
handleSearchProducts
handleSearchProducts handles product search tool calls
services/tool_executor.go:67
↓ 1 callers
Method
handleViewCart
handleViewCart handles view cart tool calls
services/tool_executor.go:192
↓ 1 callers
Method
isPathSuccessful
isPathSuccessful checks if actual tool calls match a specific expected path
services/test_runner.go:214
↓ 1 callers
Method
isToolCallCorrect
isToolCallCorrect checks if an actual tool call matches an expected one
services/test_runner.go:231
↓ 1 callers
Function
loadResultFile
loadResultFile loads test results from a JSON file
cmd/analyze-batch/main.go:303
↓ 1 callers
Function
loadTestCases
loadTestCases loads test cases from a JSON file, optionally filtering by test case name
main.go:102
↓ 1 callers
Function
matchesAnyVariant
matchesAnyVariant checks if actual tools match any expected variant
cmd/analyze-batch/main.go:415
↓ 1 callers
Function
matchesVariant
matchesVariant checks if actual tools match a specific variant
cmd/analyze-batch/main.go:425
↓ 1 callers
Method
parseArguments
parseArguments parses the arguments string into a map
services/test_runner.go:201
↓ 1 callers
Function
printAgentSummary
printAgentSummary prints a summary of the agent test results
main.go:136
↓ 1 callers
Method
runAgentTest
runAgentTest executes a single test case using the agent loop
services/test_runner.go:116
↓ 1 callers
Function
sanitizeModelName
sanitizeModelName sanitizes the model name for use in filenames
main.go:220
↓ 1 callers
Function
shouldCallAnyTool
shouldCallAnyTool determines if any tool should be called for a test case
cmd/analyze-batch/main.go:381
Function
NewTestRunner
NewTestRunner creates a new test runner instance
services/test_runner.go:25
Function
analyzeBatch
analyzeBatch analyzes all result files in a batch directory
cmd/analyze-batch/main.go:157
Function
analyzeModel
analyzeModel analyzes all result files for a single model
cmd/analyze-batch/main.go:262
Function
groupFilesByModel
groupFilesByModel groups result files by model name
cmd/analyze-batch/main.go:180
Function
main
()
main.go:17
Function
main
()
cmd/analyze-batch/main.go:50