-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Feature Request: Workflow Module for MarketAgent Framework
Objective
- Allow defining workflows as a state machine or Directed Acyclic Graph (DAG) with tools.
- Enable chaining tools, passing outputs between steps as inputs to the next.
- Integrate with the existing
MarketAgent
class as an attribute (and cognitive steps such as perception, action, and reflection). - Use OpenAI function calling for generating and validating tool calls.
Key Components
WorkflowObject
- Defines steps and tool dependencies.
WorkflowExecutor
- Executes step-by-step tools in the workflow using LLMs.
ToolRegistry
- Stores callable tools with their OpenAI function-calling schema.
Workflow Design
Steps
Each step in the workflow defines:
- Tool to invoke: Specifies which tool to execute.
- Input schema: Static values or outputs from previous steps.
- Error handling: Defines fallback actions or recovery strategies.
Example
workflow = WorkflowDefinition(steps=[
{"id": "step1", "tool": "get_market_data", "inputs": {}},
{"id": "step2", "tool": "analyze_market", "inputs": {"data": "step1.result"}},
{"id": "step3", "tool": "place_order", "inputs": {"decision": "step2.result"}}
])
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request