Skip to content

structured_team

Class info

Classes

Name Children Inherits
StructuredTeam
llmling_agent.delegation.structured_team
A team that produces typed/structured output through a processor node.
    TeamRun
    llmling_agent.delegation.teamrun
    Handles team operations with monitoring.

      🛈 DocStrings

      StructuredTeam

      Bases: TeamRun[Any, TResult]

      A team that produces typed/structured output through a processor node.

      Source code in src/llmling_agent/delegation/structured_team.py
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      class StructuredTeam[TResult](TeamRun[Any, TResult]):
          """A team that produces typed/structured output through a processor node."""
      
          def __init__(
              self,
              worker: MessageNode[Any, Any],
              processor: AnyAgent[Any, TResult],
              *,
              name: str | None = None,
              description: str | None = None,
          ):
              """Initialize structured team.
      
              Args:
                  worker: The node doing the main work
                  processor: Node that processes/validates the output
                  name: Optional name for this team
                  description: Optional description
              """
              super().__init__(
                  agents=[worker, processor],
                  name=name or f"{worker.name}>{processor.name}",
                  description=description,
              )
      
          @property
          def worker(self) -> MessageNode[Any, Any]:
              """Get the worker node."""
              return self.agents[0]
      
          @worker.setter
          def worker(self, value: MessageNode[Any, Any]):
              """Set the worker node."""
              self.agents[0] = value
      
          @property
          def processor(self) -> AnyAgent[Any, TResult]:
              """Get the processor node."""
              return self.agents[1]  # type: ignore
      
          @processor.setter
          def processor(self, value: AnyAgent[Any, TResult]):
              """Set the processor node."""
              self.agents[1] = value
      

      processor property writable

      processor: AnyAgent[Any, TResult]
      

      Get the processor node.

      worker property writable

      worker: MessageNode[Any, Any]
      

      Get the worker node.

      __init__

      __init__(
          worker: MessageNode[Any, Any],
          processor: AnyAgent[Any, TResult],
          *,
          name: str | None = None,
          description: str | None = None,
      )
      

      Initialize structured team.

      Parameters:

      Name Type Description Default
      worker MessageNode[Any, Any]

      The node doing the main work

      required
      processor AnyAgent[Any, TResult]

      Node that processes/validates the output

      required
      name str | None

      Optional name for this team

      None
      description str | None

      Optional description

      None
      Source code in src/llmling_agent/delegation/structured_team.py
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      def __init__(
          self,
          worker: MessageNode[Any, Any],
          processor: AnyAgent[Any, TResult],
          *,
          name: str | None = None,
          description: str | None = None,
      ):
          """Initialize structured team.
      
          Args:
              worker: The node doing the main work
              processor: Node that processes/validates the output
              name: Optional name for this team
              description: Optional description
          """
          super().__init__(
              agents=[worker, processor],
              name=name or f"{worker.name}>{processor.name}",
              description=description,
          )