Skip to content

Commit 1786aad

Browse files
committed
docs: add rich fixture gallery with examples for all mock types
1 parent ab147c9 commit 1786aad

11 files changed

Lines changed: 334 additions & 0 deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"a2a": {
3+
"agents": [
4+
{
5+
"name": "research-agent",
6+
"description": "An agent that researches topics and returns summaries",
7+
"version": "1.0.0",
8+
"skills": [
9+
{
10+
"id": "web-research",
11+
"name": "Web Research",
12+
"description": "Search the web and summarize findings",
13+
"tags": ["research", "search"]
14+
}
15+
],
16+
"capabilities": { "streaming": true },
17+
"messages": [
18+
{
19+
"pattern": "research",
20+
"parts": [{ "text": "Here is a summary of my research findings on the topic." }]
21+
}
22+
],
23+
"streamingTasks": [
24+
{
25+
"pattern": "deep-research",
26+
"events": [
27+
{ "type": "status", "state": "TASK_STATE_WORKING" },
28+
{
29+
"type": "artifact",
30+
"name": "research-report",
31+
"parts": [{ "text": "## Research Report\n\nFindings from deep research..." }],
32+
"lastChunk": true
33+
},
34+
{ "type": "status", "state": "TASK_STATE_COMPLETED" }
35+
],
36+
"delayMs": 100
37+
}
38+
]
39+
}
40+
]
41+
}
42+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"agui": {
3+
"fixtures": [
4+
{
5+
"match": { "message": "hello" },
6+
"text": "Hi! How can I help you today?"
7+
},
8+
{
9+
"match": { "message": "search" },
10+
"events": [
11+
{ "type": "RUN_STARTED", "threadId": "t1", "runId": "r1" },
12+
{ "type": "TOOL_CALL_START", "toolCallId": "tc1", "toolCallName": "web_search" },
13+
{
14+
"type": "TOOL_CALL_ARGS",
15+
"toolCallId": "tc1",
16+
"delta": "{\"query\": \"latest news\"}"
17+
},
18+
{ "type": "TOOL_CALL_END", "toolCallId": "tc1" },
19+
{
20+
"type": "TEXT_MESSAGE_START",
21+
"messageId": "m1",
22+
"role": "assistant"
23+
},
24+
{
25+
"type": "TEXT_MESSAGE_CONTENT",
26+
"messageId": "m1",
27+
"delta": "Here are the latest results..."
28+
},
29+
{ "type": "TEXT_MESSAGE_END", "messageId": "m1" },
30+
{ "type": "RUN_FINISHED", "threadId": "t1", "runId": "r1" }
31+
]
32+
}
33+
]
34+
}
35+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"llm": {
3+
"fixtures": "fixtures/example-greeting.json",
4+
"chaos": {
5+
"dropRate": 0.1,
6+
"malformedRate": 0.05,
7+
"disconnectRate": 0.02
8+
}
9+
}
10+
}

fixtures/examples/full-suite.json

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"port": 4000,
3+
"host": "127.0.0.1",
4+
"metrics": true,
5+
"strict": true,
6+
7+
"llm": {
8+
"fixtures": "fixtures/example-greeting.json",
9+
"chaos": {
10+
"dropRate": 0.01,
11+
"malformedRate": 0.005,
12+
"disconnectRate": 0.002
13+
}
14+
},
15+
16+
"mcp": {
17+
"serverInfo": { "name": "full-suite-mcp", "version": "1.0.0" },
18+
"tools": [
19+
{
20+
"name": "search",
21+
"description": "Search the knowledge base",
22+
"inputSchema": {
23+
"type": "object",
24+
"properties": {
25+
"query": { "type": "string" },
26+
"limit": { "type": "number" }
27+
},
28+
"required": ["query"]
29+
},
30+
"result": "Found 3 results for your query."
31+
}
32+
],
33+
"resources": [
34+
{
35+
"uri": "file:///config",
36+
"name": "Configuration",
37+
"mimeType": "application/json",
38+
"text": "{\"version\": \"1.0\", \"environment\": \"test\"}"
39+
}
40+
],
41+
"prompts": [
42+
{
43+
"name": "summarize",
44+
"description": "Summarize a document",
45+
"arguments": [{ "name": "text", "description": "The text to summarize", "required": true }],
46+
"result": {
47+
"messages": [
48+
{
49+
"role": "assistant",
50+
"content": { "type": "text", "text": "Here is a summary of the provided text." }
51+
}
52+
]
53+
}
54+
}
55+
]
56+
},
57+
58+
"a2a": {
59+
"agents": [
60+
{
61+
"name": "assistant",
62+
"description": "A general-purpose assistant agent",
63+
"version": "1.0.0",
64+
"skills": [{ "id": "qa", "name": "Q&A", "description": "Answer questions" }],
65+
"capabilities": { "streaming": true },
66+
"messages": [
67+
{
68+
"pattern": ".*",
69+
"parts": [{ "text": "I can help you with that." }]
70+
}
71+
]
72+
}
73+
]
74+
},
75+
76+
"agui": {
77+
"fixtures": [
78+
{
79+
"match": { "message": "hello" },
80+
"text": "Hello from the full-suite mock!"
81+
},
82+
{
83+
"match": { "toolName": "get_data" },
84+
"events": [
85+
{ "type": "RUN_STARTED", "threadId": "t1", "runId": "r1" },
86+
{ "type": "TOOL_CALL_START", "toolCallId": "tc1", "toolCallName": "get_data" },
87+
{ "type": "TOOL_CALL_ARGS", "toolCallId": "tc1", "delta": "{}" },
88+
{ "type": "TOOL_CALL_END", "toolCallId": "tc1" },
89+
{ "type": "RUN_FINISHED", "threadId": "t1", "runId": "r1" }
90+
]
91+
}
92+
]
93+
},
94+
95+
"vector": {
96+
"collections": [
97+
{
98+
"name": "knowledge-base",
99+
"dimension": 384,
100+
"queryResults": [
101+
{
102+
"id": "kb-001",
103+
"score": 0.97,
104+
"metadata": { "source": "docs", "title": "Quick Start Guide" }
105+
}
106+
]
107+
}
108+
]
109+
},
110+
111+
"services": {
112+
"search": true,
113+
"rerank": true,
114+
"moderate": true
115+
}
116+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"fixtures": [
3+
{
4+
"match": { "inputText": "hello world" },
5+
"response": {
6+
"embedding": [0.0023064255, -0.009327292, 0.015797347]
7+
}
8+
}
9+
]
10+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"fixtures": [
3+
{
4+
"match": { "userMessage": ".*" },
5+
"response": {
6+
"error": {
7+
"message": "Rate limit exceeded. Please retry after 30 seconds.",
8+
"type": "rate_limit_error",
9+
"code": "rate_limit_exceeded"
10+
},
11+
"status": 429
12+
}
13+
}
14+
]
15+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"fixtures": [
3+
{
4+
"match": { "userMessage": "tell me a joke", "sequenceIndex": 0 },
5+
"response": {
6+
"content": "Why did the programmer quit his job? Because he didn't get arrays!"
7+
}
8+
},
9+
{
10+
"match": { "userMessage": "tell me a joke", "sequenceIndex": 1 },
11+
"response": { "content": "Why do Java developers wear glasses? Because they can't C#!" }
12+
},
13+
{
14+
"match": { "userMessage": "tell me a joke", "sequenceIndex": 2 },
15+
"response": {
16+
"content": "A SQL query walks into a bar, sees two tables, and asks: 'Can I join you?'"
17+
}
18+
}
19+
]
20+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"fixtures": [
3+
{
4+
"match": { "userMessage": "explain gravity" },
5+
"response": {
6+
"content": "Gravity is a fundamental force of nature that attracts objects with mass toward one another. It keeps planets in orbit around the sun and holds galaxies together."
7+
},
8+
"streamingProfile": {
9+
"ttft": 200,
10+
"tps": 40,
11+
"jitter": 0.1
12+
}
13+
}
14+
]
15+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"mcp": {
3+
"tools": [
4+
{
5+
"name": "search",
6+
"description": "Search the web",
7+
"inputSchema": {
8+
"type": "object",
9+
"properties": {
10+
"query": { "type": "string" }
11+
},
12+
"required": ["query"]
13+
},
14+
"result": "No results found for the given query."
15+
}
16+
],
17+
"resources": [
18+
{
19+
"uri": "file:///readme",
20+
"name": "README",
21+
"mimeType": "text/plain",
22+
"text": "# My Project\n\nThis is the project README."
23+
}
24+
]
25+
}
26+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"llm": {
3+
"record": {
4+
"providers": {
5+
"openai": "https://api.openai.com/v1",
6+
"anthropic": "https://api.anthropic.com"
7+
},
8+
"fixturePath": "./recorded-fixtures"
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)