File size: 690 Bytes
116524e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""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: ...