teff.flow.team¶
teff.flow.team
¶
Supervised team builder for :class:~teff.flow.Flow.
:class:TeamBuilder composes a supervisor decider plus routed agents in a
single call (:meth:~teff.flow.Flow.team). :class:Flow owns an instance
and delegates to it.
Classes:
| Name | Description |
|---|---|
TeamBuilder |
Compose a supervised agent team on a :class: |
TeamBuilder
¶
Compose a supervised agent team on a :class:~teff.flow.Flow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flow
|
Flow
|
The owning |
required |
Methods:
| Name | Description |
|---|---|
team |
Compose a supervised agent team in one call. |
Source code in teff/flow/team.py
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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
team
¶
team(
system="",
*,
roles,
model=None,
provider=None,
messages_key="messages",
sections=None,
route_keys=None,
done_keys=None,
done_mode="all",
fallback="",
max_rounds=6,
finish=None,
id=None,
)
Compose a supervised agent team in one call.
Builds a :class:~teff.node.supervisor.Supervisor decider plus one
routed agent per role and wires the supervisor loop in a single
step — the programmatic twin of the team: flow.yaml idiom::
flow.team(
"Route to planner or coder, then finish.",
roles={
"planner": AgentRole("You plan.", output_key="plan"),
"coder": AgentRole("You code.", output_key="code"),
},
fallback="planner",
)
Each role value is an :class:~teff.flow.AgentRole (the
recommended spelling), a plain dict recipe accepted for YAML parity
({system, output_key, use_tools, ...}), a :class:Node /
:class:~teff.flow.SubFlow used as-is, a :class:Flow embedded as a
:class:SubFlow, or a list of nodes run in sequence for that route.
The leader decider inherits model/provider (or the flow's
default_model/default_provider). route_keys defaults to
{role: output_key}; done_keys/done_mode/fallback/max_rounds
drive the built-in safety guards (see :class:Supervisor). When the
decider replies finish the flow continues through finish (or
terminates when omitted). id names the supervisor node.
Returns self for chaining.
Source code in teff/flow/team.py
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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |