agent component provides methods for interacting with VLM Run’s Orion Agents for multi-modal chat completions.
Chat Completions
Generate responses from the agent using the chat completions:Image Analysis
Analyze images using the agent:Video Analysis
Analyze videos using the agent:Structured Outputs
Get structured JSON responses using TypeScript interfaces:Document Analysis
Analyze documents and PDFs:SDK Reference
client.agent.completions.create()
Create a chat completion with the agent.
Parameters:
Returns:
Promise<ChatCompletionResponse>
Message Content Types
Best Practices
-
Structured Outputs
- Define clear JSON schemas for predictable responses
- Use TypeScript interfaces for type safety
-
Multi-Modal Inputs
- Use appropriate content types (
image_url,video_url,file_url) - Set
detaillevel for images based on analysis needs
- Use appropriate content types (
-
Error Handling
- Always wrap API calls in try-catch blocks
- Handle rate limits and timeouts appropriately