!pip install vlmrunfrom pydantic import BaseModel, Fieldimport datetimefrom vlmrun.client import VLMRunfrom vlmrun.client.types import AgentCreationResponse, AgentCreationConfig, AgentExecutionResponsefrom vlmrun.types import MessageContent, FileUrl# Define a Pydantic model for the execution inputsclass ExecutionInputs(BaseModel): file: MessageContent = Field(..., description="The file to extract data from")# Define a Pydantic model for the responseclass Invoice(BaseModel): invoice_id: str = Field(..., description="The ID of the invoice") invoice_date: datetime.date = Field(..., description="The date of the invoice") total_amount: float = Field(..., description="The total amount of the invoice")# Initialize the clientclient = VLMRun(api_key="<VLMRUN_API_KEY>")# Create the agent using a promptresponse: AgentCreationResponse = client.agent.create( name="invoice-extractor", # Optional name inputs=ExecutionInputs(file=MessageContent(type="file_url", file_url=FileUrl(url="https://example.com/invoice.pdf"))), # Optional test inputs config=AgentCreationConfig(prompt="Extract the invoice_id, date and amount from the invoice.", response_model=Invoice),)
npm install vlmrun zodimport { VlmRun } from 'vlmrun';import { z } from 'zod';// Define a Zod schema for the execution inputsconst ExecutionInputsSchema = z.object({ file: z.object({ type: z.literal("file_url"), file_url: z.object({ url: z.string() }) }).describe("The file to extract data from")});// Define a Zod schema for the responseconst InvoiceSchema = z.object({ invoice_id: z.string().describe("The ID of the invoice"), invoice_date: z.string().date().describe("The date of the invoice"), total_amount: z.number().describe("The total amount of the invoice")});// Initialize the clientconst client = new VlmRun({ baseUrl: "https://api.vlm.run/v1", apiKey: "<VLMRUN_API_KEY>"});// Create the agent using a promptconst response = await client.agent.create({ name: "invoice-extractor", // Optional name inputs: { // Optional test inputs file: { type: "file_url", file_url: { url: "https://example.com/invoice.pdf" } } }, config: { prompt: "Extract the invoice_id, date and amount from the invoice.", json_schema: JSON.stringify(InvoiceSchema.shape) }});
!pip install vlmrunfrom pydantic import BaseModel, Fieldimport datetimefrom vlmrun.client import VLMRunfrom vlmrun.client.types import AgentCreationResponse, AgentCreationConfig, AgentExecutionResponsefrom vlmrun.types import MessageContent, FileUrl# Define a Pydantic model for the execution inputsclass ExecutionInputs(BaseModel): file: MessageContent = Field(..., description="The file to extract data from")# Define a Pydantic model for the responseclass Invoice(BaseModel): invoice_id: str = Field(..., description="The ID of the invoice") invoice_date: datetime.date = Field(..., description="The date of the invoice") total_amount: float = Field(..., description="The total amount of the invoice")# Initialize the clientclient = VLMRun(api_key="<VLMRUN_API_KEY>")# Create the agent using a promptresponse: AgentCreationResponse = client.agent.create( name="invoice-extractor", # Optional name inputs=ExecutionInputs(file=MessageContent(type="file_url", file_url=FileUrl(url="https://example.com/invoice.pdf"))), # Optional test inputs config=AgentCreationConfig(prompt="Extract the invoice_id, date and amount from the invoice.", response_model=Invoice),)
npm install vlmrun zodimport { VlmRun } from 'vlmrun';import { z } from 'zod';// Define a Zod schema for the execution inputsconst ExecutionInputsSchema = z.object({ file: z.object({ type: z.literal("file_url"), file_url: z.object({ url: z.string() }) }).describe("The file to extract data from")});// Define a Zod schema for the responseconst InvoiceSchema = z.object({ invoice_id: z.string().describe("The ID of the invoice"), invoice_date: z.string().date().describe("The date of the invoice"), total_amount: z.number().describe("The total amount of the invoice")});// Initialize the clientconst client = new VlmRun({ baseUrl: "https://api.vlm.run/v1", apiKey: "<VLMRUN_API_KEY>"});// Create the agent using a promptconst response = await client.agent.create({ name: "invoice-extractor", // Optional name inputs: { // Optional test inputs file: { type: "file_url", file_url: { url: "https://example.com/invoice.pdf" } } }, config: { prompt: "Extract the invoice_id, date and amount from the invoice.", json_schema: JSON.stringify(InvoiceSchema.shape) }});
!pip install vlmrunfrom pydantic import BaseModel, Fieldimport datetimefrom vlmrun.client import VLMRunfrom vlmrun.client.types import AgentCreationResponse, AgentCreationConfig, AgentExecutionResponsefrom vlmrun.types import MessageContent, FileUrl# Define a Pydantic model for the execution inputsclass ExecutionInputs(BaseModel): file: MessageContent = Field(..., description="The file to extract data from")# Define a Pydantic model for the responseclass Invoice(BaseModel): invoice_id: str = Field(..., description="The ID of the invoice") invoice_date: datetime.date = Field(..., description="The date of the invoice") total_amount: float = Field(..., description="The total amount of the invoice")# Initialize the clientclient = VLMRun(api_key="<VLMRUN_API_KEY>")# Create the agent using a promptresponse: AgentCreationResponse = client.agent.create( name="invoice-extractor", # Optional name inputs=ExecutionInputs(file=MessageContent(type="file_url", file_url=FileUrl(url="https://example.com/invoice.pdf"))), # Optional test inputs config=AgentCreationConfig(prompt="Extract the invoice_id, date and amount from the invoice.", response_model=Invoice),)
npm install vlmrun zodimport { VlmRun } from 'vlmrun';import { z } from 'zod';// Define a Zod schema for the execution inputsconst ExecutionInputsSchema = z.object({ file: z.object({ type: z.literal("file_url"), file_url: z.object({ url: z.string() }) }).describe("The file to extract data from")});// Define a Zod schema for the responseconst InvoiceSchema = z.object({ invoice_id: z.string().describe("The ID of the invoice"), invoice_date: z.string().date().describe("The date of the invoice"), total_amount: z.number().describe("The total amount of the invoice")});// Initialize the clientconst client = new VlmRun({ baseUrl: "https://api.vlm.run/v1", apiKey: "<VLMRUN_API_KEY>"});// Create the agent using a promptconst response = await client.agent.create({ name: "invoice-extractor", // Optional name inputs: { // Optional test inputs file: { type: "file_url", file_url: { url: "https://example.com/invoice.pdf" } } }, config: { prompt: "Extract the invoice_id, date and amount from the invoice.", json_schema: JSON.stringify(InvoiceSchema.shape) }});
The type of the skill. Use 'skill_reference' for DB-stored skills referenced by id/name. Use 'inline' to provide the skill as a base64-encoded zip bundle.
Delivery tier for the agent run. auto/default/None resolves to standard (baseline 1.0× billing); flex is 0.5× billing with higher latency, and priority is 1.8× billing with a premium latency SLO.