Documentation

Build LLM-powered agents
with production-ready TypeScript

DSPy for TypeScript. Working with LLMs is complex—they don't always do what you want. DSPy makes it easier to build amazing things with LLMs. Just define your inputs and outputs (signature) and an efficient prompt is auto-generated and used. Connect together various signatures to build complex systems and workflows using LLMs.

15+ LLM Providers
End-to-end Streaming
Auto Prompt Tuning

axAnalyzeChatPromptRequirements

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

Defined in: https://github.com/ax-llm/ax/blob/9a5a7060a48f9eef46efc680b0cdf6b42bff5df2/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

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