Skip to main content Link Search Menu Expand Document (external link)

AiInput.ts overview

Since v1.0.0


Exports Grouped by Category


Combination

concat

Concatenates the messages of one AiInput onto the messages of another, creating a new AiInput with the messages from both.

Signature

declare const concat: { (other: AiInput): (self: AiInput) => AiInput; (self: AiInput, other: AiInput): AiInput }

Source

Since v1.0.0

Constructors

empty

Signature

declare const empty: AiInput

Source

Since v1.0.0

make

Constructs a new AiInput from raw user input.

Signature

declare const make: (input: Raw) => AiInput

Source

Since v1.0.0

Guards

is

Signature

declare const is: (u: unknown) => u is AiInput

Source

Since v1.0.0

isMessage

Signature

declare const isMessage: (u: unknown) => u is Message

Source

Since v1.0.0

isPart

Signature

declare const isPart: (u: unknown) => u is UserMessagePart | AssistantMessagePart | ToolMessagePart

Source

Since v1.0.0

Models

AiInput (class)

Represents input to a large language model.

Signature

declare class AiInput

Source

Since v1.0.0

[TypeId] (property)

Signature

readonly [TypeId]: unique symbol

Source

Since v1.0.0

AssistantMessage (class)

Signature

declare class AssistantMessage

Source

Since v1.0.0

[MessageTypeId] (property)

Signature

readonly [MessageTypeId]: unique symbol

Source

Since v1.0.0

AssistantMessagePart

The valid parts of an assistant message.

Signature

declare const AssistantMessagePart: Schema.Union<
  [typeof TextPart, typeof ReasoningPart, typeof RedactedReasoningPart, typeof ToolCallPart]
>

Source

Since v1.0.0

AssistantMessagePart (type alias)

Signature

type AssistantMessagePart = typeof AssistantMessagePart.Type

Source

Since v1.0.0

FilePart (class)

Represents a file part of a message with binary file data.

Signature

declare class FilePart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

FileUrlPart (class)

Represents a file part of a message with a URL pointing to the file.

Signature

declare class FileUrlPart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

FromJson

Signature

declare const FromJson: Schema.transform<Schema.SchemaClass<unknown, string, never>, typeof AiInput>

Source

Since v1.0.0

ImagePart (class)

Represents an image part of a message with binary image data.

Signature

declare class ImagePart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

ImageUrlPart (class)

Represents an image part of a message with a URL pointing to the image.

Signature

declare class ImageUrlPart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

Message

Signature

declare const Message: Schema.Union<[typeof UserMessage, typeof AssistantMessage, typeof ToolMessage]>

Source

Since v1.0.0

Message (type alias)

Signature

type Message = typeof Message.Type

Source

Since v1.0.0

Raw (type alias)

Represents raw input types that can be converted into an AiInput.

Signature

type Raw =
  | string
  | Message
  | Iterable<Message>
  | AiInput
  | AiResponse.AiResponse
  | AiResponse.WithStructuredOutput<any>
  | AiResponse.WithToolCallResults<any>

Source

Since v1.0.0

ReasoningPart (class)

Represents a part of a message containing reasoning that the model used to generate its output.

Signature

declare class ReasoningPart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

RedactedReasoningPart (class)

Represents a part of a message containing content in the model’s reasoning that was encrypted by the model provider for safety reasons.

Signature

declare class RedactedReasoningPart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

TextPart (class)

Represents a text part of a message.

Signature

declare class TextPart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

ToolCallId

Represents the identifier generated by a model when a tool call is requested.

Signature

declare const ToolCallId: Schema.brand<typeof Schema.String, "@effect/ai/ToolCallId">

Source

Since v1.0.0

ToolCallId (type alias)

Signature

type ToolCallId = typeof ToolCallId.Type

Source

Since v1.0.0

ToolCallPart (class)

Represents a part of a message containing a tool call that the model has requested invocation of.

Signature

declare class ToolCallPart {
  constructor(props: any, options?: Schema.MakeOptions)
}

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

ToolCallResultPart (class)

Represents a part of a message containing the results of tool calls that the model requested invocation of.

Signature

declare class ToolCallResultPart

Source

Since v1.0.0

[PartTypeId] (property)

Signature

readonly [PartTypeId]: unique symbol

Source

Since v1.0.0

ToolMessage (class)

Signature

declare class ToolMessage

Source

Since v1.0.0

[MessageTypeId] (property)

Signature

readonly [MessageTypeId]: unique symbol

Source

Since v1.0.0

ToolMessagePart

The valid parts of a tool message.

Signature

declare const ToolMessagePart: typeof ToolCallResultPart

Source

Since v1.0.0

ToolMessagePart (type alias)

Signature

type ToolMessagePart = typeof ToolMessagePart.Type

Source

Since v1.0.0

UserMessage (class)

Signature

declare class UserMessage

Source

Since v1.0.0

[MessageTypeId] (property)

Signature

readonly [MessageTypeId]: unique symbol

Source

Since v1.0.0

UserMessagePart

The valid parts of a user message.

Signature

declare const UserMessagePart: Schema.Union<
  [typeof TextPart, typeof ImagePart, typeof ImageUrlPart, typeof FilePart, typeof FileUrlPart]
>

Source

Since v1.0.0

UserMessagePart (type alias)

Signature

type UserMessagePart = typeof UserMessagePart.Type

Source

Since v1.0.0

Type Ids

MessageTypeId

Signature

declare const MessageTypeId: unique symbol

Source

Since v1.0.0

MessageTypeId (type alias)

Signature

type MessageTypeId = typeof MessageTypeId

Source

Since v1.0.0

PartTypeId

Signature

declare const PartTypeId: unique symbol

Source

Since v1.0.0

PartTypeId (type alias)

Signature

type PartTypeId = typeof PartTypeId

Source

Since v1.0.0

TypeId

Signature

declare const TypeId: unique symbol

Source

Since v1.0.0

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v1.0.0