Views
No views yet
1{
2 "type": "tool_call",
3 "response": "Searching for the cup.",
4 "tool": "search_object",
5 "arguments": {
6 "object": "cup"
7 }
8}1User command
2→ LLM JSON response
3→ Planner / Controller validation
4→ Tool execution
5→ Robot or environment state update1{
2 "type": "tool_call",
3 "response": "short natural language explanation",
4 "tool": "tool_name",
5 "arguments": {}
6}type values are:chattool_callclarifyrefusechat, clarify, and refuse, the tool field should be null.arguments should be an empty object:1{
2 "type": "tool_call",
3 "response": "Checking visible objects.",
4 "tool": "get_visible_objects",
5 "arguments": {}
6}get_visible_objectsget_robot_statussearch_objectpick_objectplace_objectstop1{
2 "type": "tool_call",
3 "response": "Checking robot status.",
4 "tool": "get_robot_status",
5 "arguments": {}
6}1{
2 "type": "tool_call",
3 "response": "Attempting to pick up the bottle.",
4 "tool": "pick_object",
5 "arguments": {
6 "object": "bottle"
7 }
8}1{
2 "type": "tool_call",
3 "response": "Placing the bottle on the table.",
4 "tool": "place_object",
5 "arguments": {
6 "object": "bottle",
7 "destination": "table"
8 }
9}1SYSTEM_TAG = "<|system|>"
2USER_TAG = "<|user|>"
3ASSISTANT_TAG = "<|assistant|>"1<|system|>
2You are OAX, a humanoid robot assistant. Always return a valid JSON object with exactly these fields: type, response, tool, arguments.
3
4<|user|>
5Find the cup.
6
7<|assistant|>
8{"type":"tool_call","response":"Searching for the cup.","tool":"search_object","arguments":{"object":"cup"}}<|assistant|>1base_model/
2lora_adapter/base_model folder contains the pre-trained 1B LLaMA-style model.lora_adapter folder contains the supervised fine-tuned adapter used for JSON tool-calling behaviour.1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3from peft import PeftModel
4
5repo_id = "orhanaydinn/OAX-1B-Humanoid"
6
7tokenizer = AutoTokenizer.from_pretrained(
8 repo_id,
9 subfolder="base_model",
10 trust_remote_code=True,
11 use_fast=False
12)
13
14base_model = AutoModelForCausalLM.from_pretrained(
15 repo_id,
16 subfolder="base_model",
17 torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
18 trust_remote_code=True,
19 low_cpu_mem_usage=True
20)
21
22model = PeftModel.from_pretrained(
23 base_model,
24 repo_id,
25 subfolder="lora_adapter",
26 is_trainable=False
27)
28
29model.eval()base_model/ and lora_adapter/ folders as local paths.1You are OAX, a humanoid robot assistant.
2Respond briefly and clearly.
3When replying, always output a valid JSON object with exactly these fields: type, response, tool, arguments.
4Valid type values are: chat, tool_call, clarify, refuse.
5Use tool=null for chat, clarify, and refuse.
6Use an empty object for arguments when no arguments are needed.
7Do not add extra fields.
8Do not use low-level motor or servo commands.
9Do not hallucinate perception results.
10If the request is incomplete, ask for clarification.
11If the request is unsafe or unsupported, refuse.1LLM output
2→ JSON parsing
3→ Controller validation
4→ Action repair or rejection
5→ Tool execution
6→ State update