AI Types
AIChatContent
Defines an interface that represents the contents of an AI chat message.
A AIChatContent can be one of the following values:
AIChatMessage
Defines an interface that represents a single chat message in a conversation with an AI.
Members
author? string
The name of the author of the message.
This is required if the role is
function.content (string | AIChatContent[])
The contents of the message. This can be a string, an array of objects which represent the contents of the message.
finishReason? string
The reason why the message was finished.
role AIChatMessageRole
The role of the message.
systemmeans that the message was generated by the system. Useful for telling the AI how to behave while.usermeans that the message was generated by the user.assistantmeans that the message was generated by the AI assistant.functionmeans that the message contains the results of a function call.
AIChatMessageRole
The role of a chat message.
systemmeans that the message was generated by the system. Useful for telling the AI how to behave while.usermeans that the message was generated by the user.assistantmeans that the message was generated by the AI assistant.functionmeans that the message contains the results of a function call.
A AIChatMessageRole can be one of the following values:
"system""user""assistant""function"
AIChatOptions
Defines an interface that represents options for
ai.chat(message, options).Members
endpoint? string
The HTTP endpoint that the request should interface with.
frequencyPenalty? number
The frequency penalty.
Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
preferredModel? string
The model that should be used.
If not specified, then a default will be used.
Currently, the following models are supported:
gpt-4gpt-3.5-turbo
presencePenalty? number
The presence penalty.
Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
temperature? number
The temperature that should be used.
If not specified, then a default will be used.
topP? number
The nucleus sampling probability.
AICreateOpenAIRealtimeSessionTokenResult
The response to a request to create a realtime session token using the OpenAI interface.
A AICreateOpenAIRealtimeSessionTokenResult can be one of the following values:
AIGenerateImageOptions
Defines an interface that represents options for
ai.generateImage(prompt, negativePrompt, options).Members
cfgScale? number
How strictly the diffusion process adheres to the prompt text. Higher values keep the image closer to the prompt.
clipGuidancePreset? string
The clip guidance preset.
height? number
The desired height of the image(s) in pixels.
model? string
The model that should be used to generate the image(s).
negativePrompt? string
The description of what the generated image(s) should not look like.
numberOfImages? number
The number of images that should be generated.
prompt string
The description of what the generated image(s) should look like.
sampler? string
The sampler to use for the diffusion process.
seed? number
The random noise seed that should be used.
steps? number
The number of diffusion steps to run.
stylePreset? string
The style preset that should be used to guide the image model torwards a specific style.
width? number
The desired width of the image(s) in pixels.
AIGenerateImageSuccess
Defines an interface that represents a result from
ai.generateImage(request, options).Members
images AIGeneratedImage[]
The list of images that were generated.