axValidateChatRequestMessage
function axValidateChatRequestMessage(item:
| {
cache?: boolean;
content: string;
role: "system";
}
| {
content: | string
| (
| {
cache?: boolean;
text: string;
type: "text";
}
| {
altText?: string;
cache?: boolean;
details?: "high" | "low" | "auto";
image: string;
mimeType: string;
optimize?: "auto" | "quality" | "size";
type: "image";
}
| {
cache?: boolean;
data: string;
duration?: number;
format?: "wav" | "mp3" | "ogg";
transcription?: string;
type: "audio";
}
| {
cache?: boolean;
data: string;
extractedText?: string;
filename: string;
mimeType: string;
type: "file";
}
| {
cache?: boolean;
cachedContent?: string;
description?: string;
title?: string;
type: "url";
url: string;
})[];
name?: string;
role: "user";
}
| {
cache?: boolean;
content?: string;
functionCalls?: object[];
name?: string;
role: "assistant";
}
| {
cache?: boolean;
functionId: string;
isError?: boolean;
result: string;
role: "function";
}): void;
Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/src/ax/ai/validate.ts#L10
Validates a chat request message item to ensure it meets the required criteria
Parameters
Parameter | Type | Description |
---|---|---|
item | | { cache? : boolean ; content : string ; role : "system" ; } | { content : | string | ( | { cache? : boolean ; text : string ; type : "text" ; } | { altText? : string ; cache? : boolean ; details? : "high" | "low" | "auto" ; image : string ; mimeType : string ; optimize? : "auto" | "quality" | "size" ; type : "image" ; } | { cache? : boolean ; data : string ; duration? : number ; format? : "wav" | "mp3" | "ogg" ; transcription? : string ; type : "audio" ; } | { cache? : boolean ; data : string ; extractedText? : string ; filename : string ; mimeType : string ; type : "file" ; } | { cache? : boolean ; cachedContent? : string ; description? : string ; title? : string ; type : "url" ; url : string ; })[]; name? : string ; role : "user" ; } | { cache? : boolean ; content? : string ; functionCalls? : object []; name? : string ; role : "assistant" ; } | { cache? : boolean ; functionId : string ; isError? : boolean ; result : string ; role : "function" ; } | The chat request message to validate |
Returns
void
Throws
When validation fails with a descriptive error message