effect-io-ai

Package: @effect/ai
Module: index

index.Prompt

Re-exports all named exports from the “./Prompt.js” module as Prompt.

Example

import { Prompt } from "@effect/ai"

// Create a structured conversation
const conversation = Prompt.make([
  {
    role: "system",
    content: "You are a helpful assistant specialized in mathematics."
  },
  {
    role: "user",
    content: [{
      type: "text",
      text: "What is the derivative of x²?"
    }]
  },
  {
    role: "assistant",
    content: [{
      type: "text",
      text: "The derivative of x² is 2x."
    }]
  }
])

Example

import { Prompt } from "@effect/ai"

// Merge multiple prompts
const systemPrompt = Prompt.make([{
  role: "system",
  content: "You are a coding assistant."
}])

const userPrompt = Prompt.make("Help me write a function")

const combined = Prompt.merge(systemPrompt, userPrompt)

Signature

export * as Prompt from "./Prompt.js"

Source

Since v1.0.0