logic-engine / ace /protocols /agent.py
ghostdrive1's picture
Upload folder using huggingface_hub
116524e verified
Raw
History Blame Contribute Delete
690 Bytes
"""Protocol defining what steps need from an Agent implementation."""
from __future__ import annotations
from typing import Any, Optional, Protocol, runtime_checkable
from ..core.outputs import AgentOutput
@runtime_checkable
class AgentLike(Protocol):
"""Structural interface for Agent-like objects.
Any object with a matching ``generate`` method satisfies this —
``ace.roles.Agent`` and ``ace.roles.ReplayAgent`` both do.
"""
def generate(
self,
*,
question: str,
context: Optional[str],
skillbook: Any,
reflection: Optional[str] = ...,
**kwargs: Any,
) -> AgentOutput: ...