|
| 1 | +"use client" |
| 2 | + |
| 3 | +import { |
| 4 | + Suggestions, |
| 5 | + Suggestion, |
| 6 | +} from "@/src/components/ai-elements/suggestion" |
| 7 | + |
| 8 | +export interface AgentSuggestionsProps { |
| 9 | + suggestions: string[] |
| 10 | + onSelect: (suggestion: string) => void |
| 11 | + disabled?: boolean |
| 12 | +} |
| 13 | + |
| 14 | +export function AgentSuggestions({ |
| 15 | + suggestions, |
| 16 | + onSelect, |
| 17 | + disabled = false, |
| 18 | +}: AgentSuggestionsProps) { |
| 19 | + if (suggestions.length === 0) return null |
| 20 | + |
| 21 | + return ( |
| 22 | + <Suggestions className="py-2"> |
| 23 | + {suggestions.map((suggestion) => ( |
| 24 | + <Suggestion |
| 25 | + key={suggestion} |
| 26 | + suggestion={suggestion} |
| 27 | + onClick={onSelect} |
| 28 | + disabled={disabled} |
| 29 | + /> |
| 30 | + ))} |
| 31 | + </Suggestions> |
| 32 | + ) |
| 33 | +} |
| 34 | + |
| 35 | +export const DEFAULT_SUGGESTIONS: Record<string, string[]> = { |
| 36 | + weatherAgent: [ |
| 37 | + "What's the weather in Tokyo?", |
| 38 | + "Will it rain tomorrow in NYC?", |
| 39 | + "Weather forecast for London this week", |
| 40 | + ], |
| 41 | + researchAgent: [ |
| 42 | + "Research the latest AI trends", |
| 43 | + "Find papers on transformer architecture", |
| 44 | + "Summarize recent developments in quantum computing", |
| 45 | + ], |
| 46 | + stockAnalysisAgent: [ |
| 47 | + "Analyze AAPL stock performance", |
| 48 | + "Compare TSLA vs RIVN", |
| 49 | + "What are the top tech stocks today?", |
| 50 | + ], |
| 51 | + copywriterAgent: [ |
| 52 | + "Write a product description for a smart watch", |
| 53 | + "Create a tagline for a coffee brand", |
| 54 | + "Draft an email subject line for a sale", |
| 55 | + ], |
| 56 | + dataIngestionAgent: [ |
| 57 | + "Parse this CSV data", |
| 58 | + "Validate data structure", |
| 59 | + "Import from JSON format", |
| 60 | + ], |
| 61 | + documentProcessingAgent: [ |
| 62 | + "Convert PDF to markdown", |
| 63 | + "Extract text from this document", |
| 64 | + "Chunk this content for RAG", |
| 65 | + ], |
| 66 | + default: [ |
| 67 | + "What can you help me with?", |
| 68 | + "Tell me about your capabilities", |
| 69 | + "Show me an example", |
| 70 | + ], |
| 71 | +} |
| 72 | + |
| 73 | +export function getSuggestionsForAgent(agentId: string): string[] { |
| 74 | + return DEFAULT_SUGGESTIONS[agentId] || DEFAULT_SUGGESTIONS.default |
| 75 | +} |
0 commit comments