Package: @effect/ai
Module: Prompt
Creates a Prompt from an input.
This is the primary constructor for creating prompts, supporting multiple input formats for convenience and flexibility.
Example
import { Prompt } from "@effect/ai"
// From string - creates a user message
const textPrompt = Prompt.make("Hello, how are you?")
// From messages array
const structuredPrompt = Prompt.make([
{ role: "system", content: "You are a helpful assistant." },
{ role: "user", content: [{ type: "text", text: "Hi!" }] }
])
// From existing prompt
declare const existingPrompt: Prompt.Prompt
const copiedPrompt = Prompt.make(existingPrompt)
Signature
declare const make: (input: RawInput) => Prompt
Since v1.0.0