Add get_by_id method to Agent class #112
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add get_by_id method to Agent class
Summary
Adds a new
get_by_idmethod to theAgentclass invlmrun/client/agent.pythat retrieves agent information by ID. The method makes a GET request to/agents/{agent_id}and returns anAgentInfoobject, following the same implementation pattern as other methods in the class.This change is part of a coordinated implementation with vlm-lab (PR #941) that adds the corresponding backend endpoint.
Key changes:
get_by_id(agent_id: str) -> AgentInfomethod in Agent classReview & Testing Checklist for Human
client.agent.get_by_id("test-id")against a running vlm-lab instance to verify it works correctlyagents/{agent_id}URL pattern matches the backend route/agents/{agent_id}exactlyAgentInfoobject contains the expected fields and structureRecommended test plan:
client.agent.get_by_id("test-123")and verify response structureclient.agent.get()to ensure consistencyDiagram
%%{ init : { "theme" : "default" }}%% graph TD ClientCode["Client Application"]:::context AgentClass["vlmrun/client/<br/>agent.py"]:::major-edit AgentInfo["AgentInfo<br/>Response Model"]:::context APIEndpoint["GET /agents/{agent_id}<br/>(vlm-lab backend)"]:::context ClientCode -->|"get_by_id(agent_id)"| AgentClass AgentClass -->|"HTTP GET request"| APIEndpoint APIEndpoint -->|"JSON response"| AgentClass AgentClass -->|"returns"| AgentInfo subgraph Legend L1["Major Edit"]:::major-edit L2["Minor Edit"]:::minor-edit L3["Context/No Edit"]:::context end classDef major-edit fill:#90EE90 classDef minor-edit fill:#87CEEB classDef context fill:#FFFFFFNotes
get()method in the Agent classLink to Devin run: https://app.devin.ai/sessions/57de09ce83e7430599fd797e49db9670
Requested by: Sudeep Pillai (@spillai)