Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.8 KB

collaboration_workflow.md

File metadata and controls

62 lines (42 loc) · 1.8 KB

ReXia.AI CollaborationWorkflow Class

Overview

The CollaborationWorkflow class implements a workflow that utilizes team collaboration and tool usage for task completion. It's designed to be used within an Agent instance and extends the functionality of the BaseWorkflow class.

Class Attributes

  • llm: The language model used by the workflow
  • task: The task to be performed
  • verbose: Flag for enabling verbose mode
  • channel: The collaboration channel for communication
  • team_work: The team worker component
  • tool: The tool worker component

Methods

__init__(self, llm: Any, task: str, verbose: bool = False, max_attempts: int = 3) -> None

Initializes a CollaborationWorkflow instance with the following parameters:

  • llm: The language model
  • task: The assigned task
  • verbose: Flag for verbose mode (default: False)
  • max_attempts: Maximum attempts for model responses (default: 3)

_run_task(self) -> None

Internal method that executes the main workflow process:

  1. Sets the task status to WORKING
  2. Runs the tool component if tools are available
  3. Runs the team work component
  4. Sets the task status to COMPLETED

run(self) -> None

Public method to initiate the workflow execution.

Usage

To use the CollaborationWorkflow with an Agent:

from rexia_ai.workflows import CollaborationWorkflow
from rexia_ai.agent import Agent

llm = ...  # Your language model instance
task = "Collaborate on a research project and summarize findings."

agent = Agent(
    llm=llm,
    task=task,
    workflow=CollaborationWorkflow,
    verbose=True
)

result = agent.invoke()
print(result)

This workflow enhances task-solving capabilities by incorporating team collaboration and tool usage, making it suitable for complex tasks that require multiple steps or expertise.