Builder

class Builder

Builder is a helper class to build a ChatRequest instance with a stable API. It provides methods for setting the properties of the ChatRequest object. The build method returns a new ChatRequest instance with the specified properties.

Usage:

val chatRequest = ChatRequest.builder()
.model("gpt-3.5-turbo")
.messages(mutableListOf("Be as helpful as possible".toSystemMessage()))
.build()

Functions

Link copied to clipboard

Adds a message to the end of the list.

Link copied to clipboard

Adds a tool to the end of the list.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Lets ChatGPT decide whether to use tools.

Link copied to clipboard

Forces ChatGPT to call the specified function.

Link copied to clipboard

Blocks ChatGPT from using any tools.

Link copied to clipboard