effect-io-ai

Package: @effect/ai
Module: Prompt

Prompt.makeMessage

Creates a new message with the specified role.

Example

import { Prompt } from "@effect/ai"

const textPart = Prompt.makePart("text", {
  text: "Hello, world!"
})

const filePart = Prompt.makeMessage("user", {
  content: [textPart]
})

Signature

declare const makeMessage: <const Role extends Message["role"]>(role: Role, params: Omit<Extract<Message, { role: Role; }>, MessageTypeId | "role" | "options"> & { readonly options?: Extract<Message, { role: Role; }>["options"]; }) => Extract<Message, { role: Role; }>

Source

Since v1.0.0