Skip to content

Bug: Agent callback - on_llm_start documentation #360

@michelebelmonte

Description

@michelebelmonte

Expected Behaviour

The inline documentation of the on_llm_start method should contain only the actual parameters of the method.

Current Behaviour

A "messages" parameters is mentioned, even though it is not part of the method signature

Code snippet

async def on_llm_start(
        self,
        name: str,
        payload_input: Any,
        run_id: Optional[UUID] = None,
        tags: Optional[list[str]] = None,
        metadata: Optional[dict[str, Any]] = None,
        **kwargs: Any,
    ) -> Any:
        """
        Callback method that runs when an llm starts processing.

        This method is called at the beginning of an llm's execution, providing information
        about the llm session and its context.

        Parameters:
            self: The instance of the callback handler class.
            agent_name: Name of the agent that is starting.
            payload_input: Dictionary containing the agent's input.
            messages: List of message dictionaries representing the conversation history.
            run_id: Unique identifier for this specific agent run.
            tags: Optional list of string tags associated with this agent run.
            metadata: Optional dictionary containing additional metadata about the run.
            **kwargs: Additional keyword arguments that might be passed to the callback.

        Returns:
            Any: The return value is implementation-dependent.
        """
        pass

Possible Solution

Remove this line:
messages: List of message dictionaries representing the conversation history.

also this "agent_name" should be changed to "name"

Steps to Reproduce

Read the inline documentation for the on_llm_start method

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions