WorkflowSummary
get_instruction_prompt
ContextUtility
- Session-based directory management
- Generic markdown file operations
- Text-based search through files
- File metadata handling
- Agent memory record retrieval
- Shared session management for workforce workflows
init
- working_directory (str, optional): The directory path where files will be stored. If not provided, a default directory will be used.
- session_id (str, optional): The session ID to use. If provided, this instance will use the same session folder as other instances with the same session_id. If not provided, a new session ID will be generated.
- create_folder (bool): Whether to create the session folder immediately. If False, the folder will be created only when needed (e.g., when saving files). Default is True for backward compatibility.
_setup_storage
_generate_session_id
_ensure_directory_exists
_create_or_update_note
- note_name (str): Name of the note (without .md extension).
- content (str): Content to write to the note.
save_markdown_file
- filename (str): Name without .md extension.
- content (str): Main content to save.
- title (str, optional): Title for the markdown file.
- metadata (Dict, optional): Additional metadata to include.
structured_output_to_markdown
- structured_data: Any Pydantic BaseModel instance
- metadata: Optional metadata to include in the markdown
- title: Optional custom title, defaults to model class name (default: model class name)
- field_mappings: Optional mapping of field names to custom section titles
load_markdown_file
- filename (str): Name without .md extension.
file_exists
- filename (str): Name without .md extension.
list_markdown_files
get_agent_memory_records
- agent (ChatAgent): The agent to extract memory records from.
format_memory_as_conversation
- memory_records (List[MemoryRecord]): Memory records to format.
create_session_directory
- base_dir (str, optional): Base directory. If None, uses current working directory.
- session_id (str, optional): Custom session ID. If None, generates new one.
get_session_metadata
list_sessions
- base_dir (str, optional): Base directory to search. If None, uses parent of working directory.
search_in_file
- file_path (Path): Path to the file to search.
- keywords (List[str]): Keywords to search for.
- top_k (int): Maximum number of results to return.
get_working_directory
get_session_id
set_session_id
- session_id (str): The session ID to use.
load_markdown_context_to_memory
- agent (ChatAgent): The agent to append context to.
- filename (str): Name of the markdown file (without .md extension).
- include_metadata (bool): Whether to include metadata section in the loaded content. Defaults to False.
_filter_metadata_from_content
- content (str): The full markdown content including metadata.
get_workforce_shared
- session_id (str, optional): Custom session ID. If None, uses the default workforce session.