Private
_clientClient for interacting with the OpenAI API.
Protected
_modelModel used by the AI client.
Private
_tokenizerTokenizer for encoding messages.
Assembles the chat history based on user inputs, graph changes, and actions taken.
user prompt
current state of the graph
array containing the history of actions taken by the user and the graph states
index to start from in the history
Optional
maxLookBack: numbermaximum number of past tasks to include in the output
assembled chat history with 'user' and 'assistant' roles, and the content for each
Sends a user prompt to the AI model and returns a difference object between the current graph and the new graph.
user prompt
options for the query including current state of the graph, an array containing the history of actions taken by the user and the graph states, index to start from in the history, and configuration options for the query
promise that resolves with the difference between the current graph and the new graph
Request completion from the AI model for the given messages.
array representing the user's messages
promise that resolves with the response from the AI model
Static
assembleGenerated using TypeDoc
OpenAI API Client.
This is a concrete implementation of the abstract AIClient class, specifically for OpenAI.