Back to prompt library
User Interaction & Report Generation
Linked challenge: Real-time Market Trend Agent
Prompt source
testing20 lines4 sectionsNo variables1 code block
Develop a simple interactive prompt (simulating a Bito AI chat interface) where a user can ask the `MarketMonitorAgent` about recent trends. The agent should:
1. Use `searchTrendsInPinecone` to retrieve relevant historical trends based on the user's query.
2. Synthesize information from `Mistral Large 2` and Pinecone to provide a coherent and informative response.
3. Focus on providing actionable insights or explanations, not just raw data. This will be evaluated by the `UserQueryResponse` task.
```typescript
// ... (previous MarketMonitorAgent setup)
async function handleUserQuery(query: string) {
console.log(`User query: ${query}`);
const response = await MarketMonitorAgent.run({
prompt: `Respond to the user's query about market trends: "${query}". Use the searchTrendsInPinecone tool to gather historical context and provide a comprehensive explanation.`,
context: {
userQuery: query
}
});
console.log('MarketMonitorAgent:', response.response); // Assuming response contains the LLM's final answer
}
// Simulate user interaction for evaluation
// handleUserQuery('What is the current trend for X daily active users?');
// handleUserQuery('Tell me about recent shifts in Threads engagement.');
```