nip.code_validation.agents._ParsedChatCompletion#

class nip.code_validation.agents._ParsedChatCompletion(next_messages: OrderedDict[str, str] | None, raw_message: str, prompt: list[PromptMessage], discrete_decision: Literal[0, 1, 2, 3], continuous_decision: float, raw_decision: str, retry_count: int, warning: Literal['max_tokens', 'unparsable_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]

discrete_decision#

The discrete decision from the verifier model, with the following meanings: - 0: reject - 1: accept - 3: neither accept nor reject

Type:

Literal[0, 1, 3]

continuous_decision#

The continuous decision from the verifier model. This is a number between -1 and 1, where -1 is “reject” and 1 is “accept”. This is a more fine-grained version of discrete_decision.

Type:

float

raw_decision#

The raw decision text from the verifier model. This is the text which appears after “Decision: “ in the completion text.

Type:

str

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.

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

Type:

Literal[“max_tokens”, “unparsable_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], discrete_decision: Literal[0, 1, 2, 3], continuous_decision: float, raw_decision: str, retry_count: int, warning: Literal['max_tokens', 'unparsable_response'] | None) None#
__repr__()#

Return repr(self).