!pip install vlmrun
from vlmrun.client import VLMRun
from vlmrun.client.types import AgentExecutionResponse, AgentExecutionConfig
# Initialize the client
client = VLMRun(base_url="https://agent.vlm.run/v1", api_key="<VLMRUN_API_KEY>")
# Execute the agent (by name and version)
response: AgentExecutionResponse = client.agent.execute(
name="<agent-name>:<agent-version>",
inputs={
"file": "https://..."
},
)
# Execute the agent (by prompt)
response: AgentExecutionResponse = client.agent.execute(
inputs={
"file": "https://..."
},
config=AgentExecutionConfig(prompt="Extract the invoice_id, date and amount from the invoice."),
)
{
"usage": {
"elements_processed": 123,
"element_type": "image",
"credits_used": 123,
"steps": 123,
"message": "<string>",
"duration_seconds": 0
},
"id": "<string>",
"name": "<string>",
"response": "<any>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
!pip install vlmrun
from vlmrun.client import VLMRun
from vlmrun.client.types import AgentExecutionResponse, AgentExecutionConfig
# Initialize the client
client = VLMRun(base_url="https://agent.vlm.run/v1", api_key="<VLMRUN_API_KEY>")
# Execute the agent (by name and version)
response: AgentExecutionResponse = client.agent.execute(
name="<agent-name>:<agent-version>",
inputs={
"file": "https://..."
},
)
# Execute the agent (by prompt)
response: AgentExecutionResponse = client.agent.execute(
inputs={
"file": "https://..."
},
config=AgentExecutionConfig(prompt="Extract the invoice_id, date and amount from the invoice."),
)
{
"usage": {
"elements_processed": 123,
"element_type": "image",
"credits_used": 123,
"steps": 123,
"message": "<string>",
"duration_seconds": 0
},
"id": "<string>",
"name": "<string>",
"response": "<any>",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z"
}
!pip install vlmrun
from vlmrun.client import VLMRun
from vlmrun.client.types import AgentExecutionResponse, AgentExecutionConfig
# Initialize the client
client = VLMRun(base_url="https://agent.vlm.run/v1", api_key="<VLMRUN_API_KEY>")
# Execute the agent (by name and version)
response: AgentExecutionResponse = client.agent.execute(
name="<agent-name>:<agent-version>",
inputs={
"file": "https://..."
},
)
# Execute the agent (by prompt)
response: AgentExecutionResponse = client.agent.execute(
inputs={
"file": "https://..."
},
config=AgentExecutionConfig(prompt="Extract the invoice_id, date and amount from the invoice."),
)
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Request to execute an agent.
Successful Response
Response to the agent execution request.