Basic Usage

from observee_agents import chat_with_tools

result = chat_with_tools(
    message="Search for recent AI news",
    provider="anthropic",
    observee_api_key="obs_your_key_here"
)

print(result["content"])

Parameters

ParameterTypeDefaultDescription
messagestrrequiredYour message or query
providerstr"anthropic"LLM provider: "anthropic", "openai", "gemini"
modelstrNoneSpecific model (auto-detected if not provided)
observee_api_keystrNoneYour Observee API key
enable_filteringboolTrueWhether to filter tools
filter_typestr"bm25"Filter method: "bm25", "local_embedding", "cloud"
max_toolsint20Maximum tools to provide
temperaturefloat0.7LLM temperature
max_tokensint1000Maximum response tokens

Response Format

{
    "content": "AI response text",
    "tool_calls": [{"name": "tool_name", "input": {...}}],
    "tool_results": [{"tool": "tool_name", "result": "..."}],
    "filtered_tools_count": 5,
    "used_filtering": True
}

Examples

Different Providers

# Anthropic Claude
result = chat_with_tools(
    message="Analyze this data",
    provider="anthropic",
    model="claude-sonnet-4-20250514"
)

# OpenAI GPT
result = chat_with_tools(
    message="Write a summary",
    provider="openai",
    model="gpt-4o"
)

# Google Gemini
result = chat_with_tools(
    message="Search for information",
    provider="gemini",
    model="gemini-2.5-pro"
)

Tool Filtering

# Fast keyword filtering (default)
result = chat_with_tools(
    message="Gmail email management",
    filter_type="bm25"
)

# Semantic filtering
result = chat_with_tools(
    message="Help me be productive",
    filter_type="local_embedding"
)

# No filtering - all tools
result = chat_with_tools(
    message="What can you do?",
    enable_filtering=False
)

Custom Configuration

result = chat_with_tools(
    message="Creative writing task",
    provider="openai",
    temperature=0.9,
    max_tokens=2000,
    max_tools=10
)

Common Use Cases

Email Management

result = chat_with_tools(
    message="Check my Gmail and summarize important emails",
    provider="anthropic"
)

Content Analysis

result = chat_with_tools(
    message="Get transcript from this YouTube video and summarize it",
    provider="openai"
)

Project Management

result = chat_with_tools(
    message="Create a Linear issue for the bug I described",
    provider="gemini"
)

Error Handling

try:
    result = chat_with_tools(
        message="Search for news",
        provider="anthropic"
    )
except Exception as e:
    print(f"Error: {e}")

Next Steps