Skip to main content
Version: Current

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 ("function" | "user" | "system" | "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).

    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.

  • AIDataContent

    Defines an interface that represents data that is passed to an AI chat model. This data can be used to represent images, videos, or other types of binary data that the model supports. Some models do not support this type of content.

    Members

    • base64 string

      The base 64 encoded data of the content.

    • mimeType string

      The MIME type of the content.

  • 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

  • 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

    • 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.

  • AIGenerateSkyboxOptions

    Defines an interface that represents options for ai.generateSkybox(prompt, negativePrompt, options).

    Members

  • 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

    • 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.

  • AIGeneratedImage

    Defines an interface that represents an AI generated image.

    Members

    • base64 string

      The base64 encoded image.

    • mimeType string

      The MIME Type of the image data.

    • seed? number

      The seed of the generated image.

    • url string

      The URL that can be used to display the image.

  • AITextContent

    Defines an interface that represents text that is passed to an AI chat model.

    Members

    • text string

      The text of the content.

  • AIUrlContent

    Defines an interface that represents a URL that is passed to an AI chat model. This data can be used to represent images, videos, or other types of data that the model supports fetching. Some models do not support this type of content.

    Members

    • url string

      The URL that the content is available at.