Skip to main content

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-dot-fun

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,
)

image

image

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

coffee_dot_fun-0.1.1.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

coffee_dot_fun-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file coffee_dot_fun-0.1.1.tar.gz.

File metadata

  • Download URL: coffee_dot_fun-0.1.1.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

Hashes for coffee_dot_fun-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a0ba51ef8d8c14d5e06869f49cc70a8d27c4919f1e4ae27777eb650a205fab82
MD5 e2fba61bb41811a4188d2181e2f904e4
BLAKE2b-256 59c133bdb8410c628b76c12c303443ba14b8eebd82f2832a3404dad9c54b24ed

See more details on using hashes here.

File details

Details for the file coffee_dot_fun-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: coffee_dot_fun-0.1.1-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

Hashes for coffee_dot_fun-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6de5a9fe354ddf4b082b91781c0239eec5ebeb09d3ad7fc1adb7ea476003c841
MD5 201ce4ab92256df54debcba589590a2c
BLAKE2b-256 d42d4478984db17acceea4494e507aee37dc15184591583b2240f6966952847b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page