Add your description here
Project description
Coffee Agent Framework
A Python framework for building and managing AI agent workflows with support for tools, teams, and complex interactions.
Installation
pip install coffee-agent-kit
You can find the package on PyPI.
Examples
See ./example.py
Interacting with the Coffee API
from coffee.api_client import CoffeeClient
from coffee.config import config
config.api_client = CoffeeClient(
api_key=YOUR_API_KEY,
)
Quickstart
from coffee import Agent, CoffeeClient, config
from coffee.models import DEFAULT_MODEL
# Configure API client
config.api_client = CoffeeClient(
api_key="your_api_key_here", base_url="https://coffee-sdk-api.fly.dev"
)
# Create a basic agent
research_agent = Agent(
name="ResearchAgent",
instructions=[
"You are a research assistant specialized in web information gathering"
],
tools=["duckduckgo", "web_browser"],
model=DEFAULT_MODEL,
)
# Simple interaction
research_agent.print_message("What's the latest news about AI advancements?")
Core Concepts
Agents
Agents are autonomous units with specific capabilities:
class Agent:
def message(self, msg: str, only_show_response: bool = True):
...
def print_message(self, msg: str):
...
Tools
Built-in tools provide specialized capabilities:
BuiltinTools = Literal[
"web3_essentials_tools",
"solana_tools",
"duckduckgo",
"web_browser",
"wikipedia_tools",
# and lots more
]
Workflows
Chain multiple agents into complex workflows:
web3_workflow = (
Workflow.build(
Task(description="Web search", assignee=search_agent)
)
.add_task(Task(description="Wiki research", assignee=wiki_agent))
.add_task(Task(description="Web3 analysis", assignee=web3_agent))
)
web3_workflow.execute_and_print("Latest blockchain trends")
Key Features
Multi-Agent Collaboration
team = Agent(
name="TeamLead",
instructions=["Coordinate team activities"],
team=[research_agent, writer_agent, analysis_agent]
)
Custom Tools
Register or Purchase custom tools on the Coffee Website and use them in your agents.
class RemoteTool(BaseModel):
name: str
url: str
args: dict[str, PluginArgType]
instructions: str
def register_tool(self):
# Registration logic
pass
Model Support
class OpenAI(Model):
id: str = "gpt-4o"
name: str = "OpenAIChat"
provider: str = "OpenAI"
class Claude(Model):
id: str = "claude-3-5-sonnet-20241022"
provider: str = "Anthropic"
Advanced Configuration
Environment Setup
# Configure logging
from coffee.log import logger
logger.setLevel(logging.DEBUG)
# Custom client configuration
config.api_client = CoffeeClient(
api_key="your_key"
)
Examples
Blog Writing Workflow
blog_workflow = Workflow.build(
Task(description="Gather research", assignee=research_agent)
).add_task(
Task(description="Write article", assignee=writer_agent)
)
blog_workflow.execute_and_print("Generative AI in healthcare")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coffee_agent_kit-0.1.0.tar.gz.
File metadata
- Download URL: coffee_agent_kit-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2413972747e71c4c939119d9ac3d95d9e7f1db8fe20a2f755503a1c3dd9af4b3
|
|
| MD5 |
c38182261adbf55479812b325e527e96
|
|
| BLAKE2b-256 |
7a438c25d64a13e23fa7513d2e4198176836ce0bf1bdc197100fd967411b2f8a
|
File details
Details for the file coffee_agent_kit-0.1.0-py3-none-any.whl.
File metadata
- Download URL: coffee_agent_kit-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fc86c55d87a3794c721d36a50cdabfaef071371d9e19c7a94e9f8685af799cd
|
|
| MD5 |
be202af284b82e64d462d26a4f510b85
|
|
| BLAKE2b-256 |
727cc45cbc0febd8c0c83b1d5cb1a0a9de30d838e8217e62f8dc6ea92d6a9bb5
|