Skip to content

BaseTarget

BaseTarget

Bases: ABC

Defines the common interface for target classes.

Source code in src/agenteval/targets/base_target.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class BaseTarget(ABC):
    """Defines the common interface for target classes."""

    @abstractmethod
    def invoke(self, prompt: str) -> TargetResponse:
        """Invoke the target with a prompt.

        Args:
            prompt (str): The prompt as a string.

        Returns:
            TargetResponse
        """
        pass

invoke(prompt) abstractmethod

Invoke the target with a prompt.

Parameters:

Name Type Description Default
prompt str

The prompt as a string.

required

Returns:

Type Description
TargetResponse

TargetResponse

Source code in src/agenteval/targets/base_target.py
14
15
16
17
18
19
20
21
22
23
24
@abstractmethod
def invoke(self, prompt: str) -> TargetResponse:
    """Invoke the target with a prompt.

    Args:
        prompt (str): The prompt as a string.

    Returns:
        TargetResponse
    """
    pass