nat.tool.chat_completion#

Simple Completion Function for NAT

This module provides a simple completion function that can handle natural language queries and perform basic text completion tasks.

Classes#

ChatCompletionConfig

Configuration for the Chat Completion Function.

Functions#

register_chat_completion(config, builder)

Registers a chat completion function that can handle natural language queries.

Module Contents#

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

Bases: nat.data_models.function.FunctionBaseConfig

Configuration for the Chat Completion Function.

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.

system_prompt: str = None#
llm_name: nat.data_models.component_ref.LLMRef = None#
async register_chat_completion(
config: ChatCompletionConfig,
builder: nat.builder.builder.Builder,
)#

Registers a chat completion function that can handle natural language queries.