Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8faaa4b2be | |||
| 7f5bd942b3 |
@@ -204,7 +204,7 @@ class SendMessageToUserTool(FunctionTool[AstrAgentContext]):
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": (
|
"description": (
|
||||||
"Component type. One of: "
|
"Component type. One of: "
|
||||||
"plain, image, record, file, mention_user"
|
"plain, image, record, video, file, mention_user. Record is voice message."
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
"text": {
|
"text": {
|
||||||
@@ -320,6 +320,19 @@ class SendMessageToUserTool(FunctionTool[AstrAgentContext]):
|
|||||||
components.append(Comp.Record.fromURL(url=url))
|
components.append(Comp.Record.fromURL(url=url))
|
||||||
else:
|
else:
|
||||||
return f"error: messages[{idx}] must include path or url for record component."
|
return f"error: messages[{idx}] must include path or url for record component."
|
||||||
|
elif msg_type == "video":
|
||||||
|
path = msg.get("path")
|
||||||
|
url = msg.get("url")
|
||||||
|
if path:
|
||||||
|
(
|
||||||
|
local_path,
|
||||||
|
file_from_sandbox,
|
||||||
|
) = await self._resolve_path_from_sandbox(context, path)
|
||||||
|
components.append(Comp.Video.fromFileSystem(path=local_path))
|
||||||
|
elif url:
|
||||||
|
components.append(Comp.Video.fromURL(url=url))
|
||||||
|
else:
|
||||||
|
return f"error: messages[{idx}] must include path or url for video component."
|
||||||
elif msg_type == "file":
|
elif msg_type == "file":
|
||||||
path = msg.get("path")
|
path = msg.get("path")
|
||||||
url = msg.get("url")
|
url = msg.get("url")
|
||||||
|
|||||||
@@ -422,6 +422,12 @@ async def get_booter(
|
|||||||
) -> ComputerBooter:
|
) -> ComputerBooter:
|
||||||
config = context.get_config(umo=session_id)
|
config = context.get_config(umo=session_id)
|
||||||
|
|
||||||
|
runtime = config.get("provider_settings", {}).get("computer_use_runtime", "local")
|
||||||
|
if runtime == "local":
|
||||||
|
return get_local_booter()
|
||||||
|
elif runtime == "none":
|
||||||
|
raise RuntimeError("Sandbox runtime is disabled by configuration.")
|
||||||
|
|
||||||
sandbox_cfg = config.get("provider_settings", {}).get("sandbox", {})
|
sandbox_cfg = config.get("provider_settings", {}).get("sandbox", {})
|
||||||
booter_type = sandbox_cfg.get("booter", "shipyard_neo")
|
booter_type = sandbox_cfg.get("booter", "shipyard_neo")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user