from incredible import AgentMax# Initializeagent = AgentMax(api_key="YOUR_API_KEY")# Use run_with_results() to get structured output backresult = agent.run_with_results( goal="Research competitors and summarize findings", result_structure={ "type": "object", "properties": { "competitors": {"type": "array"}, "summary": {"type": "string"} } })print(result.output) # Guaranteed to match your schema
Execute a task for side effects only (sending emails, updating databases, etc.). Does not return meaningful output.
Copy
# run() is for fire-and-forget tasks with side effectsagent.run( goal="Send personalized outreach emails to all at-risk customers", files=[open("customers.csv", "rb")], # Pass file objects data={"context": "Q1 2024"}, tools=[crm_tool, email_tool], max_steps=50, timeout=300)# The task runs. Emails get sent. No structured output returned.print("Outreach campaign started!")
Parameters:
Parameter
Type
Required
Description
goal
string
✅
What you want the agent to accomplish
files
File[]
❌
File objects to process
data
object
❌
Additional context data
tools
Tool[]
❌
Custom tools the agent can use
max_steps
int
❌
Maximum steps (default: 100)
timeout
int
❌
Timeout in seconds (default: 600)
run() does not return structured output. Use run_with_results() if you need data back.
from incredible import Tool# Define a toolcrm_search = Tool( name="search_crm", description="Search the CRM for customer information", parameters={ "type": "object", "properties": { "query": { "type": "string", "description": "Search query (company name, email, etc.)" }, "limit": { "type": "integer", "description": "Max results to return", "default": 10 } }, "required": ["query"] }, # Handler function that executes when tool is called handler=lambda params: your_crm_api.search(params["query"], params.get("limit", 10)))# Use the tool with run_with_results to get data backresult = agent.run_with_results( goal="Find all customers in the healthcare industry", tools=[crm_search], result_structure={ "type": "object", "properties": { "customers": {"type": "array"}, "total_count": {"type": "integer"} } })