Basic examples for common use cases in Python
from observee_agents import chat_with_tools
# Check and summarize emails
result = chat_with_tools(
message="Check my Gmail inbox and summarize important emails from today",
provider="anthropic"
)
print(result["content"])
# Get video transcript and analyze
result = chat_with_tools(
message="Get the transcript from this YouTube video and create a summary: https://youtube.com/watch?v=example",
provider="openai"
)
print(result["content"])
# Create Linear issue
result = chat_with_tools(
message="Create a Linear issue titled 'Fix login bug' with description 'Users cannot login with Google OAuth'",
provider="gemini"
)
print(result["content"])
# Search and analyze
result = chat_with_tools(
message="Search for the latest Python 3.12 features and explain the most important ones",
provider="anthropic"
)
print(result["content"])
import asyncio
from observee_agents import chat_with_tools_stream
async def stream_example():
async for chunk in chat_with_tools_stream(
message="What's the weather like today?",
provider="anthropic",
observee_api_key="obs_your_key_here"
):
if chunk["type"] == "content":
print(chunk["content"], end="", flush=True)
elif chunk["type"] == "tool_result":
print(f"\n🔧 [Tool: {chunk['tool_name']}]")
asyncio.run(stream_example())
Was this page helpful?