refactor: simplify runtime environment info in system prompt
This commit is contained in:
parent
980c5992f4
commit
764c6d02a1
@ -75,7 +75,8 @@ Skills with available="false" need dependencies installed first - you can try in
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
now = datetime.now().strftime("%Y-%m-%d %H:%M (%A)")
|
now = datetime.now().strftime("%Y-%m-%d %H:%M (%A)")
|
||||||
workspace_path = str(self.workspace.expanduser().resolve())
|
workspace_path = str(self.workspace.expanduser().resolve())
|
||||||
runtime_summary = self._get_runtime_environment_summary()
|
system = platform.system()
|
||||||
|
runtime = f"{'macOS' if system == 'Darwin' else system} {platform.machine()}, Python {platform.python_version()}"
|
||||||
|
|
||||||
return f"""# nanobot 🐈
|
return f"""# nanobot 🐈
|
||||||
|
|
||||||
@ -89,8 +90,8 @@ You are nanobot, a helpful AI assistant. You have access to tools that allow you
|
|||||||
## Current Time
|
## Current Time
|
||||||
{now}
|
{now}
|
||||||
|
|
||||||
## Runtime Environment
|
## Runtime
|
||||||
{runtime_summary}
|
{runtime}
|
||||||
|
|
||||||
## Workspace
|
## Workspace
|
||||||
Your workspace is at: {workspace_path}
|
Your workspace is at: {workspace_path}
|
||||||
@ -105,20 +106,6 @@ For normal conversation, just respond with text - do not call the message tool.
|
|||||||
Always be helpful, accurate, and concise. When using tools, explain what you're doing.
|
Always be helpful, accurate, and concise. When using tools, explain what you're doing.
|
||||||
When remembering something, write to {workspace_path}/memory/MEMORY.md"""
|
When remembering something, write to {workspace_path}/memory/MEMORY.md"""
|
||||||
|
|
||||||
def _get_runtime_environment_summary(self) -> str:
|
|
||||||
"""Get runtime environment information."""
|
|
||||||
system = platform.system()
|
|
||||||
system_map = {"Darwin": "MacOS", "Windows": "Windows", "Linux": "Linux"}
|
|
||||||
system_label = system_map.get(system, system)
|
|
||||||
release = platform.release()
|
|
||||||
machine = platform.machine()
|
|
||||||
python_version = platform.python_version()
|
|
||||||
node = platform.node()
|
|
||||||
return (
|
|
||||||
f"Runtime environment: OS {system_label} {release} ({machine}), "
|
|
||||||
f"Python {python_version}, Hostname {node}."
|
|
||||||
)
|
|
||||||
|
|
||||||
def _load_bootstrap_files(self) -> str:
|
def _load_bootstrap_files(self) -> str:
|
||||||
"""Load all bootstrap files from workspace."""
|
"""Load all bootstrap files from workspace."""
|
||||||
parts = []
|
parts = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user