nat.plugins.data_flywheel.observability.schema.sink.elasticsearch.dfw_es_record#

Attributes#

Classes#

FinishReason

Finish reason for chat completion responses.

Function

Function call structure used in both requests and responses.

ToolCall

Tool call structure used in responses.

AssistantMessage

Assistant message structure used in responses.

SystemMessage

System message structure used in requests.

UserMessage

User message structure used in requests.

ToolMessage

Tool message structure used in responses.

FunctionMessage

Function message structure used in responses.

FunctionParameters

Function parameters structure used in responses.

FunctionDetails

Function details structure used in requests.

RequestTool

Request tool structure used in requests.

ESRequest

Request structure used in requests.

ResponseMessage

Response message structure used in responses.

ResponseChoice

Response choice structure used in responses.

Response

Response structure used in responses.

DFWESRecord

Data Flywheel Elasticsearch record.

Module Contents#

logger#
class FinishReason#

Bases: str, enum.Enum

Finish reason for chat completion responses.

Initialize self. See help(type(self)) for accurate signature.

STOP = 'stop'#
LENGTH = 'length'#
TOOL_CALLS = 'tool_calls'#
class Function(/, **data: Any)#

Bases: pydantic.BaseModel

Function call structure used in both requests and responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: str = None#
arguments: dict = None#
class ToolCall(/, **data: Any)#

Bases: pydantic.BaseModel

Tool call structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

function: Function = None#
type_: Literal['function'] = None#
class AssistantMessage(/, **data: Any)#

Bases: pydantic.BaseModel

Assistant message structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

role: Literal['assistant', 'ai'] = None#
content: str | None = None#
tool_calls: list[ToolCall] | None = None#
class SystemMessage(/, **data: Any)#

Bases: pydantic.BaseModel

System message structure used in requests.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

content: str = None#
role: Literal['system'] = None#
class UserMessage(/, **data: Any)#

Bases: pydantic.BaseModel

User message structure used in requests.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

content: str = None#
role: Literal['user', 'human'] = None#
class ToolMessage(/, **data: Any)#

Bases: pydantic.BaseModel

Tool message structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

content: str = None#
role: Literal['tool'] = None#
tool_call_id: str = None#
class FunctionMessage(/, **data: Any)#

Bases: pydantic.BaseModel

Function message structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

content: str | None = None#
role: Literal['function', 'chain'] = None#
type Message = SystemMessage | UserMessage | AssistantMessage | ToolMessage | FunctionMessage#
class FunctionParameters(/, **data: Any)#

Bases: pydantic.BaseModel

Function parameters structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

properties: dict = None#
required: list[str] = None#
type_: Literal['object'] = None#
classmethod validate_property_limit(v: dict) dict#

Enforce 8-property limit for tool parameters (WAR for NIM bug).

class FunctionDetails(/, **data: Any)#

Bases: pydantic.BaseModel

Function details structure used in requests.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

name: str = None#
description: str = None#
parameters: FunctionParameters = None#
class RequestTool(/, **data: Any)#

Bases: pydantic.BaseModel

Request tool structure used in requests.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

type: Literal['function'] = None#
function: FunctionDetails = None#
class ESRequest(/, **data: Any)#

Bases: pydantic.BaseModel

Request structure used in requests.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

tools: list[RequestTool] | None = None#
messages: list[Message] | None = None#
model: str = None#
temperature: float | None = None#
max_tokens: int | None = None#
class ResponseMessage(/, **data: Any)#

Bases: pydantic.BaseModel

Response message structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

role: Literal['assistant'] | None = None#
content: str | None = None#
tool_calls: list[ToolCall] | None = None#
class ResponseChoice(/, **data: Any)#

Bases: pydantic.BaseModel

Response choice structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

message: ResponseMessage = None#
finish_reason: FinishReason | None = None#
index: int | None = None#
class Response(/, **data: Any)#

Bases: pydantic.BaseModel

Response structure used in responses.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

choices: list[ResponseChoice] | None = None#
id: str | None = None#
object: str | None = None#
created: int | None = None#
model: str | None = None#
usage: dict[str, Any] | None = None#
class DFWESRecord(/, **data: Any)#

Bases: pydantic.BaseModel

Data Flywheel Elasticsearch record.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

contract_version: nat.plugins.data_flywheel.observability.schema.sink.elasticsearch.contract_version.ContractVersion = None#
request: ESRequest = None#
response: Response = None#
client_id: str = None#
workload_id: str = None#
timestamp: int = None#
error_details: str | None = None#
validate_data_consistency() Self#