Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Results

When you call theRunner.run methods, you either get a:

Both of these inherit fromRunResultBase, which is where most useful information is present.

Final output

Thefinal_output property contains the final output of the last agent that ran. This is either:

  • astr, if the last agent didn't have anoutput_type defined
  • an object of typelast_agent.output_type, if the agent had an output type defined.

Note

final_output is of typeAny. We can't statically type this, because of handoffs. If handoffs occur, that means any Agent might be the last agent, so we don't statically know the set of possible output types.

Inputs for the next turn

You can useresult.to_input_list() to turn the result into an input list that concatenates the original input you provided, to the items generated during the agent run. This makes it convenient to take the outputs of one agent run and pass them into another run, or to run it in a loop and append new user inputs each time.

Last agent

Thelast_agent property contains the last agent that ran. Depending on your application, this is often useful for the next time the user inputs something. For example, if you have a frontline triage agent that hands off to a language-specific agent, you can store the last agent, and re-use it the next time the user messages the agent.

New items

Thenew_items property contains the new items generated during the run. The items areRunItems. A run item wraps the raw item generated by the LLM.

  • MessageOutputItem indicates a message from the LLM. The raw item is the message generated.
  • HandoffCallItem indicates that the LLM called the handoff tool. The raw item is the tool call item from the LLM.
  • HandoffOutputItem indicates that a handoff occurred. The raw item is the tool response to the handoff tool call. You can also access the source/target agents from the item.
  • ToolCallItem indicates that the LLM invoked a tool.
  • ToolCallOutputItem indicates that a tool was called. The raw item is the tool response. You can also access the tool output from the item.
  • ReasoningItem indicates a reasoning item from the LLM. The raw item is the reasoning generated.

Other information

Guardrail results

Theinput_guardrail_results andoutput_guardrail_results properties contain the results of the guardrails, if any. Guardrail results can sometimes contain useful information you want to log or store, so we make these available to you.

Raw responses

Theraw_responses property contains theModelResponses generated by the LLM.

Original input

Theinput property contains the original input you provided to therun method. In most cases you won't need this, but it's available in case you do.


[8]ページ先頭

©2009-2025 Movatter.jp