AgentResult#

class council.agents.AgentResult(messages: List[ScoredChatMessage] | None = None)[source]#

Bases: object

Represent the execution result of an Agent

__init__(messages: List[ScoredChatMessage] | None = None) None[source]#

Initialize a new instance.

Parameters:

messages (Optional[List[ScoredChatMessage]]) – an optional list of messages

property best_message: ChatMessage#

The message with the highest score. If multiple messages have the highest score, the first one is returned.

Return type:

ChatMessage

Raises:

ValueError – there is no messages

property messages: Sequence[ScoredChatMessage]#

An unordered list of messages, with their scores.

Return type:

Sequence[ScoredChatMessage]

property try_best_message: Option[ChatMessage]#

The message with the highest score, if any. See best_message() for more details

Returns:

the message with the highest score, wrapped into Option.some(), if some,

Option.none() otherwise

Return type:

Option[ChatMessage]