AIOS Docs
  • Welcome
  • Getting Started
    • Installation
    • Quickstart
      • Use Terminal
      • Use WebUI
    • Environment Variables Configuration
  • AIOS Kernel
    • Overview
    • LLM Core(s)
      • LiteLLM Compatible Backend
      • vLLM Backend
      • Hugging Face Backend
      • LLM Routing
    • Scheduler
      • FIFOScheduler
      • RRScheduler
    • Context
    • Memory
      • Base Layer
      • Agentic Memory Operations
    • Storage
      • sto_mount
      • sto_create_file
      • sto_create_directory
      • sto_write
      • sto_retrieve
      • sto_rollback
      • sto_share
    • Tools
    • Access
    • Syscalls
    • Terminal
  • AIOS Agent
    • How to Use Agent
    • How to Develop Agents
      • Develop with Native SDK
      • Develop with AutoGen
      • Develop with Open-Interpreter
      • Develop with MetaGPT
    • How to Publish Agents
  • AIOS-Agent SDK
    • Overview
    • LLM Core API
      • llm_chat
      • llm_chat_with_json_output
      • llm_chat_with_tool_call_output
      • llm_call_tool
      • llm_operate_file
    • Memory API
      • create_memory
      • get_memory
      • update_memory
      • delete_memory
      • search_memories
      • create_agentic_memory
    • Storage API
      • mount
      • create_file
      • create_dir
      • write_file
      • retrieve_file
      • rollback_file
      • share_file
    • Tool API
      • How to Develop Tools
    • Access API
    • Post API
    • Agent API
  • Community
    • How to Contribute
Powered by GitBook
On this page
  1. AIOS Kernel
  2. Storage

sto_create_directory

Previoussto_create_fileNextsto_write

Last updated 2 months ago

def sto_create_directory(self, dir_name: str, dir_path: str, collection_name: str = None) -> str

Description: Create a directory based on either dir_name or dir_path

  • If the dir_path is provided, it will create the file directly at the location of the dir_path

  • Else If the dir_name is provided, the directory will be created at the path of os.path.join(self.root_dir, dir_name)

Parameters:

  • dir_name (str): Name of the file to create

  • dir_path (str): Full path where to create the file

  • collection_name (str): Name of the collection/agent (optional)

Returns:

  • Success message (str): "Directory has been created successfully at: {dir_path}"

  • Exists message (str): "Directory already exists at: {dir_path}"

  • Error message (str): "Error creating directory: {error_message}"

Source code