mirror of
https://github.com/lukaszraczylo/llm-testbench.git
synced 2026-10-15 01:07:26 +00:00
feat: function-calling (MCP-style) tests plus ultra-hard tasks
Adds real OpenAI function-calling support end to end and two test tranches. Client (internal/llm): Request.Tools advertises tools with tool_choice auto; Response.ToolCalls carries the model's calls, decoding each function's JSON-encoded argument string into an object (malformed arguments preserved raw with Decoded=false). Verified live: the gateway round-trips tools and the qwen/deepseek tool-call parsers emit the expected format. Runner: when a test declares Tools, it serializes the model's tool calls into a canonical JSON envelope and scores that, not the free text. Eval (toolcall.go): ToolCalled, NoToolCalled, ToolCallWithArgs (subset match, number/string coercion), ToolSequence, FirstToolIs, ToolNotCalled, ToolArgValuesCover - all parse the envelope, no llm dependency. Tests: 12 function-calling tests (tools/function-calling) covering tool selection, argument extraction, enum constraints, chained and parallel calls, no-tool-needed and missing-param abstention, destructive-tool safety, and name-vs-description traps; 8 ultra-hard single-shot tasks in existing subcategories. Ground-truth self-consistency tests assert every documented answer and ideal tool envelope scores 1.0.
This commit is contained in:
@@ -27,6 +27,14 @@ func TestAdvancedGroundTruthScoresFull(t *testing.T) {
|
||||
"adv-code-conflicting-evidence": `{"port": 9090, "authoritative": "config"}`,
|
||||
"adv-sec-exploit-chain": `{"vuln": "open-redirect"}`,
|
||||
"adv-sec-rotation-blast-radius": `30`,
|
||||
"ultra-c-int8-signed": `-76`,
|
||||
"ultra-hard-modexp": `5`,
|
||||
"ultra-hard-fp-equality": `{"equal": false}`,
|
||||
"ultra-py-bankers-round": `6`,
|
||||
"ultra-sec-redos": `{"vulnerable": true}`,
|
||||
"ultra-scen-cap-partition": `{"sacrificed": "availability"}`,
|
||||
"ultra-ai-pq-bytes": `16`,
|
||||
"ultra-sql-deadlock-cycle": `{"fix": "consistent-lock-order"}`,
|
||||
}
|
||||
|
||||
byID := map[string]int{}
|
||||
|
||||
Reference in New Issue
Block a user