nip.code_validation.agents._ParsedChatCompletion#

class nip.code_validation.agents._ParsedChatCompletion(next_messages: OrderedDict[str, str] | None, raw_message: str, prompt: list[PromptMessage], decision: int, retry_count: int, warning: Literal['max_tokens', 'invalid_response'] | None)[source]#

A parsed chat completion output.

next_messages#

A dictionary mapping channel names to next messages, ordered by channel order. If the model has made a decision, this will be None.

Type:

OrderedDict[str, str] | None

raw_message#

The raw message generated by the model, before parsing.

Type:

str

prompt#

The prompt used to generate the message.

Type:

list[PromptMessage]

decision#

The decision made by the agent. This is either 0 (reject), 1 (accept) or 2 (no decision).

Type:

int

retry_count#

The number of retries before the generation was successful.

Type:

int

warning#

The warning message from the generation, if any. One of:

  • “max_tokens”: If the generation was stopped because the maximum number of tokens was reached.

  • “invalid_response”: If the generation could not be parsed.

Type:

Literal[“max_tokens”, “invalid_response”] | None

Methods Summary

__eq__(other)

Return self==value.

__init__(next_messages, raw_message, prompt, ...)

__repr__()

Return repr(self).

Attributes

Methods

__eq__(other)#

Return self==value.

__init__(next_messages: OrderedDict[str, str] | None, raw_message: str, prompt: list[PromptMessage], decision: int, retry_count: int, warning: Literal['max_tokens', 'invalid_response'] | None) None#
__repr__()#

Return repr(self).