AI Types
AIChatMessage
Defines an interface that represents a single chat message in a conversation with an AI.
author?: string
The name of the author of the message.
This is required if the role is function
.
content: string
The contents of the message.
finishReason?: string
The reason why the message was finished.
role: ("function" | "system" | "user" | "assistant")
The role of the message.
system
means that the message was generated by the system. Useful for telling the AI how to behave while.user
means that the message was generated by the user.assistant
means that the message was generated by the AI assistant.function
means that the message contains the results of a function call.
AIChatOptions
Defines an interface that represents options for ai.chat(message, options)
.
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?: ("gpt-4" | "gpt-3.5-turbo")
The model that should be used.
If not specified, then a default will be used.
Currently, the following models are supported:
gpt-4
gpt-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.
AIGenerateImageOptions
Defines an interface that represents options for ai.generateImage(prompt, negativePrompt, options)
.
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)
.
images: AIGeneratedImage[]
The list of images that were generated.
success: true
AIGenerateSkyboxOptions
Options that are specific to Blockade Labs implementations for ai.generateSkybox(prompt, negativePrompt, options)
.
remixImagineId?: number
The ID of a previously generated skybox.
seed?: number
The random seed to use for generating the skybox.
skyboxStyleId?: number
The pre-defined style ID for the skybox.
AIGenerateSkyboxRequest
Defines an interface that represents a request for ai.generateSkybox(request)
.
negativePrompt?: string
The prompt that that describes what the generated skybox should avoid looking like.
options?: AIGenerateSkyboxOptions
The options that should be included in the request.
prompt: string
The prompt that describes what the generated skybox should look like.
AIGenerateSkyboxResult
Defines an interface that represents the result from ai.generateSkybox(request)
.
fileUrl: string
The URL that the generated skybox is located at.
thumbnailUrl?: string
The URL that the thumbnail for the generated skybox is located at.