| Sean McCullough | 618bfb2 | 2025-06-25 20:52:30 +0000 | [diff] [blame] | 1 | /** |
| 2 | * Shared fake tool call data for demos |
| 3 | */ |
| 4 | |
| 5 | import { ToolCall } from "../../../types"; |
| 6 | |
| 7 | export const sampleToolCalls: ToolCall[] = [ |
| 8 | { |
| 9 | name: "multiple-choice", |
| 10 | input: JSON.stringify({ |
| 11 | question: "What is your favorite programming language?", |
| 12 | choices: [ |
| 13 | "JavaScript", |
| 14 | "TypeScript", |
| 15 | "Python", |
| 16 | "Go", |
| 17 | "Rust", |
| 18 | "Java", |
| 19 | "C#", |
| 20 | "C++", |
| 21 | ], |
| 22 | }), |
| 23 | tool_call_id: "toolu_01choice123", |
| 24 | result_message: { |
| 25 | type: "tool", |
| 26 | end_of_turn: false, |
| 27 | content: "Go", |
| 28 | tool_result: JSON.stringify({ |
| 29 | selected: "Go", |
| 30 | }), |
| 31 | timestamp: new Date().toISOString(), |
| 32 | conversation_id: "demo-conversation", |
| 33 | idx: 1, |
| 34 | }, |
| 35 | }, |
| 36 | { |
| 37 | name: "multiple-choice", |
| 38 | input: JSON.stringify({ |
| 39 | question: "Which feature would you like to implement next?", |
| 40 | choices: [ |
| 41 | "Dark mode", |
| 42 | "User profiles", |
| 43 | "Social sharing", |
| 44 | "Analytics dashboard", |
| 45 | ], |
| 46 | }), |
| 47 | tool_call_id: "toolu_01choice456", |
| 48 | // No result yet, showing the choices without a selection |
| 49 | }, |
| 50 | { |
| 51 | name: "bash", |
| 52 | input: JSON.stringify({ |
| 53 | command: |
| 54 | "docker ps -a --format '{{.ID}} {{.Image }} {{.Names}}' | grep sketch | awk '{print $1 }' | xargs -I {} docker rm {} && docker image prune -af", |
| 55 | }), |
| 56 | tool_call_id: "toolu_01bash123", |
| 57 | result: "Removed containers and pruned images", |
| 58 | }, |
| 59 | { |
| 60 | name: "patch", |
| 61 | input: JSON.stringify({ |
| 62 | path: "/app/src/components/Button.tsx", |
| 63 | patches: [ |
| 64 | { |
| 65 | operation: "replace", |
| 66 | oldText: "className='btn'", |
| 67 | newText: "className='btn btn-primary'", |
| 68 | }, |
| 69 | ], |
| 70 | }), |
| 71 | tool_call_id: "toolu_01patch123", |
| 72 | result: "Applied patch successfully", |
| 73 | }, |
| 74 | { |
| 75 | name: "think", |
| 76 | input: JSON.stringify({ |
| 77 | thoughts: |
| 78 | "I need to analyze the user's requirements and break this down into smaller steps. The user wants to implement a file upload feature with drag-and-drop support.", |
| 79 | }), |
| 80 | tool_call_id: "toolu_01think123", |
| 81 | result: "Recorded thoughts for planning", |
| 82 | }, |
| 83 | ]; |
| 84 | |
| 85 | export const longBashCommand: ToolCall = { |
| 86 | name: "bash", |
| 87 | input: JSON.stringify({ |
| 88 | command: |
| 89 | 'git commit --allow-empty -m "chore: create empty commit with very long message\n\nThis is an extremely long commit message to demonstrate how Git handles verbose commit messages.\nThis empty commit has no actual code changes, but contains a lengthy explanation.\n\nThe empty commit pattern can be useful in several scenarios:\n1. Triggering CI/CD pipelines without modifying code\n2. Marking significant project milestones or releases\n3. Creating annotated reference points in the commit history\n4. Documenting important project decisions"', |
| 90 | }), |
| 91 | tool_call_id: "toolu_01longbash", |
| 92 | result: |
| 93 | "[main abc1234] chore: create empty commit with very long message\n\ncommit created successfully", |
| 94 | }; |
| 95 | |
| 96 | export const multipleToolCallGroups = [ |
| 97 | [sampleToolCalls[0], sampleToolCalls[1]], // Multiple choice examples |
| 98 | [sampleToolCalls[2]], // Single bash command |
| 99 | [sampleToolCalls[3], sampleToolCalls[4]], // Patch and think |
| 100 | [longBashCommand], // Long command example |
| 101 | ]; |