Download experimental/v1_agent_attempt/tools/command_executor.py from kagvi13/HMP: direct link, hf CLI and curl.
- Browser
- Download file 739 Bytes
-
https://huggingface.co/kagvi13/HMP/resolve/main/experimental/v1_agent_attempt/tools/command_executor.py
- Command line
-
hf download hf://kagvi13/HMP/experimental/v1_agent_attempt/tools/command_executor.py
-
curl -L -o command_executor.py https://huggingface.co/kagvi13/HMP/resolve/main/experimental/v1_agent_attempt/tools/command_executor.py
739 Bytes
| # agents/tools/command_executor.py | |
| def execute_commands(commands, db, config): | |
| for cmd in commands: | |
| print(f"🛠️ Выполнение команды: {cmd['type']} ({cmd.get('cmd_id')})") | |
| try: | |
| if cmd['type'] == 'shell': | |
| run_shell_command(cmd, db) | |
| elif cmd['type'] == 'diary_entry': | |
| db.write_entry(cmd['args']['text'], tags=["diary"]) | |
| elif cmd['type'] == 'graph_add': | |
| db.add_link_or_concept(cmd['args']) | |
| elif cmd['type'] == 'llm_memory_add': | |
| db.add_llm_memory(cmd['args']) | |
| # ... остальные команды | |
| except Exception as e: | |
| db.log_error(cmd['cmd_id'], str(e)) | |