Skip to main content
The 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

  1. Structured Outputs
    • Define clear JSON schemas for predictable responses
    • Use TypeScript interfaces for type safety
  2. Multi-Modal Inputs
    • Use appropriate content types (image_url, video_url, file_url)
    • Set detail level for images based on analysis needs
  3. Error Handling
    • Always wrap API calls in try-catch blocks
    • Handle rate limits and timeouts appropriately