AiInput.ts overview
Since v1.0.0
Exports Grouped by Category
- Combination
- Constructors
- Guards
- Models
- AiInput (class)
- AssistantMessage (class)
- AssistantMessagePart
- AssistantMessagePart (type alias)
- FilePart (class)
- FileUrlPart (class)
- FromJson
- ImagePart (class)
- ImageUrlPart (class)
- Message
- Message (type alias)
- Raw (type alias)
- ReasoningPart (class)
- RedactedReasoningPart (class)
- TextPart (class)
- ToolCallId
- ToolCallId (type alias)
- ToolCallPart (class)
- ToolCallResultPart (class)
- ToolMessage (class)
- ToolMessagePart
- ToolMessagePart (type alias)
- UserMessage (class)
- UserMessagePart
- UserMessagePart (type alias)
- Type Ids
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 }
Since v1.0.0
Constructors
empty
Signature
declare const empty: AiInput
Since v1.0.0
make
Constructs a new AiInput
from raw user input.
Signature
declare const make: (input: Raw) => AiInput
Since v1.0.0
Guards
is
Signature
declare const is: (u: unknown) => u is AiInput
Since v1.0.0
isMessage
Signature
declare const isMessage: (u: unknown) => u is Message
Since v1.0.0
isPart
Signature
declare const isPart: (u: unknown) => u is UserMessagePart | AssistantMessagePart | ToolMessagePart
Since v1.0.0
Models
AiInput (class)
Represents input to a large language model.
Signature
declare class AiInput
Since v1.0.0
[TypeId] (property)
Signature
readonly [TypeId]: unique symbol
Since v1.0.0
AssistantMessage (class)
Signature
declare class AssistantMessage
Since v1.0.0
[MessageTypeId] (property)
Signature
readonly [MessageTypeId]: unique symbol
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]
>
Since v1.0.0
AssistantMessagePart (type alias)
Signature
type AssistantMessagePart = typeof AssistantMessagePart.Type
Since v1.0.0
FilePart (class)
Represents a file part of a message with binary file data.
Signature
declare class FilePart
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
Since v1.0.0
FileUrlPart (class)
Represents a file part of a message with a URL pointing to the file.
Signature
declare class FileUrlPart
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
Since v1.0.0
FromJson
Signature
declare const FromJson: Schema.transform<Schema.SchemaClass<unknown, string, never>, typeof AiInput>
Since v1.0.0
ImagePart (class)
Represents an image part of a message with binary image data.
Signature
declare class ImagePart
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
Since v1.0.0
ImageUrlPart (class)
Represents an image part of a message with a URL pointing to the image.
Signature
declare class ImageUrlPart
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
Since v1.0.0
Message
Signature
declare const Message: Schema.Union<[typeof UserMessage, typeof AssistantMessage, typeof ToolMessage]>
Since v1.0.0
Message (type alias)
Signature
type Message = typeof Message.Type
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>
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
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
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
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
Since v1.0.0
TextPart (class)
Represents a text part of a message.
Signature
declare class TextPart
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
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">
Since v1.0.0
ToolCallId (type alias)
Signature
type ToolCallId = typeof ToolCallId.Type
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)
}
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
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
Since v1.0.0
[PartTypeId] (property)
Signature
readonly [PartTypeId]: unique symbol
Since v1.0.0
ToolMessage (class)
Signature
declare class ToolMessage
Since v1.0.0
[MessageTypeId] (property)
Signature
readonly [MessageTypeId]: unique symbol
Since v1.0.0
ToolMessagePart
The valid parts of a tool message.
Signature
declare const ToolMessagePart: typeof ToolCallResultPart
Since v1.0.0
ToolMessagePart (type alias)
Signature
type ToolMessagePart = typeof ToolMessagePart.Type
Since v1.0.0
UserMessage (class)
Signature
declare class UserMessage
Since v1.0.0
[MessageTypeId] (property)
Signature
readonly [MessageTypeId]: unique symbol
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]
>
Since v1.0.0
UserMessagePart (type alias)
Signature
type UserMessagePart = typeof UserMessagePart.Type
Since v1.0.0
Type Ids
MessageTypeId
Signature
declare const MessageTypeId: unique symbol
Since v1.0.0
MessageTypeId (type alias)
Signature
type MessageTypeId = typeof MessageTypeId
Since v1.0.0
PartTypeId
Signature
declare const PartTypeId: unique symbol
Since v1.0.0
PartTypeId (type alias)
Signature
type PartTypeId = typeof PartTypeId
Since v1.0.0
TypeId
Signature
declare const TypeId: unique symbol
Since v1.0.0
TypeId (type alias)
Signature
type TypeId = typeof TypeId
Since v1.0.0