Skip to content

events

Class info

Classes

Name Children Inherits
ChatMessage
llmling_agent.messaging.messages
Common message format for all UI types.
    CommandCompleteEvent
    llmling_agent.agent.events
    Event indicating slash command execution is complete.
      CommandOutputEvent
      llmling_agent.agent.events
      Event for slash command output.
        StreamCompleteEvent
        llmling_agent.agent.events
        Event indicating streaming is complete with final message.
          ToolCallCompleteEvent
          llmling_agent.agent.events
          Event indicating tool call is complete with both input and output.
            ToolCallProgressEvent
            llmling_agent.agent.events
            Event indicating the tool call progress.

              🛈 DocStrings

              Event stream events.

              CommandCompleteEvent dataclass

              Event indicating slash command execution is complete.

              Source code in src/llmling_agent/agent/events.py
              57
              58
              59
              60
              61
              62
              63
              64
              65
              66
              @dataclass(kw_only=True)
              class CommandCompleteEvent:
                  """Event indicating slash command execution is complete."""
              
                  command: str
                  """The command name that was completed."""
                  success: bool
                  """Whether the command executed successfully."""
                  event_kind: Literal["command_complete"] = "command_complete"
                  """Event type identifier."""
              

              command instance-attribute

              command: str
              

              The command name that was completed.

              event_kind class-attribute instance-attribute

              event_kind: Literal['command_complete'] = 'command_complete'
              

              Event type identifier.

              success instance-attribute

              success: bool
              

              Whether the command executed successfully.

              CommandOutputEvent dataclass

              Event for slash command output.

              Source code in src/llmling_agent/agent/events.py
              45
              46
              47
              48
              49
              50
              51
              52
              53
              54
              @dataclass(kw_only=True)
              class CommandOutputEvent:
                  """Event for slash command output."""
              
                  command: str
                  """The command name that was executed."""
                  output: str
                  """The output text from the command."""
                  event_kind: Literal["command_output"] = "command_output"
                  """Event type identifier."""
              

              command instance-attribute

              command: str
              

              The command name that was executed.

              event_kind class-attribute instance-attribute

              event_kind: Literal['command_output'] = 'command_output'
              

              Event type identifier.

              output instance-attribute

              output: str
              

              The output text from the command.

              StreamCompleteEvent dataclass

              Event indicating streaming is complete with final message.

              Source code in src/llmling_agent/agent/events.py
              17
              18
              19
              20
              21
              22
              23
              24
              @dataclass(kw_only=True)
              class StreamCompleteEvent[TContent]:
                  """Event indicating streaming is complete with final message."""
              
                  message: ChatMessage[TContent]
                  """The final chat message with all metadata."""
                  event_kind: Literal["stream_complete"] = "stream_complete"
                  """Event type identifier."""
              

              event_kind class-attribute instance-attribute

              event_kind: Literal['stream_complete'] = 'stream_complete'
              

              Event type identifier.

              message instance-attribute

              message: ChatMessage[TContent]
              

              The final chat message with all metadata.

              ToolCallCompleteEvent dataclass

              Event indicating tool call is complete with both input and output.

              Source code in src/llmling_agent/agent/events.py
              69
              70
              71
              72
              73
              74
              75
              76
              77
              78
              79
              80
              81
              82
              83
              84
              85
              86
              @dataclass(kw_only=True)
              class ToolCallCompleteEvent:
                  """Event indicating tool call is complete with both input and output."""
              
                  tool_name: str
                  """The name of the tool that was called."""
                  tool_call_id: str
                  """The ID of the tool call."""
                  tool_input: dict[str, Any]
                  """The input provided to the tool."""
                  tool_result: Any
                  """The result returned by the tool."""
                  agent_name: str
                  """The name of the agent that made the tool call."""
                  message_id: str
                  """The message ID associated with this tool call."""
                  event_kind: Literal["tool_call_complete"] = "tool_call_complete"
                  """Event type identifier."""
              

              agent_name instance-attribute

              agent_name: str
              

              The name of the agent that made the tool call.

              event_kind class-attribute instance-attribute

              event_kind: Literal['tool_call_complete'] = 'tool_call_complete'
              

              Event type identifier.

              message_id instance-attribute

              message_id: str
              

              The message ID associated with this tool call.

              tool_call_id instance-attribute

              tool_call_id: str
              

              The ID of the tool call.

              tool_input instance-attribute

              tool_input: dict[str, Any]
              

              The input provided to the tool.

              tool_name instance-attribute

              tool_name: str
              

              The name of the tool that was called.

              tool_result instance-attribute

              tool_result: Any
              

              The result returned by the tool.

              ToolCallProgressEvent dataclass

              Event indicating the tool call progress.

              Source code in src/llmling_agent/agent/events.py
              27
              28
              29
              30
              31
              32
              33
              34
              35
              36
              37
              38
              39
              40
              41
              42
              @dataclass(kw_only=True)
              class ToolCallProgressEvent:
                  """Event indicating the tool call progress."""
              
                  progress: int
                  """The current progress of the tool call."""
                  total: int
                  """The total progress of the tool call."""
                  message: str
                  """Progress message."""
                  tool_name: str
                  """The name of the tool being called."""
                  tool_call_id: str
                  """The ID of the tool call."""
                  tool_input: dict[str, Any] | None
                  """The input provided to the tool."""
              

              message instance-attribute

              message: str
              

              Progress message.

              progress instance-attribute

              progress: int
              

              The current progress of the tool call.

              tool_call_id instance-attribute

              tool_call_id: str
              

              The ID of the tool call.

              tool_input instance-attribute

              tool_input: dict[str, Any] | None
              

              The input provided to the tool.

              tool_name instance-attribute

              tool_name: str
              

              The name of the tool being called.

              total instance-attribute

              total: int
              

              The total progress of the tool call.

              create_queuing_progress_handler

              create_queuing_progress_handler(queue: Queue[ToolCallProgressEvent])
              

              Create progress handler that converts to ToolCallProgressEvent.

              Source code in src/llmling_agent/agent/events.py
              102
              103
              104
              105
              106
              107
              108
              109
              110
              111
              112
              113
              114
              115
              116
              117
              118
              119
              120
              121
              122
              123
              def create_queuing_progress_handler(queue: asyncio.Queue[ToolCallProgressEvent]):
                  """Create progress handler that converts to ToolCallProgressEvent."""
              
                  async def progress_handler(
                      progress: float,
                      total: float | None,
                      message: str | None,
                      tool_name: str | None = None,
                      tool_call_id: str | None = None,
                      tool_input: dict[str, Any] | None = None,
                  ) -> None:
                      event = ToolCallProgressEvent(
                          progress=int(progress) if progress is not None else 0,
                          total=int(total) if total is not None else 100,
                          message=message or "",
                          tool_name=tool_name or "",
                          tool_call_id=tool_call_id or "",
                          tool_input=tool_input,
                      )
                      await queue.put(event)
              
                  return progress_handler