Skip to main content

Agents for intelligence and coordination

Project description

Calute

Calute is a framework for building AI agents that can orchestrate function calls and switch between agents. It is designed for researchers experimenting with agent orchestration and function calling.

Key Features

  • Agent Orchestration: Calute helps manage multiple agents and their interactions, allowing you to create complex AI systems.
  • Function Calling: Calute simplifies the process of calling functions from AI agents, enabling them to interact with external tools and data sources.
  • Agent Switching: Calute provides agent switching capabilities, allowing you to create more dynamic and intelligent systems that can adapt to different situations.
  • Workflow Engine: Calute includes a workflow engine for defining and executing complex workflows involving LLMs and function execution.
  • LLM Client Abstraction: Calute supports OpenAI and Gemini models through a unified client interface, making it easy to switch between different LLMs.

Installation

To install Calute, use the following command:

poetry install

Usage

Here are some examples of how to use Calute:

Registering an Agent

from calute import Agent, AgentFunction, Calute

def my_function(input_data: str, context_variables: dict = None):
    """My function description (LLM will read the docs!)"""
    return f"Function executed with input: {input_data}"

agent = Agent(
    id="my_agent",
    name="My Agent",
    functions=[AgentFunction(func=my_function)],
    instructions="Follow these instructions."
)

# Assuming you have an initialized OpenAI or Gemini client
# client = OpenAI(...) or client = Gemini(...)
# calute = Calute(client)
# calute.register_agent(agent)

Defining a Workflow

from calute import Workflow, WorkflowStep, WorkflowEngine, WorkflowStepType

# Assuming you have a Calute instance
# calute = Calute(...)
# workflow_engine = WorkflowEngine(calute)

# workflow = workflow_engine.create_function_workflow(
#     id="my_workflow",
#     name="My Workflow",
#     functions=[my_function]
# )

Running a Workflow

# Assuming you have a workflow defined
# result = await workflow_engine.execute_workflow(
#     workflow_id="my_workflow",
#     context_variables={"input_data": "Hello, world!"}
# )
# print(result)

Modules

  • calute.py: Core Calute class with orchestration capabilities.
  • chain_module.py: Function chaining and execution.
  • client.py: LLM client abstraction for OpenAI and Gemini.
  • executors.py: Function and agent execution logic.
  • workflow.py: Workflow engine for defining and executing complex workflows.
  • types/: Data types and structures used in Calute.
  • utils.py: Utility functions.
  • basics.py: Basic registries.

Types

  • Agent: Represents an AI agent with capabilities and functions.
  • PromptTemplate: Configurable template for structuring agent prompts.
  • FunctionCall: Represents a function call to be executed.
  • Workflow: Defines a workflow with steps and transitions.

Example Mermaid Diagram

graph LR
    A[User Prompt] --> B{Agent Orchestrator}
    B --> C{Agent 1}
    C --> D[Function Call 1]
    D --> E{Function Executor}
    E --> F[Result 1]
    F --> B
    B --> G{Agent 2}
    G --> H[Function Call 2]
    H --> E
    E --> I[Result 2]
    I --> J[Final Response]

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Contributing

Contributions are welcome! Please see the contributing guidelines for more information.

Contact

If you have any questions or issues, please contact erfanzar.

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

calute-0.0.5.tar.gz (54.0 kB view details)

Uploaded Source

Built Distribution

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

calute-0.0.5-py3-none-any.whl (68.2 kB view details)

Uploaded Python 3

File details

Details for the file calute-0.0.5.tar.gz.

File metadata

  • Download URL: calute-0.0.5.tar.gz
  • Upload date:
  • Size: 54.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-26-generic

File hashes

Hashes for calute-0.0.5.tar.gz
Algorithm Hash digest
SHA256 0d06f1b8045a09869c257b0d4f7949153e7e997b2c6144795d149526731db8e0
MD5 b8d19a6774e65c9c75d67e7e9953b14b
BLAKE2b-256 f02f5009a6f38314c3dd6a4ff93c6b85425a72cc4167fd9a4c37dfbac13464b2

See more details on using hashes here.

File details

Details for the file calute-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: calute-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 68.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-26-generic

File hashes

Hashes for calute-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f0346d01830b608bc8c5ad3ce69629757018482fd3390d87121b1cfc02c2714c
MD5 849789da79ad100c0e8ca0ed7a7ef772
BLAKE2b-256 7c4c3498167b65d833ffc589b169748031280cfb21d5c05699aac924a464b63f

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