RoboGPT gRPC Client for agent communication
Project description
RoboGPT Client
robogpt_client is a Python package that talks to RoboGPT over gRPC.
It provides three main clients:
- Agent client – chat/streaming, function calls, tool discovery, agent config
- Vision client – camera management, detection result streaming, object pose queries
- Robot control client – load robots, move, read state, I/O, save poses
Installation
From source (development)
git clone git@github.com:orangewood-co/robogpt_client.git
cd robogpt_client
pip install -e .
From PyPI (when published)
pip3 install robogpt_client
Agent Client
Class: robogpt_client.agents.agent_client.AgentClient
Constructor:
AgentClient(server_address: str = "localhost", port: int = 50051)
Methods
Streaming / Chat
-
send_response(message: str, sender: str = "Client") -> None
Unidirectional: send one (or a generator of) response message(s) to the server (ReadResponseRPC). -
read_prompt(message_callback: Optional[Callable[[str], None]] = None) -> None
Unidirectional: listen to prompts from the server (StreamPromptsRPC).
Callsmessage_callback(content: str)for the first received message, then stops. -
stream_chat(sender: str = "Client", message_callback: Optional[Callable[[str], None]] = None) -> None
Bidirectional: start a chat stream (PromptsRPC).- Client sends messages generated from
self.callback_output. - For each server message: prints it and calls
message_callback(content: str)if provided. - Whatever
message_callbackreturns is stored back intoself.callback_output.
- Client sends messages generated from
Function Execution
-
call_function(function_name: str, arguments: Optional[Dict[str, Any]] = None, verbose: bool = True) -> Dict[str, Any]
CallsCallFunctionon the server.
Returns dict:{ "success": bool, "output": str, "error": str, }
Tool Discovery
-
get_tools(verbose: bool = True) -> Optional[Dict[str, Any]]
CallsGetToolsRPC, parsestools_metadata_jsonand returns a dict mapping tool name to metadata. -
save_tools_to_file(filepath: str = "tools_metadata.json") -> bool
Fetches tools withget_tools()and writes them to JSON. -
list_tools() -> Optional[list]
Returns a list of tool names (keys ofget_tools()), orNoneon error. -
get_tool_info(tool_name: str) -> Optional[Dict[str, Any]]
Returns the metadata dict for a single tool name, orNoneif missing/error.
Agent Configuration
-
upload_config(config_data: str, verbose: bool = True) -> bool
Uploads configuration text viaUploadAgentConfigRPC. -
upload_config_from_file(filepath: str) -> bool
Reads the given file and callsupload_config.
Connection Management
-
close() -> None
Stop streaming and close the gRPC channel. -
Context manager support:
def __enter__(self) -> "AgentClient" def __exit__(self, exc_type, exc_val, exc_tb) -> None
Simple example
from robogpt_client.agents.agent_client import AgentClient
with AgentClient() as client:
result = client.call_function("get_joint", {"robot_to_use": 1})
print(result)
Vision Client
Class: robogpt_client.vision.vision_client.VisionClient
Constructor:
VisionClient(server_address: str = "localhost", port: int = 50052)
Methods
Camera Management
-
get_camera_list(verbose: bool = True) -> Optional[List[Dict[str, str]]]
CallsCameraListRPC.
On success returns a list of dicts:{ "camera_name": str, "camera_type": str, "serial_number": str, }
-
initialize_camera(camera_name: str, camera_type: str = "RGB", serial_number: str = "", verbose: bool = True) -> Optional[Dict[str, Any]]
CallsIntializeCameraRPC.
Returns:{ "success": bool, "message": str, "stream_link": str, }
Detection Results Streaming
send_detection_results(detections: Iterable[Dict[str, Any]], camera_id: str = "default_camera", verbose: bool = True) -> bool
Client-streaming RPC:DetectionResults.
Eachdetectiondict is packed into aStructand streamed.
ReturnsTrueon successful RPC completion,Falseotherwise.
Object Pose Fetching
-
fetch_object_pose(object_name: str, frame_name: str = "base_link", camera_id: Optional[str] = None, verbose: bool = True) -> Optional[Dict[str, Any]]
CallsFetchObjectPoseRPC.
On success returns:{ "success": bool, "message": str, "pose": { "position": List[float], "orientation": List[float], } or None, "additional_info": Dict[str, Any] or None, }
Camera Control
-
stop_camera(camera_name: str, verbose: bool = True) -> Optional[Dict[str, Any]]
CallsStopCameraRPC.
Returns:{ "success": bool, "message": str, }
-
stop_all_cameras(verbose: bool = True) -> Optional[Dict[str, Any]]
CallsStopAllCamerasRPC withKillAllCamerasrequest.
Returns:{ "success": bool, "message": str, }
-
get_camera_streams(verbose: bool = True) -> Optional[List[Dict[str, Any]]]
CallsGetCameraStreamsRPC.
On success returns list of dicts:{ "camera_name": str, "stream_link": str, "is_streaming": bool, }
Helper
save_camera_list(filepath: str = "cameras.json") -> bool
Callsget_camera_list(verbose=False)and saves the result to JSON.
Connection Management
close() -> None– close gRPC channel.__enter__,__exit__– context manager support.
Simple example
from robogpt_client.vision.vision_client import VisionClient
with VisionClient() as vc:
cams = vc.get_camera_list()
print(cams)
Robot Control Client
Class: robogpt_client.robot_control.bot_control_client.BotControlClient
Constructor:
BotControlClient(server_address: str = "localhost", port: int = 50052)
Note: The default
porthere is50052in the class, though the comment says50051.
Methods
Robot Lifecycle
load_robot(robot_names: List[str], robot_ip: List[str], use_simulation: bool = False, robot_prefix: Optional[List[str]] = None) -> Tuple[bool, str]
CallsLoadRobotRPC.
Returns(success, message).
Motion
-
move_to_pose(robot_id: int, pose_name: str, speed: float = 0.5, acceleration: float = 0.5, user_frame: int = 0) -> Tuple[bool, str]
CallsMoveToPoseRPC to move to a named pose.
Returns(success, message). -
move_to_joint(robot_id: int, joint_angles: List[float], speed: float = 0.5, acceleration: float = 0.5) -> Tuple[bool, str, float]
CallsMoveToJointRPC for a joint-space move.
Returns(success, message, execution_time).
State
-
get_current_tcp(robot_id: int, user_frame: int = 0, tool_number: int = 0) -> Tuple[bool, str, Optional[List[float]]]
CallsGetCurrentTcpRPC.
On success, last element is TCP pose list; otherwiseNone. -
get_current_joints(robot_id: int) -> Tuple[bool, str, Optional[List[float]]]
CallsGetCurrentJointsRPC.
On success, last element is current joint angles; otherwiseNone.
I/O
-
set_digital_pin(robot_id: int, pin_number: int, value: bool) -> Tuple[bool, str]
CallsSetDigitalPinRPC.
Returns(success, message). -
get_digital_pin(robot_id: int, pin_number: int) -> Tuple[bool, str, bool]
CallsGetDigitalPinRPC.
Returns(success, message, value).
Poses
save_pose(robot_id: int, pose_name: str, pose_type: str = "tcp", user_frame: int = 0, tool_number: int = 0) -> Tuple[bool, str]
CallsSavePoseRPC to store the current pose with a name.
Returns(success, message).
Connection Management
-
close() -> None
Close gRPC channel. -
__enter__,__exit__– context manager support.
Simple example
from robogpt_client.robot_control.bot_control_client import BotControlClient
with BotControlClient() as client:
ok, msg = client.load_robot(
robot_names=["robot1"],
robot_ip=["192.168.1.100"],
use_simulation=True,
)
print("Load:", ok, msg)
ok, msg, joints = client.get_current_joints(robot_id=1)
print("Joints:", ok, joints)
Examples
python3 -m robogpt_client.examples.demo_agents
python3 -m robogpt_client.examples.demo_vision
python3 -m robogpt_client.examples.demo_bot_control
Support
For issues and questions, open a GitHub issue or contact support@orangewood.co
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robogpt_client-0.1.3.tar.gz.
File metadata
- Download URL: robogpt_client-0.1.3.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c77dcb4b5778befb8337f6a373d4f8db8c9ce6f24482747a21d724314977547b
|
|
| MD5 |
e1e2c97fc95beeae61aa879725365639
|
|
| BLAKE2b-256 |
d26f5d40f25f4c4074f788bc42ea6c14785d3bb6d3c022adeeb1a480d0ce1c10
|
File details
Details for the file robogpt_client-0.1.3-py3-none-any.whl.
File metadata
- Download URL: robogpt_client-0.1.3-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
156934c58b73707427fea832db54e847ac84043bc9dbac1d7a8eb48023bf8215
|
|
| MD5 |
73860ee3cf6f17456e832bc3fb20a096
|
|
| BLAKE2b-256 |
7fcb4bbd7962aa31b7c791269194e7806828865697922cb89c912c292f3dbdad
|