Skip to content

Agent Class #66

@Unshure

Description

@Unshure

Description:

Create the main Agent class that integrates model providers, tools, and stubbed agent loop processing. Implement both streaming and non-streaming interfaces for agent interaction.

Work Required:

  • Implement Agent class constructor that takes model_provider, messages, tools, and system_prompt
  • Add ToolRegistry integration to Agent class for managing loaded tools
  • Register tools passed during initialization into the Agent's ToolRegistry
  • Create AgentResult interface with stop_reason and latest message
  • Implement async invoke method that returns AgentResult using the agentic loop
  • Implement async stream method that returns stream of events from agent loop with final AgentResult
  • Add messages as editable class attribute for conversation state management
  • Add proper error handling and propagation from agentic loop
  • Create unit tests for both invoke and stream methods
  • Create integration test that tests complete Agent workflow with real model provider and tools
  • Consider async initialization

Exit Criteria:

A working Agent class that supports both streaming and non-streaming interfaces, properly integrates with agentic loop for model and tool coordination, manages conversation state, and passes both unit and integration tests.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions