Refactor public API around environments
This commit is contained in:
parent
57dae52cc2
commit
5d5243df23
41 changed files with 1301 additions and 459 deletions
|
|
@ -26,7 +26,7 @@ OPENAI_VM_RUN_TOOL: dict[str, Any] = {
|
|||
"parameters": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"profile": {"type": "string"},
|
||||
"environment": {"type": "string"},
|
||||
"command": {"type": "string"},
|
||||
"vcpu_count": {"type": "integer"},
|
||||
"mem_mib": {"type": "integer"},
|
||||
|
|
@ -34,7 +34,7 @@ OPENAI_VM_RUN_TOOL: dict[str, Any] = {
|
|||
"ttl_seconds": {"type": "integer"},
|
||||
"network": {"type": "boolean"},
|
||||
},
|
||||
"required": ["profile", "command", "vcpu_count", "mem_mib"],
|
||||
"required": ["environment", "command", "vcpu_count", "mem_mib"],
|
||||
"additionalProperties": False,
|
||||
},
|
||||
}
|
||||
|
|
@ -43,7 +43,7 @@ OPENAI_VM_RUN_TOOL: dict[str, Any] = {
|
|||
def call_vm_run(arguments: dict[str, Any]) -> dict[str, Any]:
|
||||
pyro = Pyro()
|
||||
return pyro.run_in_vm(
|
||||
profile=str(arguments["profile"]),
|
||||
environment=str(arguments["environment"]),
|
||||
command=str(arguments["command"]),
|
||||
vcpu_count=int(arguments["vcpu_count"]),
|
||||
mem_mib=int(arguments["mem_mib"]),
|
||||
|
|
@ -88,7 +88,7 @@ def main() -> None:
|
|||
model = os.environ.get("OPENAI_MODEL", DEFAULT_MODEL)
|
||||
prompt = (
|
||||
"Use the vm_run tool to run `git --version` in an ephemeral VM. "
|
||||
"Use the debian-git profile with 1 vCPU and 1024 MiB of memory. "
|
||||
"Use the `debian:12` environment with 1 vCPU and 1024 MiB of memory. "
|
||||
"Do not use networking for this request."
|
||||
)
|
||||
print(run_openai_vm_run_example(prompt=prompt, model=model))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue