Back to Prompt Library
planning
Initial LlamaIndex Agent Setup with Multi-LLM
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Build a Secure Enterprise Data Analysis Agent with LlamaIndex and Modern LLMs
Format
Code-aware
Lines
10
Sections
1
Linked challenge
Build a Secure Enterprise Data Analysis Agent with LlamaIndex and Modern LLMs
Prompt source
Original prompt text with formatting preserved for inspection.
10 lines
1 sections
No variables
1 code block
Set up a LlamaIndex ReActAgent. Configure it to use both Claude 4 Sonnet for general text understanding and Gemini 3 Flash for numerical reasoning and complex logical evaluations. Define a custom tool, `load_financial_report(file_path)`, that simulates loading and parsing a financial report from a local file. Ensure your setup demonstrates how the agent would choose between LLMs based on the task. ```python from llama_index.core.agent import ReActAgent from llama_index.llms.anthropic import Anthropic # For Claude 4 Sonnet from llama_index.llms.gemini import Gemini # For Gemini 3 Flash from llama_index.core.tools import FunctionTool # Initialize LLMs claude_sonnet = Anthropic(model="claude-4-sonnet") gemini_flash = Gemini(model="gemini-3-flash") # Define a simple function tool def load_financial_report(file_path: str) -> str: """Loads and returns content from a simulated financial report file.""" # Simulate reading from a file path if file_path == "./reports/Q2_2024_Financials.txt": return "Revenue: 10M, Expenses: 8M, Profit: 2M. Anomaly detected: Expenses 20% higher than Q1 without explanation." return "File not found." financial_tool = FunctionTool.from_defaults(fn=load_financial_report) # Your task: Initialize ReActAgent with the appropriate LLM strategy and the financial_tool. # How would you configure LlamaIndex to use different LLMs for different parts of a reasoning chain? ```
Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Preserve the role framing, objective, and reporting structure so comparison runs stay coherent.
Tune next
Swap in your own domain constraints, anomaly thresholds, and examples before you branch variants.
Verify after
Check whether the prompt asks for the right evidence, confidence signal, and escalation path.