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. Supports OpenAI-style message history when used with the chat completions API.
Classes#
Configuration for the Chat Completion Function. |
Functions#
|
Convert NAT Message list to LangChain BaseMessage list with system prompt prepended if needed. |
|
Registers a chat completion function that can handle natural language queries and full message history. |
Module Contents#
- class ChatCompletionConfig#
Bases:
nat.data_models.function.FunctionBaseConfigConfiguration for the Chat Completion Function.
- llm_name: nat.data_models.component_ref.LLMRef = None#
- _messages_to_langchain_messages( )#
Convert NAT Message list to LangChain BaseMessage list with system prompt prepended if needed.
- async register_chat_completion(
- config: ChatCompletionConfig,
- builder: nat.builder.builder.Builder,
Registers a chat completion function that can handle natural language queries and full message history.