ó
    ±"³jõ¯  ã                  ód  • S SK Jr  S SKrS SKrS SKJrJrJrJ	r	J
r
  S SKJr  S SKJr  S SKJrJrJrJrJrJr  S SKJrJr  S SKJrJr  S S	KJrJr  S S
KJrJ r J!r!J"r"J#r#J$r$J%r%J&r&  S SK'J(r(  SSK)J*r*J+r+J,r,J-r.J/r0  SSK1J2r2J3r3J4r4  SSK5J6r6  SSK7J8r8  SSK9J:r:  SSK;J<r<  SSK=J>r>  \(       a  SSK7J?r?  SSK@JArA   " S S\\\<   5      rBSrC S#S jrDS$S jrE\RŒ                  " SS9 " S S\\>\<4   5      5       rG\RŒ                   " S S \\<   5      5       rH\RŒ                  " SS9 " S! S"\\<   5      5       rIg)%é    )ÚannotationsN)ÚAsyncIteratorÚ	AwaitableÚCallableÚMappingÚSequence)Údeepcopy)Údatetime)ÚTYPE_CHECKINGÚAnyÚGenericÚLiteralÚcastÚoverload)Úmodel_serializerÚmodel_validator)ÚSerializationInfoÚSerializerFunctionWrapHandler)ÚNotRequiredÚ	TypedDict)ÚBaseNodeÚEndÚ	EndMarkerÚErrorMarkerÚGraphRunÚGraphRunContextÚGraphTaskRequestÚJoinItem)ÚNodeStepé   )Ú_agent_graphÚ_utilsÚ
exceptionsÚmessagesÚusage)ÚEnqueueContentÚPendingMessageÚPendingMessagePriority)Úcurrent_otel_traceparent)ÚCustomEventT)Údrain_pending_messages_at_end)ÚOutputDataT)Ú
AgentDepsT)Ú
RunContext)ÚFinalResultc                  óp   • \ rS rSr% S\S'   S\S'   S\S'   S\S	'   S
\S'   S\S'   S\S'   S\S'   S\S'   Srg)Ú_AgentRunResultDataé$   zNotRequired[OutputDataT]Úoutputúlist[_messages.ModelMessage]r$   zNotRequired[int]Únew_message_indexzNotRequired[str | None]Úoutput_tool_namezNotRequired[_usage.RunUsage]r%   zNotRequired[str]Úrun_idÚconversation_idz"NotRequired[dict[str, Any] | None]ÚmetadataÚtraceparent© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__Ú__static_attributes__r;   ó    ÚL/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pydantic_ai/run.pyr1   r1   $   s8   ‡ Ø$Ó$Ø*Ó*Ø'Ó'Ø-Ó-Ø'Ó'ØÓØ%Ó%Ø0Ó0Ø(Ö(rB   r1   )r%   r7   r8   r9   c               ó´  • [        U[        5      (       d  U $ [        U [        5      (       a:  [        SU 5      nUR	                  5        VVs0 s H  u  pEXA;   UL d  M  XE_M     snn$ [        U [
        5      (       aP  [        U [        [        45      (       d5  [        SU 5      n[        U5       VVs/ s H  u  peXa;   UL d  M  UPM     snn$ U $ s  snnf s  snnf )uP  Apply one key's nested `include`/`exclude` spec to the value itself.

Filters the container rather than re-serializing it, so the value stays whatever the outer
schema expects. That bounds what can be applied: a plain set of keys or indices, against a
mapping or a sequence â€” `exclude={'metadata': {'api_key'}}` and `exclude={'messages': {0}}`,
the forms a caller reaches for to redact an entry or drop a message. A deeper spec, or one
aimed at a key whose value is neither (`usage`), would need that value re-serialized against a
sub-schema, so it is left alone; see `_filter_serialized`.
úMapping[Any, Any]zSequence[Any])	Ú
isinstanceÚsetr   r   Úitemsr   ÚstrÚbytesÚ	enumerate)ÚvalueÚspecÚkeeprH   ÚkeyÚitemÚindexs          rC   Ú_filtered_valuerR   4   s»   € ô �dœC× Ñ ØˆÜ�%œ×!Ñ!ÜÐ(¨%Ó0ˆØ+0¯;©;¬=ÔRª=™i˜c¸S¹[ÈTÐ<Q“	�’	©=ÒRÐRÜ�%œ×"Ñ"¬:°e¼cÄ5¸\×+JÑ+JÜ�_ eÓ,ˆÜ(1°%Ô(8ÔTÒ(8™˜¸U¹]ÈtÐ<S—Ñ(8ÒTÐTØ€Lùó	 Sùó Us   ÁCÁCÂ1CÃCc           	     ó˜  • UR                   UR                  p2Ub+  U R                  5        VVs0 s H  u  pEXB;   d  M  XE_M     n nnUb„  [        U[        5      (       a  UOAUR                  5        VVs1 s H$  u  pF[        U[        [
        45      (       a  M"  UiM&     snnnU R                  5        VVs0 s H  u  pEXG;  d  M  XE_M     n nn[        U 5      nUS4US44 HT  u  pi[        U[        5      (       d  M  [        SU5      R                  5        H  u  pJXH;   d  M  [        X„   X©S9X„'   M     MV     U$ s  snnf s  snnf s  snnf )uÞ  Apply the caller's `include`/`exclude` to the keys `AgentRunResult._serialize` synthesizes.

Pydantic applies them to a model's own fields, which here are the private ones the public shape
replaces, so without this `exclude={'messages'}` would quietly dump the messages anyway, and a
spec reaching *inside* a key (`exclude={'metadata': {'api_key'}}`) would emit in full the value
it was asked to redact.

What `_filtered_value` can apply bounds this: one level, against a mapping or sequence value.
A deeper spec (`exclude={'messages': {'__all__': {'parts'}}}`), or one aimed at `usage`, means
re-serializing that value against a sub-schema â€” Pydantic's per-field machinery rebuilt for
nine synthesized keys â€” and is not applied.
TFrE   )rN   )	ÚincludeÚexcluderH   rF   rG   Údictr   r   rR   )ÚdataÚinforT   rU   rO   rL   rM   ÚdroppedÚfilteredrN   Úsub_specs              rC   Ú_filter_serializedr\   I   s(  € ð —|‘| T§\¡\ˆWØÑØ-1¯Z©Z¬\ÔLª\™z˜s¸S¹^“
�’
©\ˆÑLØÑô ˜'¤3×'Ñ'ñ à'.§}¡}¤Ô\¢™)˜#¼jÈÔPSÔUYÈ{×>[—#¡Ò\ð 	ð
 .2¯Z©Z¬\ÔPª\™z˜s¸SÑ=O“
�’
©\ˆÑPä�D‹z€HØ �¨°%Ð(8Ó9‰
ˆÜ˜$¤×(Ñ(ÙÜ!Ð"5°tÓ<×BÑBÖD‰MˆCØ�Ü /°±¸xÑ S�“ó Eñ :ð €Oùó# Mùó ]ùãPs"   ®D:½D:Á3!E ÂE Â5EÃEF)Úreprc                  ó¶  • \ rS rSr% SrS\S'   \R                  " SSSS9rS\S	'   \R                  " SSSS9r	S
\S'    \R                  " SSSS9r
S\S'    \S3S j5       r\S4S j5       rSS.S5S jjr\S6S j5       r\  S7S j5       r\S8S j5       rS9S jrSS.S:S jjrS9S jrS;S jr  S<S jr  S7S jr    S=S jrS>S jrS?S jrS@S  jrSAS! jr    SBS" jr        SCS# jr      SDS$ jr    SES% jr    SBS& jr \SFS' j5       r!\SGS( j5       r"\S4S) j5       r#\S4S* j5       r$\SHS+ j5       r%SIS, jr&S-S..     SJS/ jjr'SKS0 jr(S4S1 jr)S2r*g)LÚAgentRunél   aš  A stateful, async-iterable run of an [`Agent`][pydantic_ai.agent.Agent].

You generally obtain an `AgentRun` instance by calling `async with my_agent.iter(...) as agent_run:`.

Once you have an instance, you can use it to iterate through the run's nodes as they execute. When an
[`End`][pydantic_graph.basenode.End] is reached, the run finishes and [`result`][pydantic_ai.agent.AgentRun.result]
becomes available.

Example:
```python
from pydantic_ai import Agent

agent = Agent('openai:gpt-5.2')

async def main():
    nodes = []
    # Iterate through the run, recording each node along the way:
    async with agent.iter('What is the capital of France?') as agent_run:
        async for node in agent_run:
            nodes.append(node)
    print(nodes)
    '''
    [
        UserPromptNode(
            user_prompt='What is the capital of France?',
            instructions_functions=[],
            system_prompts=(),
            system_prompt_functions=[],
            system_prompt_dynamic_functions={},
        ),
        ModelRequestNode(
            request=ModelRequest(
                parts=[
                    UserPromptPart(
                        content='What is the capital of France?',
                        timestamp=datetime.datetime(...),
                    )
                ],
                timestamp=datetime.datetime(...),
                run_id='...',
                conversation_id='...',
            )
        ),
        CallToolsNode(
            model_response=ModelResponse(
                parts=[TextPart(content='The capital of France is Paris.')],
                usage=RequestUsage(
                    cost=Decimal('0.000196'), input_tokens=56, output_tokens=7
                ),
                model_name='gpt-5.2',
                timestamp=datetime.datetime(...),
                run_id='...',
                conversation_id='...',
            )
        ),
        End(data=FinalResult(output='The capital of France is Paris.')),
    ]
    '''
    print(agent_run.result.output)
    #> The capital of France is Paris.
```

You can also manually drive the iteration using the [`next`][pydantic_ai.agent.AgentRun.next] method for
more granular control.
znGraphRun[_agent_graph.GraphAgentState, _agent_graph.GraphAgentDeps[AgentDepsT, Any], FinalResult[OutputDataT]]Ú
_graph_runNF)Údefaultr]   Úinitú"AgentRunResult[OutputDataT] | NoneÚ_result_overridezBaseException | NoneÚ_node_errorzV_agent_graph.AgentNode[AgentDepsT, OutputDataT] | End[FinalResult[OutputDataT]] | NoneÚ_last_yielded_nodec               ó   • g ©Nr;   ©ÚselfÚrequireds     rC   Ú_traceparentÚAgentRun._traceparent»   ó   € ØGJrB   c                ó   • g ri   r;   ©rk   s    rC   rm   rn   ½   ó   € Ø#&rB   T©rl   c               ó|   • U R                   R                  SS9nUc
  [        5       nUc  U(       a  [        S5      eU$ )NFrs   ú&No span was created for this agent run)ra   rm   r)   ÚAttributeError)rk   rl   r:   s      rC   rm   rn   ¿   sC   € Ø—o‘o×2Ñ2¸EÐ2ÐBˆØÑô 3Ó4ˆKØÑ¦8Ü Ð!IÓJÐJØÐrB   c                óÄ   • [         [        R                  [        R                  [        [
        4   4   " U R                  R                  U R                  R                  S9$ )z%The current context of the agent run.)ÚstateÚdeps)	r   r!   ÚGraphAgentStateÚGraphAgentDepsr-   r   ra   rx   ry   rq   s    rC   ÚctxÚAgentRun.ctxÉ   sL   € ô œ|×;Ñ;¼\×=XÑ=XÔYcÔehÐYhÑ=iÐiÒjØ—/‘/×'Ñ'¨d¯o©o×.BÑ.Bñ
ð 	
rB   c                ó’   • U R                   R                  n[        U[        5      (       a  UR                  eU R                  U5      $ )z¤The next node that will be run in the agent graph.

This is the next node that will be used during async iteration, or if a node is not passed to `self.next(...)`.
)ra   Ú	next_taskrF   r   ÚerrorÚ_task_to_node)rk   Útasks     rC   Ú	next_nodeÚAgentRun.next_nodeÐ   s;   € ð �‰×(Ñ(ˆÜ�dœK×(Ñ(Ø—*‘*ÐØ×!Ñ! $Ó'Ð'rB   c           
     ó,  • U R                   b  U R                   $ U R                  R                  nUc  g[        UR                  UR                  U R                  R
                  U R                  R                  R                  U R                  SS95      $ )z×The final result of the run if it has ended, otherwise `None`.

Once the run returns an [`End`][pydantic_graph.basenode.End] node, `result` is populated
with an [`AgentRunResult`][pydantic_ai.agent.AgentRunResult].
NFrs   )	re   ra   r3   ÚAgentRunResultÚ	tool_namerx   ry   r5   rm   )rk   Úgraph_run_outputs     rC   ÚresultÚAgentRun.resultÝ   s…   € ð × Ñ Ñ,Ø×(Ñ(Ð(ØŸ?™?×1Ñ1ÐØÑ#ØÜØ×#Ñ#Ø×&Ñ&Ø�O‰O×!Ñ!Ø�O‰O× Ñ ×2Ñ2Ø×Ñ uÐÐ-ó
ð 	
rB   c                óB   • U R                   R                  R                  $ )zPReturn all messages for the run so far.

Messages from older runs are included.
)r|   rx   Úmessage_historyrq   s    rC   Úall_messagesÚAgentRun.all_messagesñ   s   € ð
 �x‰x�~‰~×-Ñ-Ð-rB   ©Úoutput_tool_return_contentc               ó\   • [         R                  R                  U R                  5       5      $ )z–Return all messages from [`all_messages`][pydantic_ai.agent.AgentRun.all_messages] as JSON bytes.

Returns:
    JSON bytes representing the messages.
©Ú	_messagesÚModelMessagesTypeAdapterÚ	dump_jsonr�   ©rk   r�   s     rC   Úall_messages_jsonÚAgentRun.all_messages_jsonø   ó$   € ô ×1Ñ1×;Ñ;¸D×<MÑ<MÓ<OÓPÐPrB   c                ód   • U R                  5       U R                  R                  R                  S $ )z‰Return the messages produced during this run so far.

Messages provided via `message_history` and messages from older runs are excluded.
N)r�   r|   ry   r5   rq   s    rC   Únew_messagesÚAgentRun.new_messages   s)   € ð
 × Ñ Ó" 4§8¡8§=¡=×#BÑ#BÐ#DÐEÐErB   c                ó\   • [         R                  R                  U R                  5       5      $ )zšReturn new messages from [`new_messages`][pydantic_ai.agent.AgentRun.new_messages] as JSON bytes.

Returns:
    JSON bytes representing the new messages.
©r“   r”   r•   r›   rq   s    rC   Únew_messages_jsonÚAgentRun.new_messages_json  r™   rB   c                ó   • U $ )z8Provide async-iteration over the nodes in the agent run.r;   rq   s    rC   Ú	__aiter__ÚAgentRun.__aiter__  s	   € ð ˆrB   c              ƒ  ób  #   • U R                   b  [        eU R                  n[        U[        5      (       a  [        eU R
                  R                  R                  R                  5         U R
                  R                  R                  R                  (       a  [        R                  " S5      I Sh  v•N   [        R                  " 5         Uc  U R                  nO-U R                  =o1La  UnO U R                  U5      I Sh  v•N nX l        U$  N^ N! [          a  nX@l        e SnAff = f7f)aM  Advance to the next node automatically based on the last returned node.

Yields each node before it runs, ending with the [`End`][pydantic_graph.basenode.End] node.
Advancing goes through [`next()`][pydantic_ai.run.AgentRun.next], so capability hooks fire
exactly as they do for [`agent.run()`][pydantic_ai.agent.AbstractAgent.run].
Nr   )re   ÚStopAsyncIterationrg   rF   r   r|   ry   ÚcancellationÚbindÚcancel_requestedÚasyncioÚsleepr"   Úraise_if_cancellingrƒ   ÚnextÚBaseExceptionrf   )rk   ÚpreviousÚnodeÚcurrentÚexcs        rC   Ú	__anext__ÚAgentRun.__anext__  sö   é € ð × Ñ Ñ,Ü$Ð$à×*Ñ*ˆÜ�h¤×$Ñ$ô %Ð$à�‰�‰×"Ñ"×'Ñ'Ô)Ø�8‰8�=‰=×%Ñ%×6×6ô —-’- Ó"×"Ð"Ü×"Ò"Ô$àÑð —>‘>‰DØŸ™Ð'ˆgÒ8ð ‰DðØ!ŸY™Y xÓ0×0�ð
 #'ÔØˆñ) #ñ 1øÜ ó Ø#&Ô ØûðüsH   ‚B1D/Â3DÂ4<D/Ã1D ÄDÄD Ä
	D/ÄD Ä
D,Ä D'Ä'D,Ä,D/c                óf  • [        U[        5      (       aZ  [        U5      S:X  aK  US   n[        UR                  [        5      (       a'  UR                  n[
        R                  " US9(       a  U$ [        U[        5      (       a  [        UR                  5      $ [        R                  " SU 35      e)Nr    r   ©r¯   zUnexpected node: )rF   r   ÚlenÚinputsr   r!   Úis_agent_noder   r   rL   r#   ÚAgentRunError)rk   r‚   Ú
first_taskÚ	base_nodes       rC   r�   ÚAgentRun._task_to_nodeF  s‘   € ô �dœH×%Ñ%¬#¨d«)°q«.Ø˜a™ˆJÜ˜*×+Ñ+¬X×6Ñ6ð
 ×%Ñ%ð	 ô
  ×-Ò-°9×=Ø$Ð$Ü�dœI×&Ñ&Ü�t—z‘z“?Ð"Ü×&Ò&Ð):¸4¸&Ð'AÓBÐBrB   c                óP   • [        [        [        U5      5      R                  USS9$ )Nr;   )r·   Ú
fork_stack)r   r   ÚtypeÚid©rk   r¯   s     rC   Ú_node_to_taskÚAgentRun._node_to_taskW  s!   € Ü¤¬¨d«Ó 4× 7Ñ 7ÀÐQSÑTÐTrB   c                óâ   • [        U[        5      (       a/  U R                  R                  [	        UR
                  5      5        gU R                  R                  U R                  U5      /5        g)u6  Synchronize the graph runner's state to match a hook-modified result.

After a capability hook changes the result (e.g. `on_node_run_error` recovering,
or `after_node_run` converting Endâ†”node), the graph runner's internal `_next` must
be updated so that `output` and `next_node` reflect the hook's decision.
N)rF   r   ra   Úoverride_nextr   rW   rÂ   )rk   r‰   s     rC   Ú_sync_graph_stateÚAgentRun._sync_graph_stateZ  sL   € ô �fœc×"Ñ"Ø�O‰O×)Ñ)¬)°F·K±KÓ*@ÕAà�O‰O×)Ñ)¨4×+=Ñ+=¸fÓ+EÐ*FÕGrB   c                óþ   • U R                   R                  n[        U[        5      (       aR  [	        U5      S:X  aC  US   R
                  n[        U[        5      (       a  Un[        R                  " U5      (       a  U$ g)zìThe node the graph runner is pending on, or `None` if it isn't pointing at one.

Unlike `next_node` and `_task_to_node`, this never raises: an `ErrorMarker`, an `EndMarker`
or a shape it doesn't recognise all read as "no pending node".
r    r   N)	ra   r   rF   r   r¶   r·   r   r!   r¸   )rk   r‚   r¯   r»   s       rC   Ú_graph_pending_nodeÚAgentRun._graph_pending_nodef  sj   € ð �‰×(Ñ(ˆÜ�dœH×%Ñ%¬#¨d«)°q«.Ø˜‘7—>‘>ˆDÜ˜$¤×)Ñ)ð
 ð	 ô
  ×-Ò-¨i×8Ñ8Ø$Ð$ØrB   c                óÚ   • [        U[        5      (       aE  U R                  R                  n[        U[        5      =(       a    UR
                  UR                  L $ U R                  5       UL $ )aU  Whether the graph runner's own state already records `result` as the step's outcome.

False whenever the two have diverged, whatever the cause: the graph is still pending on the
node a hook short-circuited past, or holds an `ErrorMarker` for an error a hook handled, or
advanced to the handler's node while the hook returned something else.
)rF   r   ra   r   r   rL   rW   rÉ   )rk   r‰   r‚   s      rC   Ú_graph_reflectsÚAgentRun._graph_reflectsy  sS   € ô �fœc×"Ñ"Ø—?‘?×,Ñ,ˆDÜ˜d¤IÓ.×L°4·:±:ÀÇÁÐ3LÐLØ×'Ñ'Ó)¨VÐ3Ð3rB   c              ƒ  ó¼   #   • U R                  U5      /n U R                  R                  U5      I Sh  v•N nU R	                  U5      $  N! [         a     Nf = f7f)z<Execute a single graph step without firing capability hooks.N)rÂ   ra   r¬   r¥   r�   )rk   r¯   r‚   s      rC   Ú_advance_graphÚAgentRun._advance_graph…  s_   é € ð
 ×"Ñ" 4Ó(Ð)ˆð	ØŸ™×-Ñ-¨dÓ3×3ˆDð ×!Ñ! $Ó'Ð'ñ 4øÜ!ó 	Ùð	üs7   ‚A–A ´A
µA ¹AÁ
A Á
AÁAÁAÁAc              ƒ  óè  #   • U R                   R                  R                  R                  5         U R                   R                  R                  n UR
                  (       a  UR                  XUS9I Sh  v•N nOU" U5      I Sh  v•N nU R                  U5      (       d  U R                  U5        [        R                  " 5         UnUR                  XUS9I Sh  v•N n[        X5      nXWLa  U R                  U5        [        R                  " 5         U$  N¢ N“! [         aF  nUR                  (       d  e UR                  XUS9I Sh  v•N  nU R                  U5         SnANµSnAff = f N’7f)u%  Execute `wrap_node_run(step_fn)` â†’ `on_node_run_error` â†’ `after_node_run`.

This is the portion of the hook lifecycle after `before_node_run` has already fired.
Used by both `_run_node_with_hooks` and directly by `run_stream()` which calls
`before_node_run` separately (before streaming).
)r¯   ÚhandlerN)r¯   r€   )r¯   r‰   )r|   ry   r¦   r§   Úroot_capabilityÚ_has_wrap_node_runÚwrap_node_runrÌ   rÆ   Ú	ExceptionÚ_has_on_node_run_errorÚon_node_run_errorr"   r«   Úafter_node_runr+   )rk   Úrun_contextr¯   Ústep_fnÚcapr‰   ÚeÚpre_hook_results           rC   Ú_wrap_and_advanceÚAgentRun._wrap_and_advance‘  s=  é € ð 	�‰�‰×"Ñ"×'Ñ'Ô)Ø�h‰h�m‰m×+Ñ+ˆð	/Ø×%×%Ø"×0Ñ0°ÐQXÐ0ÐY×Y‘á& t›}×,�ð ×'Ñ'¨×/Ñ/Ø×&Ñ& vÔ.ô 	×"Ò"Ô$Ø ˆØ×)Ñ)¨+ÈÐ)ÐP×PˆÜ.¨{ÓCˆð Ò(Ø×"Ñ" 6Ô*ä×"Ò"Ô$Øˆñ= Zá,øÜó 	+Ø×-×-ØØ×0Ñ0°ÈqÐ0ÐQ×QÐQˆFð ×"Ñ" 6×*Ñ*ûð	+úñ$ Qùsm   ‚AE2Á$D Á6DÁ7D ÂDÂD ÂAE2ÃE0Ã;E2ÄD ÄD Ä
E-Ä'%E(ÅEÅE(Å#E2Å(E-Å-E2c              ƒ  óz  #   • U R                   R                  R                  R                  5         [        R
                  " U R                   5      nU R                   R                  R                  nUR                  X1S9I Sh  v•N n[        R                  " 5         U R                  X1U5      I Sh  v•N $  N3 N7f)uò   Run a node through the full capability hook lifecycle with a custom step function.

Fires hooks in order: `before_node_run` â†’ `wrap_node_run(step_fn)` â†’ `after_node_run`,
with `on_node_run_error` handling exceptions from `wrap_node_run`.
rµ   N)r|   ry   r¦   r§   r!   Úbuild_run_contextrÓ   Úbefore_node_runr"   r«   rß   )rk   r¯   rÛ   rÚ   rÜ   s        rC   Ú_run_node_with_hooksÚAgentRun._run_node_with_hooksÄ  sŽ   é € ð" 	�‰�‰×"Ñ"×'Ñ'Ô)Ü"×4Ò4°T·X±XÓ>ˆØ�h‰h�m‰m×+Ñ+ˆØ×(Ñ(¨Ð(Ð@×@ˆô 	×"Ò"Ô$Ø×+Ñ+¨K¸wÓG×GÐGñ	 Añ Hùs$   ‚BB;ÂB7Â.B;Â2B9Â3B;Â9B;c              ƒ  óT   #   • U R                  XR                  5      I Sh  v•N $  N7f)a¿	  Manually drive the agent run by passing in the node you want to run next.

This lets you inspect or mutate the node before continuing execution, or skip certain nodes
under dynamic conditions. The agent run should be stopped when you return an [`End`][pydantic_graph.basenode.End]
node.

Example:
```python
from pydantic_ai import Agent
from pydantic_graph import End

agent = Agent('openai:gpt-5.2')

async def main():
    async with agent.iter('What is the capital of France?') as agent_run:
        next_node = agent_run.next_node  # start with the first node
        nodes = [next_node]
        while not isinstance(next_node, End):
            next_node = await agent_run.next(next_node)
            nodes.append(next_node)
        # Once `next_node` is an End, we've finished:
        print(nodes)
        '''
        [
            UserPromptNode(
                user_prompt='What is the capital of France?',
                instructions_functions=[],
                system_prompts=(),
                system_prompt_functions=[],
                system_prompt_dynamic_functions={},
            ),
            ModelRequestNode(
                request=ModelRequest(
                    parts=[
                        UserPromptPart(
                            content='What is the capital of France?',
                            timestamp=datetime.datetime(...),
                        )
                    ],
                    timestamp=datetime.datetime(...),
                    run_id='...',
                    conversation_id='...',
                )
            ),
            CallToolsNode(
                model_response=ModelResponse(
                    parts=[TextPart(content='The capital of France is Paris.')],
                    usage=RequestUsage(
                        cost=Decimal('0.000196'), input_tokens=56, output_tokens=7
                    ),
                    model_name='gpt-5.2',
                    timestamp=datetime.datetime(...),
                    run_id='...',
                    conversation_id='...',
                )
            ),
            End(data=FinalResult(output='The capital of France is Paris.')),
        ]
        '''
        print('Final result:', agent_run.result.output)
        #> Final result: The capital of France is Paris.
```

Args:
    node: The node to run next in the graph.

Returns:
    The next node returned by the graph logic, or an [`End`][pydantic_graph.basenode.End] node if
    the run has completed.
N)rä   Ú_stream_and_advancerÁ   s     rC   r¬   ÚAgentRun.nextÞ  s%   é € ðX ×.Ñ.¨t×5MÑ5MÓN×NÐNÑNùs   ‚(¡&¢(c              ƒ  óP  #   • U R                   R                  R                  R                  (       d/  U R                   R                  R                  R                  (       a(  [
        R                  " XR                   5      I Sh  v•N   U R                  U5      I Sh  v•N $  N N7f)a[  Execute a single graph step, streaming the node first if capabilities need its events.

A capability that overrides `wrap_run_event_stream` only sees events if the node is
streamed, so streaming is enabled for it here the same way `agent.run()` enables it.
`node.stream()` applies the capability chain itself, so draining it is all that's needed.
N)r|   ry   rÓ   Úhas_wrap_run_event_streamÚhas_on_eventr!   Údrain_node_event_streamrÏ   rÁ   s     rC   rç   ÚAgentRun._stream_and_advance,  si   é € ð �8‰8�=‰=×(Ñ(×B×BÀdÇhÁhÇmÁm×FcÑFc×Fp×FpÜ×6Ò6°t¿X¹XÓF×FÐFØ×(Ñ(¨Ó.×.Ð.ñ GÙ.ùs$   ‚BB&ÂB"ÂB&ÂB$ÂB&Â$B&c                óB   • U R                   R                  R                  $ )zZGet usage statistics for the run so far, including token usage, model requests, and so on.)ra   rx   r%   rq   s    rC   r%   ÚAgentRun.usage:  s   € ð �‰×$Ñ$×*Ñ*Ð*rB   c                óB   • U R                   R                  R                  $ ©z7Metadata associated with this agent run, if configured.)ra   rx   r9   rq   s    rC   r9   ÚAgentRun.metadata?  s   € ð �‰×$Ñ$×-Ñ-Ð-rB   c                óB   • U R                   R                  R                  $ ©z(The unique identifier for the agent run.)ra   rx   r7   rq   s    rC   r7   ÚAgentRun.run_idD  s   € ð �‰×$Ñ$×+Ñ+Ð+rB   c                óB   • U R                   R                  R                  $ ©z?The unique identifier for the conversation this run belongs to.)ra   rx   r8   rq   s    rC   r8   ÚAgentRun.conversation_idI  s   € ð �‰×$Ñ$×4Ñ4Ð4rB   c                óB   • U R                   R                  R                  $ )zÛInternal: live view of the queue mutated by `enqueue` and drained by the internal `PendingMessageDrainCapability`.

Exposed for inspection / debugging; use [`enqueue`][pydantic_ai.run.AgentRun.enqueue] to add messages.
)ra   rx   Úpending_messagesrq   s    rC   rú   ÚAgentRun.pending_messagesN  s   € ð �‰×$Ñ$×5Ñ5Ð5rB   c             ƒ  ó  #   • U R                   b  [        R                  " S5      e[        U[        R
                  5      (       a  [        R                  " S5      eU R                  R                  R                  R                  U5        U$ 7f)a  Emit a [`CustomEvent`][pydantic_ai.messages.CustomEvent] into this run's event stream.

Lets code driving [`Agent.iter`][pydantic_ai.agent.AbstractAgent.iter] inject application-defined
events (e.g. from an external harness or event bus) into the stream, alongside events emitted from
tools via [`RunContext.emit`][pydantic_ai.tools.RunContext.emit].
The event surfaces on the next pull from the run's node stream.

Designed to be called from the same event loop driving `agent.iter()`. If you're forwarding events
from a different thread, submit the coroutine to the agent's loop
(e.g. `asyncio.run_coroutine_threadsafe(agent_run.emit(event), loop)`).

Args:
    event: The [`CustomEvent`][pydantic_ai.messages.CustomEvent] to emit.

Returns:
    The event as emitted.

Raises:
    UserError: If the run has already ended (no stream remains to deliver the event), or if
        passed a [`CapabilityEvent`][pydantic_ai.messages.CapabilityEvent]: those belong
        to capabilities, and code driving the run is application code.
zV`emit` cannot be called after the run has ended: nothing remains to deliver the event.zØCapability events belong to capabilities and can only be emitted from a capability hook or capability-contributed tool. Application code should emit a `CustomEvent`; it can re-emit a received capability event as one.)
r‰   r#   Ú	UserErrorrF   r“   ÚCapabilityEventra   rx   Úevent_stream_bufferÚappend)rk   Úevents     rC   ÚemitÚAgentRun.emitV  sy   é € ð. �;‰;Ñ"Ü×&Ò&Øhóð ô �eœY×6Ñ6×7Ñ7Ü×&Ò&ð4óð ð
 	�‰×Ñ×1Ñ1×8Ñ8¸Ô?Øˆùs   ‚B
BÚasap)Úpriorityc               ó¬   • [         R                  " USU06nUc  gU R                  R                  R                  R                  U5        UR                  $ )uZ  Enqueue content to be injected into the conversation.

Safe to call directly from synchronous or asynchronous code, including
a callback running in another thread.

Args:
    *content: One or more [`EnqueueContent`][pydantic_ai.run.EnqueueContent] items.
        Adjacent [`UserContent`][pydantic_ai.messages.UserContent] (a `str` or multi-modal
        content like an [`ImageUrl`][pydantic_ai.messages.ImageUrl]) is gathered into one
        [`UserPromptPart`][pydantic_ai.messages.UserPromptPart], and each
        [`ModelRequestPart`][pydantic_ai.messages.ModelRequestPart] (e.g. a
        [`SystemPromptPart`][pydantic_ai.messages.SystemPromptPart]) is coalesced with adjacent
        part-style items into one [`ModelRequest`][pydantic_ai.messages.ModelRequest]; a complete
        [`ModelRequest`][pydantic_ai.messages.ModelRequest] or
        [`ModelResponse`][pydantic_ai.messages.ModelResponse] is kept as its own message. The
        assembled sequence must end in a request. Calling with no positional args is a no-op.
    priority: When to deliver:
        `'asap'` (default) â€” at the earliest opportunity (next model request,
            or a redirect if the agent would otherwise end).
        `'when_idle'` â€” only when the agent would otherwise end, after `'asap'` messages.

Returns:
    The `enqueue_id` of the queued message, echoed on the
    [`EnqueuedMessagesEvent`][pydantic_ai.messages.EnqueuedMessagesEvent] emitted when it's
    delivered, or `None` when there was nothing to enqueue (an empty call).

Raises:
    UserError: If the run has ended, since there'd be nowhere to deliver the message.
r  N)r'   Úfrom_contentra   rx   rú   r   Ú
enqueue_id)rk   r  ÚcontentÚpendings       rC   ÚenqueueÚAgentRun.enqueuez  sL   € ôD !×-Ò-¨wÐJÀÑJˆØ‰?ØØ�‰×Ñ×.Ñ.×5Ñ5°gÔ>Ø×!Ñ!Ð!rB   c                ó`   • U R                   R                  R                  R                  5         g)u  Cancel the whole agent run.

The run stops what it is doing â€” the in-flight model request is torn down, in-flight tool
tasks are cancelled and drained, a suspended server-side job is best-effort cancelled â€” and
the code driving the run sees `asyncio.CancelledError`. When the `agent.iter()` context
exits, this becomes [`RunCancelled`][pydantic_ai.exceptions.RunCancelled] (including for
`agent.run()`, which wraps `iter()`). Everything that completed before the cancellation took
effect is preserved in message history.
[`RunCancelled.all_messages()`][pydantic_ai.exceptions.RunCancelled.all_messages] returns a
complete snapshot that can be passed to a new run as `message_history` to resume the
conversation.

Cancellation is terminal: capability hooks (`wrap_run`, `wrap_node_run`, `on_run_error`)
may observe it and clean up, but cannot recover the run into a successful result.

Unlike [`StreamedRunResult.cancel()`][pydantic_ai.result.StreamedRunResult.cancel], which
only stops the current model response and lets the run continue, this ends the run itself.

Safe to call from another task or thread (e.g. a TUI's key handler while the run is
awaited elsewhere). Idempotent; a no-op once the run has finished â€” where "finished" means
the `agent.iter()`/`agent.run()` context has exited. A `cancel()` issued inside the context
after the run has already produced its result (e.g. after iterating to `End`) is still
honored and surfaces as `RunCancelled` on exit, so that a hook running at context exit (like
`after_run`) can still cancel the run; only after the context has exited is `cancel()` a true
no-op. Externally cancelling the task running the agent (`asyncio.Task.cancel()`) remains
supported and keeps raising `asyncio.CancelledError` instead; when both happen, the external
cancellation wins.
N)r|   ry   r¦   Úcancelrq   s    rC   r  ÚAgentRun.cancel¢  s   € ð: 	�‰�‰×"Ñ"×)Ñ)Õ+rB   c                ó´   • U R                   R                  nUc  SO[        UR                  5      nS[        U 5      R                   SU SU R
                   S3$ )Nz<run not finished>Ú<z result=z usage=Ú>)ra   r3   r]   r¿   r<   r%   )rk   r‰   Úresult_reprs      rC   Ú__repr__ÚAgentRun.__repr__Á  sP   € Ø—‘×'Ñ'ˆØ.4©nÑ*Ä$ÀvÇ}Á}ÓBUˆØ”4˜“:×&Ñ&Ð' x°¨}¸GÀDÇJÁJÀ<ÈqÐQÐQrB   )rg   rf   ©rl   zLiteral[False]Úreturnú
str | None©r  rI   ©rl   Úboolr  r  )r  z[GraphRunContext[_agent_graph.GraphAgentState, _agent_graph.GraphAgentDeps[AgentDepsT, Any]])r  úO_agent_graph.AgentNode[AgentDepsT, OutputDataT] | End[FinalResult[OutputDataT]])r  rd   )r  r4   ©r�   r  r  rJ   )r  rJ   )r  z^AsyncIterator[_agent_graph.AgentNode[AgentDepsT, OutputDataT] | End[FinalResult[OutputDataT]]])r‚   zKEndMarker[FinalResult[OutputDataT]] | JoinItem | Sequence[GraphTaskRequest]r  r  )r¯   ú/_agent_graph.AgentNode[AgentDepsT, OutputDataT]r  r   )r‰   ú?_agent_graph.AgentNode[AgentDepsT, Any] | End[FinalResult[Any]]r  ÚNone)r  z._agent_graph.AgentNode[AgentDepsT, Any] | None)r‰   r  r  r  )r¯   ú'_agent_graph.AgentNode[AgentDepsT, Any]r  r  )rÚ   zRunContext[AgentDepsT]r¯   r!  rÛ   úCallable[[_agent_graph.AgentNode[AgentDepsT, Any]], Awaitable[_agent_graph.AgentNode[AgentDepsT, Any] | End[FinalResult[Any]]]]r  r  )r¯   r!  rÛ   r"  r  r  )r¯   r  r  r  ©r  z_usage.RunUsage©r  zdict[str, Any] | None)r  zlist[PendingMessage])r  r*   r  r*   )r	  r&   r  r(   r  r  )r  r   )+r<   r=   r>   r?   Ú__doc__r@   ÚdataclassesÚfieldre   rf   rg   r   rm   Úpropertyr|   rƒ   r‰   r�   r—   r›   rŸ   r¢   r²   r�   rÂ   rÆ   rÉ   rÌ   rÏ   rß   rä   r¬   rç   r%   r9   r7   r8   rú   r  r  r  r  rA   r;   rB   rC   r_   r_   l   s„  ‡ ñ@ðDó ð <G×;LÒ;LÐUYÐ`eÐlqÑ;rÐÐ8ÓrØ(3×(9Ò(9À$ÈUÐY^Ñ(_€KÐ%Ó_Øoà×Ò $¨U¸Ñ?ð Ðnó ð YàÛJó ØJØÛ&ó Ø&Ø/3÷ ð ó
ó ð
ð ð
(à	Xó
(ó ð
(ð ó
ó ð
ô&.ð MQ÷ QôFôQðà	gôð/à	Xô/ðbCØ_ðCà	XôCô"Uô
Hôô&
4ð
(à5ð
(ð 
Iô
(ð1à+ð1ð 6ð1ð
ð	1ð 
Iô1ðfHà5ðHð
ðHð 
IôHð4LOà=ðLOð 
YôLOð\/à5ð/ð 
Iô/ð ó+ó ð+ð ó.ó ð.ð ó,ó ð,ð ó5ó ð5ð ó6ó ð6ô"ðN ,2ñ&"à ð&"ð )ð&"ð 
õ	&"ôP,÷>RrB   r_   c                  ó8  • \ rS rSr% SrS\S'    \R                  " SSSS9rS\S	'   \R                  " SS\	R                  S
9rS\S'   \R                  " SSSS9rS\S'   \R                  " SSSS9rS\S'   \" SS9\S(S j5       5       r\" SS9S)S j5       r\S*S j5       r\S+S j5       rSS.S,S jjrS-S jrSS.S.S jjrSS.S/S jjrSS.S.S jjrSS.S/S  jjr\S0S! j5       r\S1S" j5       r\S2S# j5       r\S3S$ j5       r\S+S% j5       r\S+S& j5       r S'r!g)4r†   iÇ  z!The final result of an agent run.r,   r3   FN)r]   Úcomparerb   r  Ú_output_tool_name)r]   r*  Údefault_factoryz_agent_graph.GraphAgentStateÚ_stater   ÚintÚ_new_message_indexÚ_traceparent_valueÚbefore)Úmodec                óÐ  • [        U[        5      (       d  U$ [        SU5      n[        UR                  S5      =n[        5      (       a©  [        SU5      nUR                  SS5      UR                  S5      UR                  S5      S.nSU;   a  US   US	'   [         H  nXd;   d  M
  XF   XV'   M     0 UEUR                  5        VVs0 s H  u  pgUR                  S
5      (       a  M  Xg_M!     snnEn0 nS	U;   a  US	   US'   [         H  nXb;   d  M
  X&   X†'   M     UR                  S5      UUR                  SS5      UR                  S5      S.n	SU;   a  US   U	S'   U	$ s  snnf )zìAccept the public serialized shape, and the private one older versions produced.

Returns the private field names the dataclass schema validates, so `messages`, `usage`,
`run_id`, `conversation_id` and `metadata` land back on `_state`.
údict[str, Any]r-  r/  r   r+  r0  )r5   r6   r:   rŒ   r$   Ú_r6   r5   r:   )r+  r-  r/  r0  r3   )rF   rV   r   ÚgetÚ_STATE_KEYSrH   Ú
startswith)
ÚclsrL   rW   Úlegacy_staterx   ÚrestoredrO   rP   Ú
state_dataÚ	validateds
             rC   Ú_validate_serializedÚ#AgentRunResult._validate_serializedÕ  sx  € ô ˜%¤×&Ñ&ØˆLÜÐ$ eÓ,ˆä d§h¡h¨xÓ&8Ð8�l¼$×?Ñ?ô Ð)¨<Ó8ˆEà%)§X¡XÐ.BÀAÓ%FØ$(§H¡HÐ-@Ó$AØ#Ÿx™xÐ(<Ó=ñ(ˆHð
 ! EÓ)Ø',Ð->Ñ'?�˜Ñ$ß"�Ø•<Ø$)¡J�H“Mñ #ð h�hÐg¸d¿j¹j¼lÔ"fºl±°ÐRU×R`ÑR`Ðad×Re£9 3¢9¹lÒ"fÐgˆDà%'ˆ
Ø˜ÓØ,0°Ñ,<ˆJÐ(Ñ)ßˆCØ�{Ø"&¡)�
“ñ ð
 "&§¡Ð*<Ó!=Ø Ø"&§(¡(Ð+>ÀÓ"BØ"&§(¡(¨=Ó"9ñ	%
ˆ	ð �tÓà"& x¡.ˆI�hÑØÐùó% #gs   ÃE"Ã(E"Úwrapc           	     ó¨  • [        SU" [        U R                  S95      5      nU R                  R                  U R
                  U R                  U R                  R                  U R                  R                  U R                  R                  U R                  R                  U R                  S.nSU;   a  US   US'   [        S[        XB5      5      $ )Nr4  )r3   )r$   r5   r6   r%   r7   r8   r9   r:   r3   ú_AgentRunResultData[Any])r   r†   r3   r-  rŒ   r/  r+  r%   r7   r8   r9   r0  r\   )rk   rÒ   rX   Ú
serializedrW   s        rC   Ú
_serializeÚAgentRunResult._serialize  s°   € ô Ð*©G´NÈ$Ï+É+Ñ4VÓ,WÓXˆ
àŸ™×3Ñ3Ø!%×!8Ñ!8Ø $× 6Ñ 6Ø—[‘[×&Ñ&Ø—k‘k×(Ñ(Ø#Ÿ{™{×:Ñ:ØŸ™×,Ñ,Ø×2Ñ2ñ	*
ˆð �zÓ!ð (¨Ñ1ˆD�‰NÜÐ.Ô0BÀ4Ó0NÓOÐOrB   c               ó   • g ri   r;   rj   s     rC   rm   ÚAgentRunResult._traceparent  ro   rB   c                ó   • g ri   r;   rq   s    rC   rm   rG    rr   rB   Trs   c               óX   • U R                   c  U(       a  [        S5      eU R                   $ )Nru   )r0  rv   rj   s     rC   rm   rG  !  s(   € Ø×"Ñ"Ñ*®xÜ Ð!IÓJÐJØ×&Ñ&Ð&rB   c                ó¸  • U R                   (       d  [        S5      eU R                  R                  nUS   n[	        UR
                  5       Hq  u  pE[        U[        R                  5      (       d  M&  UR                  U R                   :X  d  MB  [        U5      n[        U5      nXR
                  U   l        XvS'   Us  $    [        SU R                   < S35      e)z�Set return content for the output tool.

Useful if you want to continue the conversation and want to set the response to the output tool call.
zDCannot set output tool return content when the return type is `str`.éÿÿÿÿz"No tool call found with tool name Ú.)r+  Ú
ValueErrorr-  rŒ   rK   ÚpartsrF   r“   ÚToolReturnPartr‡   Úlistr	   r	  ÚLookupError)rk   Úreturn_contentr$   Úlast_messageÚidxÚpartÚcopied_messagesÚcopied_lasts           rC   Ú_set_output_tool_returnÚ&AgentRunResult._set_output_tool_return&  s¾   € ð
 ×%×%ÜÐcÓdÐdà—;‘;×.Ñ.ˆØ ‘|ˆÜ" <×#5Ñ#5Ö6‰IˆCÜ˜$¤	× 8Ñ 8×9Ó9¸d¿n¹nÐPT×PfÑPfÕ>fä"& x£.�Ü& |Ó4�Ø1?×!Ñ! #Ñ&Ô.Ø&1 Ñ#Ø&Ò&ñ 7ô Ð>¸t×?UÑ?UÑ>XÐXYÐZÓ[Ð[rB   r�   c               óV   • Ub  U R                  U5      $ U R                  R                  $ )až  Return the history of _messages.

Args:
    output_tool_return_content: The return content of the tool call to set in the last message.
        This provides a convenient way to modify the content of the output tool call if you want to continue
        the conversation and want to set the response to the output tool call. If `None`, the last message will
        not be modified.

Returns:
    List of messages.
)rX  r-  rŒ   r–   s     rC   r�   ÚAgentRunResult.all_messages;  s,   € ð &Ñ1Ø×/Ñ/Ð0JÓKÐKà—;‘;×.Ñ.Ð.rB   c               óZ   • [         R                  R                  U R                  US95      $ )aù  Return all messages from [`all_messages`][pydantic_ai.agent.AgentRunResult.all_messages] as JSON bytes.

Args:
    output_tool_return_content: The return content of the tool call to set in the last message.
        This provides a convenient way to modify the content of the output tool call if you want to continue
        the conversation and want to set the response to the output tool call. If `None`, the last message will
        not be modified.

Returns:
    JSON bytes representing the messages.
r�   r’   r–   s     rC   r—   Ú AgentRunResult.all_messages_jsonL  ó/   € ô ×1Ñ1×;Ñ;Ø×ÑÐ9SÐÐTó
ð 	
rB   c               ó:   • U R                  US9U R                  S $ )a  Return the messages produced during this run.

Messages provided via `message_history` and messages from older runs are excluded.

Args:
    output_tool_return_content: The return content of the tool call to set in the last message.
        This provides a convenient way to modify the content of the output tool call if you want to continue
        the conversation and want to set the response to the output tool call. If `None`, the last message will
        not be modified.

Returns:
    List of new messages.
r�   N)r�   r/  r–   s     rC   r›   ÚAgentRunResult.new_messages\  s(   € ð × Ñ Ð<VÐ ÐWÐX\×XoÑXoÐXqÐrÐrrB   c               óZ   • [         R                  R                  U R                  US95      $ )aý  Return new messages from [`new_messages`][pydantic_ai.agent.AgentRunResult.new_messages] as JSON bytes.

Args:
    output_tool_return_content: The return content of the tool call to set in the last message.
        This provides a convenient way to modify the content of the output tool call if you want to continue
        the conversation and want to set the response to the output tool call. If `None`, the last message will
        not be modified.

Returns:
    JSON bytes representing the new messages.
r�   rž   r–   s     rC   rŸ   Ú AgentRunResult.new_messages_jsonl  r^  rB   c                óž   • [        U R                  5       5       H&  n[        U[        R                  5      (       d  M$  Us  $    [        S5      e)z2Return the last response from the message history.z(No response found in the message history)Úreversedr�   rF   r“   ÚModelResponserM  )rk   Úmessages     rC   ÚresponseÚAgentRunResult.response|  sB   € ô   × 1Ñ 1Ó 3Ö4ˆGÜ˜'¤9×#:Ñ#:×;Ó;Ø’ñ 5ô ÐCÓDÐDrB   c                ó.   • U R                   R                  $ )z"Return the usage of the whole run.)r-  r%   rq   s    rC   r%   ÚAgentRunResult.usage…  s   € ð �{‰{× Ñ Ð rB   c                ó.   • U R                   R                  $ )z&Return the timestamp of last response.)rg  Ú	timestamprq   s    rC   rl  ÚAgentRunResult.timestampŠ  s   € ð �}‰}×&Ñ&Ð&rB   c                ó.   • U R                   R                  $ rñ   )r-  r9   rq   s    rC   r9   ÚAgentRunResult.metadata�  s   € ð �{‰{×#Ñ#Ð#rB   c                ó.   • U R                   R                  $ rô   )r-  r7   rq   s    rC   r7   ÚAgentRunResult.run_id”  s   € ð �{‰{×!Ñ!Ð!rB   c                ó.   • U R                   R                  $ r÷   )r-  r8   rq   s    rC   r8   ÚAgentRunResult.conversation_id™  s   € ð �{‰{×*Ñ*Ð*rB   r;   )rL   r   r  r   )rÒ   r   rX   r   r  rB  r  r  r  )rR  rI   r  r4   )r�   r  r  r4   r  )r  z_messages.ModelResponser#  )r  r
   r$  )"r<   r=   r>   r?   r%  r@   r&  r'  r+  r!   rz   r-  r/  r0  r   Úclassmethodr>  r   rD  r   rm   rX  r�   r—   r›   rŸ   r(  rg  r%   rl  r9   r7   r8   rA   r;   rB   rC   r†   r†   Ç  s˜  ‡ á+àÓØ-à$/×$5Ò$5¸5È%ÐY]Ñ$^Ð�zÓ^Ø+6×+<Ò+<Ø˜E°<×3OÑ3Oñ,€FÐ(ó ð *×/Ò/°UÀEÐSTÑUÐ˜ÓUØ%0×%6Ò%6¸EÈ5ÐZ^Ñ%_Ð˜
Ó_á˜(Ñ#Øó+ó ó $ð+ñZ ˜6Ñ"óPó #ðPð0 ÛJó ØJØÛ&ó Ø&Ø/3÷ 'ô
\ð* HL÷ /ð" MQ÷ 
ð  HL÷ sð  MQ÷ 
ð  óEó ðEð ó!ó ð!ð ó'ó ð'ð ó$ó ð$ð ó"ó ð"ð ó+ó ó+rB   r†   c                  óX   • \ rS rSr% SrS\S'    S\S'   SrS\S	'    \R                  r	S
r
g)ÚAgentRunResultEventiŸ  zYAn event indicating the agent run ended and containing the final result of the agent run.zAgentRunResult[OutputDataT]r‰   zdataclasses.KW_ONLYr5  Úagent_run_resultzLiteral['agent_run_result']Ú
event_kindr;   N)r<   r=   r>   r?   r%  r@   rx  r"   Údataclasses_no_defaults_reprr  rA   r;   rB   rC   rv  rv  Ÿ  s-   ‡ ácà'Ó'Ø àÓà.@€JÐ+Ó@Ø9à×2Ñ2ƒHrB   rv  )rL   r   rM   r   rN   r  r  r   )rW   zMapping[str, Any]rX   r   r  r4  )JÚ
__future__r   Ú_annotationsr©   r&  Úcollections.abcr   r   r   r   r   Úcopyr	   r
   Útypingr   r   r   r   r   r   Úpydanticr   r   Úpydantic_core.core_schemar   r   Útyping_extensionsr   r   Úpydantic_graphr   r   r   r   r   r   r   r   Úpydantic_graph.stepr   Ú r!   r"   r#   r$   r“   r%   Ú_usageÚ_enqueuer&   r'   r(   Ú_instrumentationr)   Ú_run_contextr*   Úcapabilities._pending_messagesr+   r3   r,   Útoolsr-   r.   r‰   r/   r1   r7  rR   r\   Ú	dataclassr_   r†   rv  r;   rB   rC   Ú<module>rŒ     s  ðÝ 2ã Û ß QÕ QÝ Ý ß G× Gç 6ß Vß 4ç w× wÓ wÝ (÷õ ÷ MÑ LÝ 6Ý &Ý IÝ Ý æÝ(Ý#ô	)˜) W¨[Ñ%9ô 	)ð A€Ø \ôô* ðF ×Ò˜EÑ"ôW	Rˆw�z ;Ð.Ñ/ó W	Ró #ðW	Rðt ×ÑôT+�W˜[Ñ)ó T+ó ðT+ðn ×Ò˜EÑ"ô3˜' +Ñ.ó 3ó #ñ3rB   