@@ -9,6 +9,7 @@ This example demonstrates how to use the mock-agent for testing and development.
99- ** 5 Testing Skills** - Pre-configured skills for various testing scenarios
1010- ** Fast & Reliable** - Instant, predictable responses perfect for testing
1111- ** A2A Protocol Compliant** - Full implementation of the A2A protocol
12+ - ** Artifact Server** - MinIO-backed artifact storage for testing file artifacts
1213
1314## Quick Start
1415
@@ -188,6 +189,63 @@ docker compose run --rm a2a-debugger tasks submit 'Generate 10 test email addres
188189docker compose run --rm a2a-debugger tasks submit ' Generate 3 JSON objects for testing'
189190```
190191
192+ ### Testing Artifacts
193+
194+ The mock agent includes a fully operational artifact server with MinIO storage backend:
195+
196+ ``` bash
197+ # Verify artifact server is running
198+ curl http://localhost:8081/health
199+ # Response: {"status":"ok","time":"2025-10-19T17:37:20Z"}
200+
201+ # Verify artifact service is initialized
202+ docker compose logs mock-agent | grep " artifact service initialized"
203+ # Should show: artifact service initialized with MinIO storage
204+
205+ # Submit a task
206+ docker compose run --rm a2a-debugger tasks submit ' Please create an artifact with sample data'
207+ ```
208+
209+ ** Infrastructure Status:**
210+ - ✅ Artifact server running on port 8081
211+ - ✅ MinIO storage backend connected (minio:9000)
212+ - ✅ Artifact service initialized successfully
213+ - ✅ Download endpoint: ` GET /artifacts/:artifactId/:filename `
214+ - ✅ ` create_artifact ` tool available to LLM
215+
216+ ** How Artifacts Work:**
217+ 1 . The ADK automatically provides a ` create_artifact ` tool to the LLM
218+ 2 . When the LLM calls this tool, artifacts are stored in MinIO
219+ 3 . The artifact metadata (ID, download URL) is returned to the client
220+ 4 . Clients download artifacts from ` :8081/artifacts/:artifactId/:filename `
221+
222+ ** Testing with Real LLM:**
223+ The mock LLM is designed for testing A2A protocol infrastructure without API costs. To test actual artifact creation:
224+
225+ 1 . Replace mock LLM with a real provider in ` main.go ` :
226+ ``` go
227+ // Instead of:
228+ llmClient := mock.NewMockLLMClient ()
229+
230+ // Use:
231+ llmClient , err := server.NewOpenAICompatibleLLMClient (&cfg.A2A .AgentConfig , l)
232+ ```
233+
234+ 2 . Set environment variables:
235+ ``` bash
236+ A2A_AGENT_CLIENT_PROVIDER=openai
237+ A2A_AGENT_CLIENT_API_KEY=your-key
238+ A2A_AGENT_CLIENT_MODEL=gpt-4
239+ ```
240+
241+ 3 . The LLM will then call ` create_artifact ` and store files in MinIO
242+
243+ Access MinIO console to view/manage artifacts:
244+ ``` bash
245+ # Open in browser: http://localhost:9001
246+ # Credentials: minioadmin / minioadmin
247+ ```
248+
191249## Monitoring and Debugging
192250
193251### View Agent Logs
@@ -219,19 +277,45 @@ docker compose down
219277## Architecture
220278
221279```
222- ┌─────────────┐ ┌──────────────┐
223- │ a2a-debugger│────────>│ mock-agent │
224- │ (CLI) │ A2A │ :8080 │
225- └─────────────┘ Protocol└──────────────┘
226- │
227- v
228- ┌──────────────┐
229- │ Mock LLM │
230- │ Client │
231- │ (No API Key) │
232- └──────────────┘
280+ ┌─────────────┐ A2A Protocol ┌──────────────┐
281+ │ a2a-debugger│────────────────>│ mock-agent │
282+ │ (A2A Client)│ │ (A2A Server) │
283+ │ │ │ :8080 │
284+ │ │ └──────┬───────┘
285+ │ │ │
286+ │ │ │ Uses
287+ │ │ v
288+ │ │ ┌──────────────┐
289+ │ │ │ Mock LLM │
290+ │ │ │ Client │
291+ │ │ │ (Generates │
292+ │ │ │ Artifacts) │
293+ │ │ └──────┬───────┘
294+ │ │ │
295+ │ │ │ Stores
296+ │ │ v
297+ │ │ Download ┌──────────────┐
298+ │ │ Artifacts │ MinIO │
299+ │ │<─────────────────│ :9000 │
300+ └─────────────┘ via :8081 └──────────────┘
301+ Artifact Server
233302```
234303
304+ ## Services
305+
306+ This example runs the following services:
307+
308+ 1 . ** mock-agent** (:8080) - The main A2A agent server with Mock LLM client
309+ 2 . ** artifacts-server** (:8081) - HTTP server for clients to download generated artifacts
310+ 3 . ** minio** (:9000, :9001) - Object storage backend where artifacts are stored
311+ 4 . ** a2a-debugger** - CLI tool for interacting with the agent (manual profile)
312+
313+ The flow is:
314+ 1 . Client sends request to mock-agent via A2A protocol
315+ 2 . Mock LLM generates artifacts and stores them in MinIO
316+ 3 . Mock-agent returns artifact metadata to client
317+ 4 . Client downloads artifacts from artifact server (:8081) which retrieves them from MinIO
318+
235319## Why Use the Mock Agent?
236320
237321✅ ** No API Costs** - Completely free to run
0 commit comments