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.
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.
AIChatMessageRole
The role of a chat 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.
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-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)
.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.
success true
AIGenerateSkyboxAction
An event that is used to generate a skybox using AI.
Members
negativePrompt? string
The negative prompt to use for the skybox.
Describes the things that you don't want the skybox to look like.
options AIGenerateSkyboxOptions
The options that should be included in the request.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
prompt string
The prompt to use for the skybox.
Describes things that you want the skybox to look like.
taskId (string | number)
The ID of the async task.
type "ai_generate_skybox"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
AIGenerateSkyboxBlockadeLabsOptions
Options that are specific to Blockade Labs implementations for
ai.generateSkybox(prompt, negativePrompt, options)
.Members
AIGenerateSkyboxOptions
Defines an interface that represents options for
ai.generateSkybox(prompt, negativePrompt, options)
.Members
blockadeLabs? AIGenerateSkyboxBlockadeLabsOptions
Options that are specific to blockade-labs.
endpoint? string
The HTTP endpoint that the request should interface with.
AIGenerateSkyboxRequest
Defines an interface that represents a request for
ai.generateSkybox(request)
.Members
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)
.Members
AISloydGenerateModelOptions
The options for generating a model using Sloyd AI.
Members
baseModelId? string
The ID of the model that the new model should be based on.
levelOfDetail? number
The level of detail that should be used. Higher values will result in more detailed models. Should be between
0.01
and1
. Defaults to0.5
.outputMimeType? ("model/gltf+json" | "model/gltf-binary")
The MIME type that should be used for the model. If omitted, then "model/gltf+json" will be used.
prompt string
The prompt to use for the model.
recordName? string
The name of the record that should be used. If omitted, then the ID of the user will be used.
thumbnail? object
The options for the thumbnail for the model. If omitted, then no thumbnail will be generated.
AIUrlContent