Files
copilotkit__copilotkit/showcase/aimock/feature-parity.json
Alem Tuzlak 6d49ecbb7b fix(showcase, runtime): subagents fixtures, voice mic format, fine-grained shared-state gating
Three follow-ups on top of PR #4837 that I had on the same branch but
didn't make it into the squash merge.

1. **packages/runtime: stamp `audio/webm` on empty-type Blobs in the
   transcription handler.** Browser MediaRecorder writes the audio as
   webm/opus, but the Blob's `type` field is often empty by the time it
   hits the server. `isValidAudioType` lets empty / octet-stream through
   for compatibility, but OpenAI Whisper then rejects the upload with
   `502 Invalid file format. Supported formats: ['flac', 'm4a', 'mp3',
   'mp4', 'mpeg', 'mpga', 'oga', 'ogg', 'wav', 'webm']` because it
   can't pick a decoder. Reconstructing the File with an explicit
   `audio/webm` type (and a `.webm` filename fallback) makes Whisper
   accept the bytes that were already valid. Monorepo-wide — applies to
   every integration using `/api/copilotkit-voice/transcribe`.

2. **showcase/aimock/feature-parity.json: port 12 subagents fixtures
   from d5-all.json** so the three pills (cold-exposure blog, LLM
   tool-calling explanation, reusable-rockets summary) work in
   production. d5-all.json already has the full research → writing →
   critique chain with substantive content; feature-parity only had the
   single LP remote-work pill. Production aimock loads both files but
   any case where feature-parity wins first-match needs the same
   content. Verbatim port — no fabricated text. Net result: no more
   `[sub-agent error] the writing agent...` on the demo's pills.

3. **showcase/aimock both files: scope shared-state-read-write Greet +
   Plan-a-weekend fixtures with a true all-defaults systemMessage
   gate.** The PR #4837 gate (`systemMessage: "tone: casual"`) only
   caught tone changes — name / language / interests changes still hit
   the canned fixture. Replaced with a two-element array gate (aimock
   supports all-present substring matching, verified in
   `/app/dist/router.js`):
     - `preferences:\n- Preferred tone: casual\n` — breaks if name is
       set (Name line inserts between signature and tone) or tone changes.
     - `- Preferred language: English\nTailor every response` — breaks
       if language changes or interests are added (Interests line
       inserts between language and Tailor).
   With `--provider-gemini` already wired in both local docker-compose
   and Railway prod, any state change now proxies to real Gemini and
   returns a personalised reply.

4. **showcase/aimock/feature-parity.json: re-remove bare 'plan' /
   'steps' / 'mars' / 'dashboard' / 'report' substring catch-alls + the
   bare 'alice' / 'Alice' fixtures.** These were removed in commit
   `ddc2e179` on the PR #4837 branch but didn't survive the squash
   merge, so they're back in main and still hijacking hitl-in-app
   downgrade-#12346 ('plan'), shared-state-rw weekend pill ('plan'),
   subagents 'rockets' pills, hitl-in-chat Schedule-1:1 with Alice
   ('alice'). Replace the alice pair with a single scoped
   `Hi, my name is Alice` fixture for the showcase-assistant
   introduction flow.

Local verification:
- `bin/showcase test google-adk --d5` → 38/38 green, 165s.
- Paired curl on shared-state-read-write:
  - Default state → canned fixture ("Hi — I'm your shared-state co-pilot…")
  - `name=alem` → real Gemini ("Hi there! …")
  - `interests=[Cooking, Travel]` weekend pill → real Gemini ("Hey
    there! Since you're into cooking and travel, how about a weekend
    plan that combines both?")

Production deploys this PR will pick up the aimock fixture changes
(prod loads feature-parity.json from GitHub raw at boot — no image
rebuild needed for that file) plus the runtime change once the
packages/runtime build is republished.
2026-05-15 15:57:31 +02:00

1249 lines
61 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"fixtures": [
{
"match": {
"toolCallId": "call_fp_generate_a2ui_sales_dashboard_001"
},
"response": {
"content": "Here's your sales dashboard — total revenue is $1.2M (+12% MoM), 342 new customers, and 4.2% conversion. The pie shows revenue split by category and the bar chart tracks monthly sales."
}
},
{
"match": {
"userMessage": "with total revenue, new customers, and conversion rate metrics",
"toolName": "_design_a2ui_surface",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_design_a2ui_surface_sales_dashboard_001",
"name": "_design_a2ui_surface",
"arguments": "{\"surfaceId\":\"beautiful-chat-sales-dashboard\",\"catalogId\":\"copilotkit://app-dashboard-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"Column\",\"children\":[\"row-metrics\",\"row-charts\"],\"gap\":16},{\"id\":\"row-metrics\",\"component\":\"Row\",\"children\":[\"card-revenue\",\"card-customers\",\"card-conversion\"],\"gap\":16},{\"id\":\"card-revenue\",\"component\":\"DashboardCard\",\"title\":\"Total Revenue\",\"child\":\"metric-revenue\"},{\"id\":\"metric-revenue\",\"component\":\"Metric\",\"label\":\"Total Revenue\",\"value\":\"$1.2M\",\"trend\":\"up\",\"trendValue\":\"+12% MoM\"},{\"id\":\"card-customers\",\"component\":\"DashboardCard\",\"title\":\"New Customers\",\"child\":\"metric-customers\"},{\"id\":\"metric-customers\",\"component\":\"Metric\",\"label\":\"New Customers\",\"value\":\"342\",\"trend\":\"up\",\"trendValue\":\"+8% MoM\"},{\"id\":\"card-conversion\",\"component\":\"DashboardCard\",\"title\":\"Conversion Rate\",\"child\":\"metric-conversion\"},{\"id\":\"metric-conversion\",\"component\":\"Metric\",\"label\":\"Conversion Rate\",\"value\":\"4.2%\",\"trend\":\"neutral\"},{\"id\":\"row-charts\",\"component\":\"Row\",\"children\":[\"card-pie\",\"card-bar\"],\"gap\":16},{\"id\":\"card-pie\",\"component\":\"DashboardCard\",\"title\":\"Revenue by Category\",\"child\":\"pie-revenue\"},{\"id\":\"pie-revenue\",\"component\":\"PieChart\",\"data\":[{\"label\":\"Electronics\",\"value\":42000},{\"label\":\"Clothing\",\"value\":28000},{\"label\":\"Food\",\"value\":18000},{\"label\":\"Books\",\"value\":12000}]},{\"id\":\"card-bar\",\"component\":\"DashboardCard\",\"title\":\"Monthly Sales\",\"child\":\"bar-monthly\"},{\"id\":\"bar-monthly\",\"component\":\"BarChart\",\"data\":[{\"label\":\"Jan\",\"value\":50000},{\"label\":\"Feb\",\"value\":62000},{\"label\":\"Mar\",\"value\":58000},{\"label\":\"Apr\",\"value\":71000},{\"label\":\"May\",\"value\":80000},{\"label\":\"Jun\",\"value\":92000}]}]}"
}
]
}
},
{
"match": {
"userMessage": "with total revenue, new customers, and conversion rate metrics",
"toolName": "render_a2ui",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_render_a2ui_sales_dashboard_001",
"name": "render_a2ui",
"arguments": "{\"surfaceId\":\"beautiful-chat-sales-dashboard\",\"catalogId\":\"copilotkit://app-dashboard-catalog\",\"components\":[{\"id\":\"root\",\"component\":\"Column\",\"children\":[\"row-metrics\",\"row-charts\"],\"gap\":16},{\"id\":\"row-metrics\",\"component\":\"Row\",\"children\":[\"card-revenue\",\"card-customers\",\"card-conversion\"],\"gap\":16},{\"id\":\"card-revenue\",\"component\":\"DashboardCard\",\"title\":\"Total Revenue\",\"child\":\"metric-revenue\"},{\"id\":\"metric-revenue\",\"component\":\"Metric\",\"label\":\"Total Revenue\",\"value\":\"$1.2M\",\"trend\":\"up\",\"trendValue\":\"+12% MoM\"},{\"id\":\"card-customers\",\"component\":\"DashboardCard\",\"title\":\"New Customers\",\"child\":\"metric-customers\"},{\"id\":\"metric-customers\",\"component\":\"Metric\",\"label\":\"New Customers\",\"value\":\"342\",\"trend\":\"up\",\"trendValue\":\"+8% MoM\"},{\"id\":\"card-conversion\",\"component\":\"DashboardCard\",\"title\":\"Conversion Rate\",\"child\":\"metric-conversion\"},{\"id\":\"metric-conversion\",\"component\":\"Metric\",\"label\":\"Conversion Rate\",\"value\":\"4.2%\",\"trend\":\"neutral\"},{\"id\":\"row-charts\",\"component\":\"Row\",\"children\":[\"card-pie\",\"card-bar\"],\"gap\":16},{\"id\":\"card-pie\",\"component\":\"DashboardCard\",\"title\":\"Revenue by Category\",\"child\":\"pie-revenue\"},{\"id\":\"pie-revenue\",\"component\":\"PieChart\",\"data\":[{\"label\":\"Electronics\",\"value\":42000},{\"label\":\"Clothing\",\"value\":28000},{\"label\":\"Food\",\"value\":18000},{\"label\":\"Books\",\"value\":12000}]},{\"id\":\"card-bar\",\"component\":\"DashboardCard\",\"title\":\"Monthly Sales\",\"child\":\"bar-monthly\"},{\"id\":\"bar-monthly\",\"component\":\"BarChart\",\"data\":[{\"label\":\"Jan\",\"value\":50000},{\"label\":\"Feb\",\"value\":62000},{\"label\":\"Mar\",\"value\":58000},{\"label\":\"Apr\",\"value\":71000},{\"label\":\"May\",\"value\":80000},{\"label\":\"Jun\",\"value\":92000}]}]}"
}
]
}
},
{
"match": {
"userMessage": "with total revenue, new customers, and conversion rate metrics",
"toolName": "generate_a2ui",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_generate_a2ui_sales_dashboard_001",
"name": "generate_a2ui",
"arguments": "{}"
}
]
}
},
{
"match": {
"toolCallId": "call_fp_get_weather_001"
},
"response": {
"content": "The current weather in Tokyo is 22°C with partly cloudy skies. Humidity is at 65% with light winds from the east at 12 km/h. Perfect weather for a walk outside!"
}
},
{
"match": {
"toolCallId": "call_fp_render_pie_chart_001"
},
"response": {
"content": "Pie chart rendered above — Electronics is the largest slice at $42,000, followed by Clothing, Food, and Books."
}
},
{
"match": {
"toolCallId": "call_fp_show_card_001"
},
"response": {
"content": "Here is a quick card for Ada Lovelace — the rendered card above shows a short biography. Let me know if you want a deeper dive on her work or a different historical figure."
}
},
{
"match": {
"toolCallId": "call_fp_request_approval_001"
},
"response": {
"content": "Approved — processing the $50 refund to customer #12345 now."
}
},
{
"match": {
"toolCallId": "call_fp_book_call_001"
},
"response": {
"content": "Booked Alice's onboarding call for the time you selected — calendar invite is on its way."
}
},
{
"match": {
"toolCallId": "call_fp_set_notes_001"
},
"response": {
"content": "Got it — I have noted that your favorite color is blue."
}
},
{
"match": {
"toolCallId": "call_fp_critique_agent_001"
},
"response": {
"content": "Here is the summary, after research → drafting → critique:\n\nRemote work returns roughly ten hours a week to employees by eliminating the commute, and repeated surveys show meaningfully higher job satisfaction among remote workers. Employers benefit too: a geographically unbounded talent pool and lower office overhead. The honest counterweight is that ad-hoc collaboration, mentorship of junior staff, and cultural cohesion all degrade without intentional rituals to replace what an office provided implicitly."
}
},
{
"match": {
"toolCallId": "call_fp_writing_agent_001"
},
"response": {
"toolCalls": [
{
"id": "call_fp_critique_agent_001",
"name": "critique_agent",
"arguments": "{\"draft\":\"Remote work returns roughly ten hours a week to employees by eliminating the commute, and repeated surveys show meaningfully higher job satisfaction among remote workers. Employers benefit too: a geographically unbounded talent pool and lower office overhead. The honest counterweight is that ad-hoc collaboration, mentorship of junior staff, and cultural cohesion all degrade without intentional rituals to replace what an office provided implicitly.\",\"instructions\":\"Check factual claims, tighten prose, flag any unsupported assertions.\"}"
}
]
}
},
{
"match": {
"toolCallId": "call_fp_research_agent_001"
},
"response": {
"toolCalls": [
{
"id": "call_fp_writing_agent_001",
"name": "writing_agent",
"arguments": "{\"brief\":\"One-paragraph summary on the benefits of remote work, grounded in the research facts.\",\"facts\":[\"Eliminating commutes returns roughly ten hours per week per employee.\",\"Repeated surveys show meaningfully higher job satisfaction among remote workers.\",\"Employers gain access to a geographically unbounded talent pool.\",\"Office overhead (leases, utilities, maintenance) drops significantly.\",\"Trade-offs include reduced ad-hoc collaboration, harder mentorship of junior staff, and erosion of cultural cohesion without intentional replacement rituals.\"]}"
}
]
}
},
{
"match": {
"toolCallId": "call_fp_pie_chart_001"
},
"response": {
"content": "Pie chart rendered above — Electronics is the largest slice, followed by Clothing, Food, and Books."
}
},
{
"match": {
"toolCallId": "call_fp_bar_chart_001"
},
"response": {
"content": "Bar chart rendered above — Salaries dominate monthly spend, with Rent, Marketing, and Travel rounding out the breakdown."
}
},
{
"match": {
"toolCallId": "call_fp_pie_chart_002"
},
"response": {
"content": "Pie chart rendered above — Organic Search drives most traffic, followed by Direct, Social, and Referral."
}
},
{
"match": {
"toolCallId": "call_fp_pie_chart_003"
},
"response": {
"content": "Pie chart rendered above — Apple and Samsung lead, with Xiaomi third and the long tail under \"Others\"."
}
},
{
"match": {
"toolCallId": "call_fp_bar_chart_002"
},
"response": {
"content": "Bar chart rendered above — Q4 was the strongest quarter, with Q2 close behind."
}
},
{
"match": {
"toolCallId": "call_fp_pie_chart_004"
},
"response": {
"content": "Pie chart rendered above — Electronics is the largest slice, followed by Clothing, Food, and Books."
}
},
{
"match": {
"toolCallId": "call_fp_bar_chart_003"
},
"response": {
"content": "Bar chart rendered above — monthly expenses ranged from $12k in January to $15.8k in April."
}
},
{
"match": {
"toolCallId": "call_fp_schedule_time_001"
},
"response": {
"content": "Meeting scheduled — calendar invite is on its way."
}
},
{
"match": {
"toolCallId": "call_fp_search_flights_001"
},
"response": {
"content": "Two flights shown above — United at $349 (08:00) and Delta at $289 (10:15), both on time."
}
},
{
"match": {
"toolCallId": "call_fp_toggle_theme_001"
},
"response": {
"content": "Theme toggled."
}
},
{
"match": {
"userMessage": "good name for a goldfish"
},
"response": {
"content": "How about Bubbles? It is friendly, classic, and easy to call out at the tank. If you want alternatives: Goldie, Finley, or Mango."
}
},
{
"match": {
"userMessage": "name for its tank"
},
"response": {
"content": "Following the Bubbles theme, you could call the tank The Bubble Bowl. It pairs naturally with the goldfish's name and keeps the playful tone."
}
},
{
"match": {
"userMessage": "what we named the goldfish"
},
"response": {
"content": "We named the goldfish Bubbles, and the tank The Bubble Bowl."
}
},
{
"match": {
"userMessage": "What is the largest continent?"
},
"response": {
"content": "Asia is the largest continent — about 30% of Earth's land area, home to over 4.6 billion people."
}
},
{
"match": {
"userMessage": "Show me a profile card for Ada Lovelace",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_show_card_001",
"name": "show_card",
"arguments": "{\"title\":\"Ada Lovelace\",\"body\":\"English mathematician (1815–1852), credited as the first computer programmer for her notes on Charles Babbage's Analytical Engine — including what is now recognized as the first algorithm intended to be carried out by a machine.\"}"
}
]
}
},
{
"match": {
"userMessage": "Issue a $50 refund to customer #12345",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_request_approval_001",
"name": "request_user_approval",
"arguments": "{\"message\":\"Issue a $50 refund to customer #12345.\",\"context\":\"Per the standard goodwill-credit policy for shipping delays.\"}"
}
]
}
},
{
"match": {
"userMessage": "Book a 30-minute onboarding call for Alice",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_book_call_001",
"name": "book_call",
"arguments": "{\"topic\":\"Onboarding call\",\"name\":\"Alice\"}"
}
]
}
},
{
"match": {
"userMessage": "remember that my favorite color is blue",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_set_notes_001",
"name": "set_notes",
"arguments": "{\"notes\":[\"Favorite color: blue\"]}"
}
]
}
},
{
"match": {
"userMessage": "favorite color"
},
"response": {
"content": "Your favorite color is blue — I noted it earlier."
}
},
{
"match": {
"userMessage": "Research the benefits of remote work and draft a one-paragraph summary",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_research_agent_001",
"name": "research_agent",
"arguments": "{\"topic\":\"Benefits of remote work\"}"
}
]
}
},
{
"_comment": "shared-state-read-write — Greet pill. systemMessage array gate (all-present substring match) fires ONLY when every preference is at its INITIAL_PREFERENCES default. (1) 'preferences:\\n- Preferred tone: casual\\n' breaks if name is set (Name line inserts) or tone changes. (2) '- Preferred language: English\\nTailor every response' breaks if language changes or interests are added (Interests line inserts between language and Tailor). Any state change → fixture skips → aimock --provider-gemini proxies to real Gemini for a personalised reply.",
"match": {
"userMessage": "Say hi and introduce yourself.",
"systemMessage": [
"preferences:\n- Preferred tone: casual\n",
"- Preferred language: English\nTailor every response"
]
},
"response": {
"content": "Hi — I'm your shared-state co-pilot. Your Preferences panel (name, tone, language, interests) is fed to me on every turn, and I jot notes back into the Agent Scratch Pad via set_notes so the UI re-renders. Try setting your name or asking me to remember something."
}
},
{
"_comment": "shared-state-read-write — Plan-a-weekend pill. Same default-state gate as the Greet pill.",
"match": {
"userMessage": "Suggest a weekend plan based on my interests.",
"systemMessage": [
"preferences:\n- Preferred tone: casual\n",
"- Preferred language: English\nTailor every response"
]
},
"response": {
"content": "A weekend tailored to your interests panel: if you haven't picked any yet, try Cooking + Travel for a market-and-day-trip combo, or Tech + Books for a maker session and a long reading afternoon. Add interests in the Preferences panel and re-ask for a more specific plan."
}
},
{
"_comment": "Subagents pill 1 — 'Write a blog post' / cold exposure training. Drives supervisor → research_agent → writing_agent → critique_agent → final reply, plus three nested sub-agent turns. Mirrors d5-all.json content so production aimock (which loads feature-parity.json + d5-all.json) serves the same chain regardless of which file wins first-match.",
"match": {
"userMessage": "Produce a short blog post about the benefits of cold exposure training",
"hasToolResult": false,
"toolName": "research_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p1_research_001",
"name": "research_agent",
"arguments": "{\"task\":\"Cold exposure training key facts\"}"
}
]
}
},
{
"_comment": "Nested: research sub-agent returns deterministic facts about cold exposure training.",
"match": {
"userMessage": "Cold exposure training key facts"
},
"response": {
"content": "- Brief cold immersion (cold showers, ice baths) triggers a sympathetic-nervous-system response that releases noradrenaline\n- Repeated exposure is associated with improved self-reported mood and stress tolerance\n- Activates brown adipose tissue, modestly increasing basal metabolic rate\n- May reduce post-exercise muscle soreness when used as a recovery modality\n- Health risk for people with cardiovascular conditions; sessions should be short (1-3 minutes) and supervised at first"
}
},
{
"match": {
"userMessage": "Produce a short blog post about the benefits of cold exposure training",
"turnIndex": 1,
"toolName": "writing_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p1_writing_001",
"name": "writing_agent",
"arguments": "{\"task\":\"Short blog-post paragraph on the benefits of cold exposure training, grounded in the research facts.\\n\\nFacts:\\n- Brief cold immersion triggers a noradrenaline release\\n- Repeated exposure improves self-reported mood and stress tolerance\\n- Activates brown adipose tissue, modestly raises basal metabolic rate\\n- May reduce post-exercise muscle soreness\\n- Cardiovascular risk; keep early sessions short and supervised\"}"
}
]
}
},
{
"_comment": "Nested: writing sub-agent returns deterministic prose for cold exposure.",
"match": {
"userMessage": "Short blog-post paragraph on the benefits of cold exposure training"
},
"response": {
"content": "Cold exposure training — short, deliberate plunges into cold water or showers — has earned a foothold in modern recovery routines for reasons grounded in physiology rather than folklore. Each immersion produces a measurable surge of noradrenaline, the same chemistry that underpins the lift practitioners report in mood and focus afterward; with repetition, that response is associated with greater day-to-day stress tolerance. Cold also activates brown adipose tissue and can blunt post-exercise soreness, making it a low-cost adjunct for active people. The honest caveat is cardiovascular risk: keep early sessions to one to three minutes, and if you have a heart condition, get a green light before you start."
}
},
{
"match": {
"userMessage": "Produce a short blog post about the benefits of cold exposure training",
"turnIndex": 2,
"toolName": "critique_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p1_critique_001",
"name": "critique_agent",
"arguments": "{\"task\":\"Critique the cold-exposure blog draft. Draft: Cold exposure training — short, deliberate plunges into cold water or showers — has earned a foothold in modern recovery routines for reasons grounded in physiology rather than folklore. Each immersion produces a measurable surge of noradrenaline...\"}"
}
]
}
},
{
"_comment": "Nested: critique sub-agent returns deterministic critique of cold-exposure draft.",
"match": {
"userMessage": "Critique the cold-exposure blog draft"
},
"response": {
"content": "1. The phrase 'measurable surge of noradrenaline' should cite a study or rough magnitude — without a number, the claim reads as marketing rather than evidence.\n2. 'Modern recovery routines' is filler; lead with the physiological mechanism instead and let the cultural framing follow.\n3. The cardiovascular caveat is buried at the end. Move it earlier or make it a standalone closing line so a reader who skims still sees it."
}
},
{
"match": {
"userMessage": "Produce a short blog post about the benefits of cold exposure training",
"turnIndex": 3
},
"response": {
"content": "Here is the polished blog post on cold exposure training, after research → drafting → critique:\n\nCold exposure training — short, deliberate plunges into cold water or showers — produces a measurable noradrenaline surge that practitioners feel as a mood and focus lift; repeated exposure is associated with greater stress tolerance, brown-adipose activation, and reduced post-exercise soreness. Keep early sessions to one to three minutes, and if you have a cardiovascular condition, clear it with a clinician first."
}
},
{
"_comment": "Subagents pill 2 — 'Explain a topic' / LLM tool calling.",
"match": {
"userMessage": "Explain how large language models handle tool calling",
"hasToolResult": false,
"toolName": "research_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p2_research_001",
"name": "research_agent",
"arguments": "{\"task\":\"How LLMs handle tool calling\"}"
}
]
}
},
{
"_comment": "Nested: research sub-agent for LLM tool calling.",
"match": {
"userMessage": "How LLMs handle tool calling"
},
"response": {
"content": "- The model is shown a tool schema (name, description, JSON-schema parameters) inside the system or developer prompt at request time\n- During decoding, instead of emitting natural-language text, the model emits a structured tool_call block (function name + JSON-encoded arguments)\n- The application runs the tool, packages the result into a tool message, and resends the full conversation so the model can continue\n- Modern decoders use constrained decoding or grammars to keep the arguments syntactically valid JSON\n- The model decides on tool use turn-by-turn — there is no out-of-band channel; tool calls are just a different message role in the same chat thread"
}
},
{
"match": {
"userMessage": "Explain how large language models handle tool calling",
"turnIndex": 1,
"toolName": "writing_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p2_writing_001",
"name": "writing_agent",
"arguments": "{\"task\":\"One-paragraph explanation of how LLMs handle tool calling, grounded in the research.\\n\\nFacts:\\n- Tool schemas (name, description, JSON-schema params) are passed in the prompt\\n- Models emit a structured tool_call block instead of text\\n- Application runs the tool and replays the result as a tool message\\n- Constrained decoding keeps arguments valid JSON\\n- Tool use is decided turn-by-turn in the same chat thread\"}"
}
]
}
},
{
"_comment": "Nested: writing sub-agent for LLM tool calling.",
"match": {
"userMessage": "One-paragraph explanation of how LLMs handle tool calling"
},
"response": {
"content": "Large language models handle tool calling by treating tools as a structured extension of the chat protocol rather than a separate channel. At request time the application supplies each tool's name, description, and JSON-schema parameters in the prompt; during decoding the model can emit a tool_call block — a function name plus JSON-encoded arguments — instead of plain text, with constrained decoding keeping the arguments syntactically valid. The application then executes the tool and replays the result back as a tool-role message, and the model continues the conversation from there. The decision to call a tool is made turn-by-turn, so a single user request can fan out into a chain of tool calls that the model orchestrates as it reads each result."
}
},
{
"match": {
"userMessage": "Explain how large language models handle tool calling",
"turnIndex": 2,
"toolName": "critique_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p2_critique_001",
"name": "critique_agent",
"arguments": "{\"task\":\"Critique the LLM tool-calling explanation draft. Draft: Large language models handle tool calling by treating tools as a structured extension of the chat protocol rather than a separate channel. At request time the application supplies each tool's name, description, and JSON-schema parameters in the prompt...\"}"
}
]
}
},
{
"_comment": "Nested: critique sub-agent for LLM tool calling.",
"match": {
"userMessage": "Critique the LLM tool-calling explanation draft"
},
"response": {
"content": "1. The opening contrast 'rather than a separate channel' assumes the reader already knows what a 'separate channel' would mean — either drop the contrast or give a one-clause example (e.g., 'rather than a side API the model talks to in parallel').\n2. 'Constrained decoding keeping the arguments syntactically valid' is technically correct but vague; mention that this is what makes the JSON parseable on the application side.\n3. The final sentence introduces multi-tool chains without saying who controls the loop — clarify that the application is the runtime that decides whether to keep going, not the model itself."
}
},
{
"match": {
"userMessage": "Explain how large language models handle tool calling",
"turnIndex": 3
},
"response": {
"content": "Here is the explanation of LLM tool calling, after research → drafting → critique:\n\nLLMs treat tool calling as part of the chat protocol: each tool's name, description, and JSON-schema parameters are passed in the prompt, and during decoding the model can emit a structured tool_call block (function name + JSON arguments) instead of plain text. The application — not the model — runs the tool, returns the result as a tool-role message, and decides whether to keep looping. Constrained decoding keeps the arguments valid JSON the application can parse, and the model orchestrates multi-step chains turn-by-turn from inside the same conversation."
}
},
{
"_comment": "Subagents pill 3 — 'Summarize a topic' / reusable rockets.",
"match": {
"userMessage": "Summarize the current state of reusable rockets",
"hasToolResult": false,
"toolName": "research_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p3_research_001",
"name": "research_agent",
"arguments": "{\"task\":\"Current state of reusable rockets\"}"
}
]
}
},
{
"_comment": "Nested: research sub-agent for reusable rockets.",
"match": {
"userMessage": "Current state of reusable rockets"
},
"response": {
"content": "- SpaceX Falcon 9 routinely lands and re-flies first stages; individual boosters have flown more than 20 missions each\n- Falcon Heavy reuses both side boosters; the center core has been recovered on a subset of flights\n- Rocket Lab's Electron has demonstrated mid-air booster catch but routine reuse is still in development\n- SpaceX Starship is targeting full reuse of both stages; orbital test flights are ongoing as of 2024-2025\n- Reuse is the dominant lever on launch cost: Falcon 9 list pricing is set well below expendable competitors largely because of stage recovery"
}
},
{
"match": {
"userMessage": "Summarize the current state of reusable rockets",
"turnIndex": 1,
"toolName": "writing_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p3_writing_001",
"name": "writing_agent",
"arguments": "{\"task\":\"One polished paragraph summarizing the current state of reusable rockets, grounded in the research.\\n\\nFacts:\\n- Falcon 9 first stages routinely re-fly, some 20+ flights\\n- Falcon Heavy reuses side boosters; center core recovered sometimes\\n- Rocket Lab Electron demonstrating mid-air catch, reuse still in development\\n- SpaceX Starship targeting full reuse of both stages, in flight test\\n- Reuse drives launch cost downward\"}"
}
]
}
},
{
"_comment": "Nested: writing sub-agent for reusable rockets.",
"match": {
"userMessage": "One polished paragraph summarizing the current state of reusable rockets"
},
"response": {
"content": "Reusable rockets have shifted from a research goal to the default cost lever in commercial spaceflight. SpaceX's Falcon 9 routinely lands and re-flies its first stage — individual boosters have now flown twenty-plus missions — and Falcon Heavy reuses both side boosters with intermittent recovery of the center core. Smaller-class operators like Rocket Lab have demonstrated mid-air booster catch but have not yet made reuse routine, while SpaceX's Starship is in active flight testing toward full two-stage reuse. The economic consequence is already visible: Falcon 9 list pricing sits well below expendable competitors precisely because the dominant cost — building a fresh first stage every flight — has been amortized across many missions."
}
},
{
"match": {
"userMessage": "Summarize the current state of reusable rockets",
"turnIndex": 2,
"toolName": "critique_agent"
},
"response": {
"toolCalls": [
{
"id": "call_fp_subagents_p3_critique_001",
"name": "critique_agent",
"arguments": "{\"task\":\"Critique the reusable rockets summary draft. Draft: Reusable rockets have shifted from a research goal to the default cost lever in commercial spaceflight. SpaceX's Falcon 9 routinely lands and re-flies its first stage — individual boosters have now flown twenty-plus missions...\"}"
}
]
}
},
{
"_comment": "Nested: critique sub-agent for reusable rockets.",
"match": {
"userMessage": "Critique the reusable rockets summary draft"
},
"response": {
"content": "1. 'Default cost lever' is jargon that pre-supposes the reader already accepts the framing — open instead with the concrete result (Falcon 9 reflight count) and let the framing emerge.\n2. The Starship sentence is hedged ('in active flight testing toward full reuse') in a way that obscures the actual milestone reached as of writing — name the latest test outcome or drop the clause.\n3. The closing economic claim asserts pricing is 'well below expendable competitors' without a reference price; one number (e.g., $/kg-to-LEO) would land the point much harder than the qualitative claim alone."
}
},
{
"match": {
"userMessage": "Summarize the current state of reusable rockets",
"turnIndex": 3
},
"response": {
"content": "Here is the polished summary on reusable rockets, after research → drafting → critique:\n\nReusable rockets are now mainstream in commercial spaceflight. SpaceX's Falcon 9 lands and re-flies its first stage routinely — individual boosters have flown twenty-plus missions — and Falcon Heavy reuses both side boosters. Rocket Lab has demonstrated mid-air Electron booster catch but reuse is not yet routine, while SpaceX Starship is in active orbital flight testing with full two-stage reuse as the target. The economic impact is already priced in: Falcon 9 sits well below expendable competitors per kilogram to low Earth orbit because amortizing a recovered first stage across many missions removes the largest single cost from the launch."
}
},
{
"match": {
"userMessage": "weather",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_get_weather_001",
"name": "get_weather",
"arguments": "{\"location\":\"Tokyo\"}"
}
]
}
},
{
"match": {
"userMessage": "weather summary"
},
"response": {
"content": "The current weather in Tokyo is 22°C with partly cloudy skies. Humidity is at 65% with light winds from the east at 12 km/h. Perfect weather for a walk outside!"
}
},
{
"match": {
"userMessage": "revenue distribution by category",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_pie_chart_001",
"name": "pieChart",
"arguments": "{\"title\":\"Revenue by Category\",\"description\":\"Breakdown of revenue across product categories\",\"data\":[{\"label\":\"Electronics\",\"value\":42000},{\"label\":\"Clothing\",\"value\":28000},{\"label\":\"Food\",\"value\":18000},{\"label\":\"Books\",\"value\":12000}]}"
}
]
}
},
{
"match": {
"userMessage": "expenses by category",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_bar_chart_001",
"name": "barChart",
"arguments": "{\"title\":\"Expenses by Category\",\"description\":\"Monthly expense breakdown\",\"data\":[{\"label\":\"Rent\",\"value\":15000},{\"label\":\"Salaries\",\"value\":80000},{\"label\":\"Marketing\",\"value\":12000},{\"label\":\"Travel\",\"value\":5000}]}"
}
]
}
},
{
"match": {
"userMessage": "pie chart of website traffic by source",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_pie_chart_002",
"name": "render_pie_chart",
"arguments": "{\"title\":\"Website Traffic by Source\",\"description\":\"Traffic sources this month\",\"data\":[{\"label\":\"Organic Search\",\"value\":45},{\"label\":\"Direct\",\"value\":25},{\"label\":\"Social\",\"value\":18},{\"label\":\"Referral\",\"value\":12}]}"
}
]
}
},
{
"match": {
"userMessage": "smartphone market share by brand",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_pie_chart_003",
"name": "render_pie_chart",
"arguments": "{\"title\":\"Smartphone Market Share\",\"description\":\"Global smartphone market share by brand\",\"data\":[{\"label\":\"Apple\",\"value\":28},{\"label\":\"Samsung\",\"value\":22},{\"label\":\"Xiaomi\",\"value\":14},{\"label\":\"Others\",\"value\":36}]}"
}
]
}
},
{
"match": {
"userMessage": "bar chart of quarterly sales for Q1, Q2, Q3, Q4",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_bar_chart_002",
"name": "render_bar_chart",
"arguments": "{\"title\":\"Quarterly Sales\",\"description\":\"Sales across Q1-Q4\",\"data\":[{\"label\":\"Q1\",\"value\":145000},{\"label\":\"Q2\",\"value\":178000},{\"label\":\"Q3\",\"value\":162000},{\"label\":\"Q4\",\"value\":215000}]}"
}
]
}
},
{
"match": {
"userMessage": "Show me the sales dashboard with metrics and a revenue chart"
},
"response": {
"content": "{\"root\":\"revenue-metric\",\"elements\":{\"revenue-metric\":{\"type\":\"MetricCard\",\"props\":{\"label\":\"Revenue (Q3)\",\"value\":\"$1.24M\",\"trend\":\"+18% vs Q2\"},\"children\":[\"revenue-bar\"]},\"revenue-bar\":{\"type\":\"BarChart\",\"props\":{\"title\":\"Monthly revenue\",\"description\":\"Revenue by month across Q3\",\"data\":[{\"label\":\"Jul\",\"value\":380000},{\"label\":\"Aug\",\"value\":410000},{\"label\":\"Sep\",\"value\":450000}]}}}}"
}
},
{
"match": {
"userMessage": "Break down revenue by category as a pie chart"
},
"response": {
"content": "{\"root\":\"category-pie\",\"elements\":{\"category-pie\":{\"type\":\"PieChart\",\"props\":{\"title\":\"Revenue by category\",\"description\":\"Share of total revenue by product category\",\"data\":[{\"label\":\"Enterprise\",\"value\":540000},{\"label\":\"SMB\",\"value\":310000},{\"label\":\"Self-serve\",\"value\":220000},{\"label\":\"Partner\",\"value\":170000}]}}}}"
}
},
{
"match": {
"userMessage": "Show me monthly expenses as a bar chart"
},
"response": {
"content": "{\"root\":\"expense-bar\",\"elements\":{\"expense-bar\":{\"type\":\"BarChart\",\"props\":{\"title\":\"Monthly expenses\",\"description\":\"Operating expenses by month\",\"data\":[{\"label\":\"Jul\",\"value\":210000},{\"label\":\"Aug\",\"value\":225000},{\"label\":\"Sep\",\"value\":240000}]}}}}"
}
},
{
"match": {
"userMessage": "Show me a Q4 sales dashboard. Include a total-revenue metric card, a pie chart of revenue by segment, and a bar chart of monthly revenue."
},
"response": {
"content": "{\"ui\":[{\"Markdown\":{\"props\":{\"children\":\"## Q4 Sales Summary\"}}},{\"metric\":{\"props\":{\"label\":\"Total Revenue\",\"value\":\"$1.2M\"}}},{\"pieChart\":{\"props\":{\"title\":\"Revenue by Segment\",\"data\":\"[{\\\"label\\\":\\\"Enterprise\\\",\\\"value\\\":600000},{\\\"label\\\":\\\"SMB\\\",\\\"value\\\":400000},{\\\"label\\\":\\\"Startup\\\",\\\"value\\\":200000}]\"}}},{\"barChart\":{\"props\":{\"title\":\"Monthly Revenue\",\"data\":\"[{\\\"label\\\":\\\"Oct\\\",\\\"value\\\":350000},{\\\"label\\\":\\\"Nov\\\",\\\"value\\\":400000},{\\\"label\\\":\\\"Dec\\\",\\\"value\\\":450000}]\"}}}]}"
}
},
{
"match": {
"userMessage": "Break down Q4 revenue by product category as a pie chart. Include at least four segments with realistic sample values."
},
"response": {
"content": "{\"ui\":[{\"pieChart\":{\"props\":{\"title\":\"Q4 Revenue by Product Category\",\"data\":\"[{\\\"label\\\":\\\"Software\\\",\\\"value\\\":500000},{\\\"label\\\":\\\"Hardware\\\",\\\"value\\\":300000},{\\\"label\\\":\\\"Consulting\\\",\\\"value\\\":150000},{\\\"label\\\":\\\"Subscriptions\\\",\\\"value\\\":50000}]\"}}}]}"
}
},
{
"match": {
"userMessage": "Show me monthly operating expenses for the last six months as a bar chart with one bar per month."
},
"response": {
"content": "{\"ui\":[{\"barChart\":{\"props\":{\"title\":\"Monthly Operating Expenses\",\"data\":\"[{\\\"label\\\":\\\"Apr\\\",\\\"value\\\":205000},{\\\"label\\\":\\\"May\\\",\\\"value\\\":215000},{\\\"label\\\":\\\"Jun\\\",\\\"value\\\":222000},{\\\"label\\\":\\\"Jul\\\",\\\"value\\\":228000},{\\\"label\\\":\\\"Aug\\\",\\\"value\\\":234000},{\\\"label\\\":\\\"Sep\\\",\\\"value\\\":241000}]\"}}}]}"
}
},
{
"match": {
"userMessage": "revenue by category as a pie chart",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_pie_chart_004",
"name": "render_pie_chart",
"arguments": "{\"title\":\"Revenue by Category\",\"description\":\"Revenue breakdown by product category\",\"data\":[{\"label\":\"Electronics\",\"value\":42000},{\"label\":\"Clothing\",\"value\":28000},{\"label\":\"Food\",\"value\":18000},{\"label\":\"Books\",\"value\":12000}]}"
}
]
}
},
{
"match": {
"userMessage": "monthly expenses as a bar chart",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_bar_chart_003",
"name": "render_bar_chart",
"arguments": "{\"title\":\"Monthly Expenses\",\"description\":\"Expense breakdown by month\",\"data\":[{\"label\":\"Jan\",\"value\":12000},{\"label\":\"Feb\",\"value\":14500},{\"label\":\"Mar\",\"value\":13200},{\"label\":\"Apr\",\"value\":15800}]}"
}
]
}
},
{
"match": {
"userMessage": "30-minute meeting to learn about CopilotKit",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_schedule_time_001",
"name": "scheduleTime",
"arguments": "{\"reasonForScheduling\":\"Learn about CopilotKit\",\"meetingDuration\":30}"
}
]
}
},
{
"match": {
"userMessage": "flights from SFO to JFK",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_search_flights_001",
"name": "search_flights",
"arguments": "{\"flights\":[{\"airline\":\"United Airlines\",\"airlineLogo\":\"https://www.google.com/s2/favicons?domain=united.com&sz=128\",\"flightNumber\":\"UA123\",\"origin\":\"SFO\",\"destination\":\"JFK\",\"date\":\"Tue, Apr 15\",\"departureTime\":\"08:00\",\"arrivalTime\":\"16:30\",\"duration\":\"5h 30m\",\"status\":\"On Time\",\"statusColor\":\"#22c55e\",\"price\":\"$349\",\"currency\":\"USD\"},{\"airline\":\"Delta\",\"airlineLogo\":\"https://www.google.com/s2/favicons?domain=delta.com&sz=128\",\"flightNumber\":\"DL456\",\"origin\":\"SFO\",\"destination\":\"JFK\",\"date\":\"Tue, Apr 15\",\"departureTime\":\"10:15\",\"arrivalTime\":\"18:45\",\"duration\":\"5h 30m\",\"status\":\"On Time\",\"statusColor\":\"#22c55e\",\"price\":\"$289\",\"currency\":\"USD\"}]}"
}
]
}
},
{
"match": {
"userMessage": "toggle",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_toggle_theme_001",
"name": "toggleTheme",
"arguments": "{}"
}
]
}
},
{
"match": {
"toolCallId": "call_fp_beautiful_chat_manage_todos_001"
},
"response": {
"content": "Done — added three todos about learning CopilotKit to your task manager."
}
},
{
"match": {
"toolCallId": "call_fp_beautiful_chat_enable_app_mode_001"
},
"response": {
"toolCalls": [
{
"id": "call_fp_beautiful_chat_manage_todos_001",
"name": "manage_todos",
"arguments": "{\"todos\":[{\"id\":\"todo-cpk-1\",\"title\":\"Read the CopilotKit docs\",\"description\":\"Start with the quickstart and explore the core hooks.\",\"emoji\":\"📚\",\"status\":\"pending\"},{\"id\":\"todo-cpk-2\",\"title\":\"Build a CopilotKit prototype\",\"description\":\"Wire up a basic chat and register a frontend tool.\",\"emoji\":\"🚀\",\"status\":\"pending\"},{\"id\":\"todo-cpk-3\",\"title\":\"Explore shared agent state\",\"description\":\"Watch the canvas re-render as the agent writes to state.\",\"emoji\":\"🎯\",\"status\":\"pending\"}]}"
}
]
}
},
{
"match": {
"userMessage": "three todos about learning CopilotKit",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_beautiful_chat_enable_app_mode_001",
"name": "enableAppMode",
"arguments": "{}"
}
]
}
},
{
"match": {
"userMessage": "hello"
},
"response": {
"content": "Hello! I can help you with weather lookups, creating pie and bar charts, scheduling meetings, managing sales todos, searching flights, and toggling the theme. What would you like to do?"
}
},
{
"match": {
"userMessage": "Hello"
},
"response": {
"content": "Hello! I can help you with weather lookups, creating pie and bar charts, scheduling meetings, managing sales todos, searching flights, and toggling the theme. What would you like to do?"
}
},
{
"match": {
"userMessage": "help"
},
"response": {
"content": "Here are the things I can help with:\n- Check the weather for any location\n- Create pie charts and bar charts from data\n- Schedule meetings with a reason and duration\n- Manage your sales pipeline and todos\n- Search for flights between cities\n- Toggle the UI theme between light and dark\n\nJust ask me about any of these!"
}
},
{
"match": {
"userMessage": "can you tell me what is in this demo pdf I just attached"
},
"response": {
"content": "The attached PDF document is the CopilotKit Quickstart guide. It walks through three steps: install `@copilotkit/react-core` and `@copilotkit/react-ui`, wrap your app in a `<CopilotKit runtimeUrl=\"/api/copilotkit\">` provider, and drop a `<CopilotChat />` wherever you want the assistant to appear."
}
},
{
"match": {
"userMessage": "can you tell me what is in this demo image I just attached"
},
"response": {
"content": "The attached image is the CopilotKit logo — a clean, geometric mark used across CopilotKit branding."
}
},
{
"match": {
"userMessage": "Plan a 3-day Tokyo trip for a solo traveler interested in food, art, and architecture. Keep it concise."
},
"response": {
"content": "Here's a tight 3-day Tokyo loop for a solo traveler who wants food, art, and architecture in equal measure.\n\n**Day 1 — Shibuya & Harajuku**\n- Morning: breakfast at a kissaten in Shibuya, then walk Cat Street to Harajuku.\n- Afternoon: Nezu Museum (architecture by Kengo Kuma + traditional garden).\n- Evening: izakaya in Nonbei Yokocho.\n\n**Day 2 — Roppongi & Ginza**\n- Morning: Mori Art Museum and the Tokyo City View deck.\n- Afternoon: stroll Ginza, stop into Itoya, lunch at a sushi counter.\n- Evening: jazz at a Ginza basement bar.\n\n**Day 3 — Yanaka & Asakusa**\n- Morning: Yanaka Ginza for old-Tokyo atmosphere and craft shops.\n- Afternoon: Senso-ji and the Asakusa back-streets; consider the Sumida River walk to the Tadao Ando-designed 21_21 if you want one more architecture stop.\n- Evening: ramen near Ueno before catching the train.\n\nLet me know if you want a vegetarian variant or a more architecture-heavy version."
}
},
{
"match": {
"userMessage": "Explain retrieval-augmented generation as if I were 12. Use a simple analogy."
},
"response": {
"content": "Imagine you're taking an open-book test.\n\nA regular language model is like a kid who studied really hard but isn't allowed to look at the textbook during the test — they have to answer from memory, and sometimes they confidently make stuff up.\n\nRetrieval-Augmented Generation (RAG) is the same kid, but now they're allowed to flip through the textbook before answering each question. First they look up the relevant pages (that's the *retrieval* step), then they write the answer using what they just read (that's the *generation* step).\n\nSo RAG = \"look it up, then answer.\" The model still talks like itself, but the facts come from the book instead of from its memory — which means fewer made-up answers, and you can swap the book out whenever your information changes."
}
},
{
"match": {
"userMessage": "Draft a short, upbeat launch email announcing a new AI-powered chat feature. 3 short paragraphs max."
},
"response": {
"content": "**Subject:** Meet your new AI co-pilot — now built right into the app\n\nHi there,\n\nWe just shipped something we're really excited about: an AI-powered chat that lives inside the product you already use. Ask it questions, hand off tasks, or just have it summarize what you're looking at — it has full context of your workspace, so you don't have to copy-paste anything.\n\nIt's rolling out today to every account, no setup required. Open the app, look for the new chat button in the corner, and try it on your messiest task. We'd love to hear what you build with it.\n\n— The team"
}
},
{
"match": {
"userMessage": "hi"
},
"response": {
"content": "Hi there! I'm your showcase assistant. I can help with weather, charts, meetings, sales todos, flights, and theme toggling. What would you like to try?"
}
},
{
"match": {
"userMessage": "Based on the following context, write a concise"
},
"response": {
"content": "A short input value used to parameterize the crew's tasks and agents."
}
},
{
"match": {
"userMessage": "summarize"
},
"response": {
"content": "Here's a summary of your current sales pipeline:\n\n- **Total Pipeline Value**: $185,000\n- **Active Deals**: 5 deals across Prospect, Qualified, and Proposal stages\n- **Top Deal**: Acme Corp at $50,000 (Proposal stage)\n- **Win Rate**: 62% this quarter\n\nThe pipeline is healthy with good distribution across stages. Would you like to drill into any specific metric?"
}
},
{
"match": {
"userMessage": "expand"
},
"response": {
"content": "# Project Proposal: Q2 Initiative\n\n## Executive Summary\nThis proposal outlines the strategic objectives, timeline, and resource allocation for the Q2 project initiative.\n\n## Objectives\n1. Increase customer engagement by 25%\n2. Launch three new product features\n3. Reduce operational costs by 15%\n\n## Timeline\n- **Week 1-2**: Discovery and requirements gathering\n- **Week 3-6**: Development and implementation\n- **Week 7-8**: Testing and quality assurance\n- **Week 9-10**: Staged rollout and monitoring\n\n## Budget\nEstimated total: $45,000\n- Development: $25,000\n- Testing: $10,000\n- Infrastructure: $10,000\n\n## Success Metrics\n- Customer satisfaction score > 4.5\n- Feature adoption rate > 60%\n- Zero critical bugs at launch"
}
},
{
"match": {
"userMessage": "rewrite"
},
"response": {
"content": "Dear Team,\n\nI am writing to formally document the proceedings and key decisions from today's meeting.\n\n**Attendees**: Full project team\n**Date**: Today's session\n\n**Key Discussion Points**:\n1. Project timeline was reviewed and approved\n2. Resource allocation was confirmed\n3. Next milestones were established\n\n**Action Items**:\n- Complete phase one deliverables by end of week\n- Schedule follow-up review meeting\n- Distribute updated project documentation\n\nPlease review and confirm your respective action items.\n\nBest regards"
}
},
{
"match": {
"userMessage": "detailed"
},
"response": {
"content": "# Budget Report - Q3\n\n## Overview\n- **Total Budget**: $150,000\n- **Spent to Date**: $89,500 (59.7%)\n- **Remaining**: $60,500\n\n## Breakdown by Category\n- **Personnel**: $52,000 (58.1% of spend)\n- **Infrastructure**: $18,500 (20.7%)\n- **Software Licenses**: $12,000 (13.4%)\n- **Miscellaneous**: $7,000 (7.8%)\n\n## Key Highlights\n- Personnel costs are tracking 5% under budget\n- Infrastructure spend increased due to scaling needs\n- Software license renewal saved $3,000 through annual plan\n\n## Recommendations\n- Reallocate $5,000 from personnel to infrastructure\n- Prepay Q4 licenses for additional savings"
}
},
{
"match": {
"userMessage": "formal letter"
},
"response": {
"content": "Dear Sir/Madam,\n\nI am writing to formally present the enclosed draft text for your review and consideration.\n\nThe document has been prepared in accordance with standard formatting guidelines and organizational protocols. All relevant sections have been reviewed for accuracy and completeness.\n\nPlease find the revised content enclosed. Should you require any modifications or have questions regarding the content, please do not hesitate to contact me at your earliest convenience.\n\nI look forward to your feedback.\n\nYours sincerely,\nThe Document Editor"
}
},
{
"match": {
"userMessage": "deal",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "manage_sales_todos",
"arguments": "{\"todos\": [{\"id\": \"new-1\", \"title\": \"New Enterprise Deal\", \"stage\": \"prospect\", \"value\": 50000, \"dueDate\": \"2026-05-01\", \"assignee\": \"Alice\", \"completed\": false}]}"
}
]
}
},
{
"match": {
"userMessage": "sample deals",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "manage_sales_todos",
"arguments": "{\"todos\": [{\"id\": \"new-1\", \"title\": \"New Enterprise Deal\", \"stage\": \"prospect\", \"value\": 50000, \"dueDate\": \"2026-05-01\", \"assignee\": \"Alice\", \"completed\": false}]}"
}
]
}
},
{
"match": {
"userMessage": "paris",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "search_flights",
"arguments": "{\"flights\":[{\"airline\":\"Air France\",\"airlineLogo\":\"https://www.google.com/s2/favicons?domain=airfrance.com&sz=128\",\"flightNumber\":\"AF85\",\"origin\":\"SFO\",\"destination\":\"CDG\",\"date\":\"Mon, Apr 21\",\"departureTime\":\"16:00\",\"arrivalTime\":\"11:30+1\",\"duration\":\"10h 30m\",\"status\":\"On Time\",\"statusColor\":\"#22c55e\",\"price\":\"$780\",\"currency\":\"USD\"},{\"airline\":\"United Airlines\",\"airlineLogo\":\"https://www.google.com/s2/favicons?domain=united.com&sz=128\",\"flightNumber\":\"UA990\",\"origin\":\"SFO\",\"destination\":\"CDG\",\"date\":\"Mon, Apr 21\",\"departureTime\":\"18:15\",\"arrivalTime\":\"13:45+1\",\"duration\":\"10h 30m\",\"status\":\"On Time\",\"statusColor\":\"#22c55e\",\"price\":\"$720\",\"currency\":\"USD\"}]}"
}
]
}
},
{
"match": {
"toolCallId": "call_hitl_book_intro_sales_001"
},
"response": {
"content": "Booked the intro call with the sales team for the time you selected — calendar invite is on its way."
}
},
{
"match": {
"userMessage": "Please book an intro call with the sales team to discuss pricing.",
"toolName": "book_call",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_hitl_book_intro_sales_001",
"name": "book_call",
"arguments": "{\"topic\":\"Intro call — discuss pricing\",\"attendee\":\"Sales team\"}"
}
]
}
},
{
"_comment": "hitl-in-chat — Schedule 1:1 with Alice pill, 2nd turn (book_call tool result returned). Keyed on userMessage + toolCallId + hasToolResult so it wins ahead of the bare 'alice' / 'Alice' substring fixtures further below in this file, regardless of prior pill state in the thread.",
"match": {
"userMessage": "Schedule a 1:1 with Alice next week to review Q2 goals.",
"toolCallId": "call_hitl_book_1on1_alice_001",
"hasToolResult": true
},
"response": {
"content": "Booked the 1:1 with Alice for the time you selected — calendar invite is on its way."
}
},
{
"_comment": "hitl-in-chat — Schedule 1:1 with Alice pill, 1st turn (emit book_call). Exact pill substring + toolName + hasToolResult: false ensures this fires ONLY for the intended pill, not for arbitrary messages containing 'alice'.",
"match": {
"userMessage": "Schedule a 1:1 with Alice next week to review Q2 goals.",
"toolName": "book_call",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_hitl_book_1on1_alice_001",
"name": "book_call",
"arguments": "{\"topic\":\"1:1 with Alice — review Q2 goals\",\"attendee\":\"Alice\"}"
}
]
}
},
{
"_comment": "Scoped 'Alice' greeting fixture for the showcase-assistant 'Hi, my name is Alice' / introduction flow. Anchored on the longer phrase so it doesn't substring-match the hitl-in-chat 'Schedule a 1:1 with Alice' pill or other prompts that merely mention Alice.",
"match": {
"userMessage": "Hi, my name is Alice"
},
"response": {
"content": "Nice to meet you, Alice! I see you're in Tokyo -- wonderful city. How can I help you today? I can check the weather, look up flights, manage your sales pipeline, or help with other tasks."
}
},
{
"match": {
"userMessage": "What name did I just give"
},
"response": {
"content": "You said your name is Alice."
}
},
{
"match": {
"userMessage": "city"
},
"response": {
"content": "Based on our conversation, you said you live in Tokyo!"
}
},
{
"match": {
"userMessage": "sunset-themed gradient",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "change_background",
"arguments": "{\"background\":\"linear-gradient(135deg, #ff7e5f 0%, #feb47b 50%, #ffd194 100%)\"}"
}
]
}
},
{
"match": {
"userMessage": "Describe this image"
},
"response": {
"content": "This appears to be the CopilotKit logo. The mark combines clean geometric shapes typical of the CopilotKit brand identity."
}
},
{
"match": {
"userMessage": "Summarize this document"
},
"response": {
"content": "This is an excerpt from the CopilotKit documentation covering the quickstart — installing the packages and wrapping the app in a CopilotKitProvider pointing at a runtime endpoint."
}
},
{
"match": {
"userMessage": "blue gradient",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "change_background",
"arguments": "{\"background\":\"linear-gradient(135deg, #3b82f6 0%, #1e40af 100%)\"}"
}
]
}
},
{
"match": {
"userMessage": "short joke"
},
"response": {
"content": "Why did the developer go broke? Because they used up all their cache."
}
},
{
"match": {
"userMessage": "Search my notes for 'auth'",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "query_notes",
"arguments": "{\"keyword\":\"auth\"}"
}
]
}
},
{
"match": {
"userMessage": "xyzzy-nonsense-keyword",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "query_notes",
"arguments": "{\"keyword\":\"xyzzy-nonsense-keyword\"}"
}
]
}
},
{
"match": {
"userMessage": "Show me a pie chart of revenue by category",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"id": "call_fp_render_pie_chart_001",
"name": "render_pie_chart",
"arguments": "{\"title\":\"Revenue by Category\",\"description\":\"Revenue breakdown by product category\",\"data\":[{\"label\":\"Electronics\",\"value\":42000},{\"label\":\"Clothing\",\"value\":28000},{\"label\":\"Food\",\"value\":18000},{\"label\":\"Books\",\"value\":12000}]}"
}
]
}
},
{
"match": {
"userMessage": "bar chart of monthly expenses",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "render_bar_chart",
"arguments": "{\"title\":\"Monthly Expenses\",\"description\":\"Expense breakdown by month\",\"data\":[{\"label\":\"Jan\",\"value\":12000},{\"label\":\"Feb\",\"value\":14500},{\"label\":\"Mar\",\"value\":13200},{\"label\":\"Apr\",\"value\":15800}]}"
}
]
}
},
{
"match": {
"userMessage": "What is my name?"
},
"response": {
"content": "Based on the context you provided, your name is Jamie."
}
},
{
"match": {
"userMessage": "Roll a 20-sided die",
"hasToolResult": false
},
"response": {
"toolCalls": [
{
"name": "roll_dice",
"arguments": "{\"sides\":20}"
}
]
}
}
]
}