OpenAIChatBuilder
Last updated
Was this helpful?
OpenAiChatBuilder is a builder for configuring and creating OpenAI chat clients. Allows setting API key, model name, temperature, and memory token limits for the OpenAI model.
Builds and returns a ChatClient configured with the specified OpenAI model settings.
Creates a new ToolBuilder for defining a custom tool for the AI agent.
void
Injects the built-in Servoy tools (such as user info) into the AI agent.
Adds a system message to the chat context. This can be a message how the model must behave for this chat session.
Parameters
String message The system message to add.
Returns: voidThis builder instance for chaining.
Sets the OpenAI API key.
Parameters
String key The API key.
Returns: OpenAiChatBuilder This builder instance.
Builds and returns a ChatClient configured with the specified OpenAI model settings.
Returns: ChatClient A configured ChatClient instance.
Creates a new ToolBuilder for defining a custom tool for the AI agent.
Parameters
Function toolFunction the function representing the tool's logic
String name the name of the tool
String description the description of the tool
Returns: ToolBuilder a ToolBuilder instance for further configuration
Sets the maximum number of memory tokens for chat history.
Parameters
Number tokens The maximum number of tokens.
Returns: OpenAiChatBuilder This builder instance.
Sets the OpenAI model name.
Parameters
String modelName The model name.
Returns: OpenAiChatBuilder This builder instance.
Sets the temperature for the OpenAI model.
Parameters
Number temperature The temperature value.
Returns: OpenAiChatBuilder This builder instance.
Injects the built-in Servoy tools (such as user info) into the AI agent.
Parameters
Boolean useBuiltInTools Boolean to indicate whether to use built-in tools.
Returns: voidThis builder instance for chaining.
Last updated
Was this helpful?
Was this helpful?