axAnalyzeChatPromptRequirements Generated TypeScript API reference. typescript api api/reference build/apidocs/Function.axAnalyzeChatPromptRequirements.md function axAnalyzeChatPromptRequirements

axAnalyzeChatPromptRequirements

TypeScript
function axAnalyzeChatPromptRequirements(chatPrompt: any[]): MediaRequirements;

Defined in: https://github.com/ax-llm/ax/blob/5b28f9093bb70863b59459bb6df5062d005bce41/src/ax/ai/processor.ts#L351

Analyzes a chat prompt to determine what media types it contains.

Scans through chat messages to identify the types of media content present, which can be used for provider capability matching and routing decisions.

Example

TypeScript
const requirements = axAnalyzeChatPromptRequirements([
  {
    role: 'user',
    content: [
      { type: 'text', text: 'Analyze this:' },
      { type: 'image', image: 'base64...' },
      { type: 'file', filename: 'report.pdf' }
    ]
  }
]);
// Result: { hasImages: true, hasAudio: false, hasFiles: true, hasUrls: false }

Parameters

ParameterTypeDescription
chatPromptany[]Array of chat messages to analyze

Returns

MediaRequirements

Object indicating which media types are present in the chat prompt

Docs