Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Memento-Teams/Memento
/ functions
Functions
224 in github.com/Memento-Teams/Memento
⨍
Functions
224
◇
Types & classes
39
↓ 23 callers
Method
run
r"""Executes the given code based on its type. Args: code (str): The code to be executed. code_type (str): The type o
server/interpreters/base.py:9
↓ 17 callers
Method
_execute_ast
(self, expression: ast.AST)
server/interpreters/internal_python_interpreter.py:246
↓ 6 callers
Function
_get_workspace_dir
Get or create the unified workspace directory for a task. 📁 DIRECTORY STRUCTURE: task_cache_dir/workspace/ (flat structure - al
server/code_agent.py:260
↓ 4 callers
Method
_add_to_history
(self, role: str, content: str)
client/no_parametric_cbr.py:359
↓ 4 callers
Method
_add_to_history
(self, role: str, content: str)
client/parametric_memory_cbr.py:356
↓ 3 callers
Function
_capture_screenshot
(video_file: str, timestamp: float, width: int = 320)
server/video_tool.py:56
↓ 3 callers
Function
_count_tokens
Count tokens in a message for context management. Args: msg: Message dictionary with role and content enc: Tokenizer encodin
client/agent_local_server.py:285
↓ 3 callers
Function
_count_tokens
(msg: Dict[str, str], enc)
client/agent.py:130
↓ 3 callers
Function
_count_tokens
(msg: Dict[str, str], enc)
client/no_parametric_cbr.py:195
↓ 3 callers
Function
_count_tokens
(msg: Dict[str, str], enc)
client/parametric_memory_cbr.py:175
↓ 3 callers
Function
get_logger
(name: str = __name__, level=logging.INFO)
server/interpreters/logger.py:3
↓ 3 callers
Function
round
Round *a* to *decimal_places* (default 0).
server/math_tool.py:41
↓ 2 callers
Method
_assign
(self, target: ast.expr, value: Any)
server/interpreters/internal_python_interpreter.py:331
↓ 2 callers
Method
_chat_with_image
Core routine: prepare image, run OpenAI vision chat, return content.
server/image_tool.py:80
↓ 2 callers
Method
_check_code_type
(self, code_type: str)
server/interpreters/subprocess_interpreter.py:366
↓ 2 callers
Method
_check_code_type
(self, code_type: str)
server/interpreters/docker_interpreter.py:248
↓ 2 callers
Method
_create_temp_file
r"""Creates a temporary file with the given code and extension. Args: code (str): The code to write to the temporary file.
server/interpreters/subprocess_interpreter.py:332
↓ 2 callers
Method
_df_to_md
(df: pd.DataFrame)
server/excel_tool.py:108
↓ 2 callers
Method
_execute_condition
(self, condition: ast.Compare)
server/interpreters/internal_python_interpreter.py:395
↓ 2 callers
Function
_format_file_size
Format file size in human-readable format.
server/code_agent.py:1181
↓ 2 callers
Function
_images_to_base64
(imgs: List[Image.Image])
server/video_tool.py:127
↓ 2 callers
Method
_is_command_available
r"""Check if a command is available in the system PATH. Args: command (str): The command to check. Returns:
server/interpreters/subprocess_interpreter.py:385
↓ 2 callers
Method
_load_memory
(self)
client/parametric_memory_cbr.py:335
↓ 2 callers
Function
_log_execution
Log execution details for debugging and tracking. Args: operation: Type of operation performed details: Operation-specif
server/code_agent.py:284
↓ 2 callers
Function
_parse_plan
(plan_field: Union[str, dict, list, None])
memory/train_memory_retriever.py:32
↓ 2 callers
Function
_pretty_plan
(plan_obj: Union[dict, list])
memory/train_memory_retriever.py:48
↓ 2 callers
Method
_retrieve_cases
(self, query: str)
client/parametric_memory_cbr.py:345
↓ 2 callers
Function
_strip_fences
(text: str)
client/no_parametric_cbr.py:175
↓ 2 callers
Function
_strip_fences
(text: str)
client/parametric_memory_cbr.py:165
↓ 2 callers
Method
_validate_import
(self, full_name: str)
server/interpreters/internal_python_interpreter.py:474
↓ 2 callers
Function
ask_question_about_image
Answers a specific question related to the content of the image located at *image_path*. Parameters: - image_path (str): The file path o
server/image_tool.py:157
↓ 2 callers
Function
build_prompt_from_cases
(task_text: str, retrieved_cases: list[dict])
client/parametric_memory_cbr.py:121
↓ 2 callers
Method
chat
(self, *_, **__)
client/agent_local_server.py:77
↓ 2 callers
Method
chat
(self, *_, **__)
client/agent.py:61
↓ 2 callers
Method
chat
(self, *_, **__)
client/no_parametric_cbr.py:219
↓ 2 callers
Method
chat
(self, *_, **__)
client/parametric_memory_cbr.py:206
↓ 2 callers
Method
clear_state
r"""Initialize :obj:`state` and :obj:`fuzz_state`.
server/interpreters/internal_python_interpreter.py:238
↓ 2 callers
Function
embed_texts
( texts: List[str], tokenizer: AutoTokenizer, model: AutoModel, device: torch.device, batc
memory/np_memory.py:39
↓ 2 callers
Function
evaluate
(model: nn.Module, loader: DataLoader, device: str)
memory/train_memory_retriever.py:129
↓ 2 callers
Method
execute
r"""Execute the input python codes in a security environment. Args: code (str): Generated python code to be executed.
server/interpreters/internal_python_interpreter.py:165
↓ 2 callers
Function
load_pool
(path: str)
memory/parametric_memory.py:56
↓ 2 callers
Method
retrieve
(self, natural_prompt: str, icl_pool: List[str], metadata: List[Dict[str, Any]])
memory/parametric_memory.py:33
↓ 2 callers
Method
run
r"""Executes the given code in the container attached to the interpreter, and captures the stdout and stderr streams. Args:
server/interpreters/docker_interpreter.py:185
↓ 2 callers
Function
run_single_query
Execute a single query and display the result. Args: client: Initialized HierarchicalClient instance question: User's questi
client/agent_local_server.py:603
↓ 2 callers
Function
run_single_query
(client: HierarchicalClient, question: str, file_path: str)
client/agent.py:276
↓ 1 callers
Method
__init__
(self, path: str, use_plan: bool = True, plan_style: str = "pretty", section_tokens: Tuple[st
memory/train_memory_retriever.py:74
↓ 1 callers
Function
_check_safe
(level: int)
server/search_tool.py:37
↓ 1 callers
Function
_check_time_range
(rng: Optional[str])
server/search_tool.py:42
↓ 1 callers
Method
_clean_ipython_output
r"""Remove ANSI escape sequences from the output.
server/interpreters/ipython_interpreter.py:60
↓ 1 callers
Function
_crawl_and_extract
( url: str, query: str, *, max_tokens: int = 30000, temperature: float = 0.1, )
server/ai_crawl.py:123
↓ 1 callers
Function
_crawl_markdown
(url: str)
server/ai_crawl.py:114
↓ 1 callers
Method
_create_file_in_container
(self, content: str)
server/interpreters/docker_interpreter.py:134
↓ 1 callers
Function
_ensure_list
(x: Any)
client/no_parametric_cbr.py:492
↓ 1 callers
Function
_ensure_list
(x: Any)
client/parametric_memory_cbr.py:460
↓ 1 callers
Method
_execute
r"""Execute the code in the Jupyter kernel and return the result.
server/interpreters/ipython_interpreter.py:66
↓ 1 callers
Method
_execute_assign
(self, assign: ast.Assign)
server/interpreters/internal_python_interpreter.py:323
↓ 1 callers
Method
_execute_binop
(self, binop: ast.BinOp)
server/interpreters/internal_python_interpreter.py:490
↓ 1 callers
Method
_execute_call
(self, call: ast.Call)
server/interpreters/internal_python_interpreter.py:354
↓ 1 callers
Method
_execute_for
(self, for_statement: ast.For)
server/interpreters/internal_python_interpreter.py:447
↓ 1 callers
Method
_execute_if
(self, if_statement: ast.If)
server/interpreters/internal_python_interpreter.py:428
↓ 1 callers
Method
_execute_import
(self, import_module: ast.Import)
server/interpreters/internal_python_interpreter.py:458
↓ 1 callers
Method
_execute_import_from
(self, import_from: ast.ImportFrom)
server/interpreters/internal_python_interpreter.py:464
↓ 1 callers
Method
_execute_name
(self, name: ast.Name)
server/interpreters/internal_python_interpreter.py:387
↓ 1 callers
Method
_execute_subscript
(self, subscript: ast.Subscript)
server/interpreters/internal_python_interpreter.py:365
↓ 1 callers
Method
_execute_unaryop
(self, unaryop: ast.UnaryOp)
server/interpreters/internal_python_interpreter.py:518
↓ 1 callers
Function
_extract_audio
(video_file: str, output_format: str = "mp3")
server/video_tool.py:66
↓ 1 callers
Function
_extract_for_query
( backend: OpenAIBackend, md: str, query: str, *, max_tokens: int = 30000, temperature
server/ai_crawl.py:99
↓ 1 callers
Function
_extract_imports_from_code
Extract all imported module names from Python code. Args: code: Python source code Returns: Set of imported
server/code_agent.py:115
↓ 1 callers
Method
_extract_json
(self, json_path: str, encoding: str = "utf‑8")
server/documents_tool.py:173
↓ 1 callers
Function
_extract_keyframes
( video_path: str, frame_interval: float = 4.0, max_frames: int = 100, target_width: int = 512
server/video_tool.py:93
↓ 1 callers
Method
_extract_pptx
(self, pptx_path: str)
server/documents_tool.py:180
↓ 1 callers
Method
_extract_with_chunkr
( self, path: str, output_format: Literal["json", "markdown"] = "markdown" )
server/documents_tool.py:229
↓ 1 callers
Function
_get_file_type_description
Get a human-readable description of file type based on extension.
server/code_agent.py:1127
↓ 1 callers
Function
_get_or_create_sandbox
Get the existing sandbox for the workspace or create a new one. This function uses a global dictionary to cache sandbox instances based on
server/code_agent.py:515
↓ 1 callers
Function
_get_tokenizer
Return a tokenizer for the specified model. Args: model: Model name to get tokenizer for Returns: Tokenizer encoding ob
client/agent_local_server.py:300
↓ 1 callers
Function
_get_tokenizer
Return a tokenizer; fall back to cl100k_base if model is unknown.
client/agent.py:135
↓ 1 callers
Function
_get_tokenizer
(model: str)
client/parametric_memory_cbr.py:181
↓ 1 callers
Method
_get_value_from_state
(self, key: str)
server/interpreters/internal_python_interpreter.py:531
↓ 1 callers
Method
_handle_csv
(self, path: str)
server/excel_tool.py:53
↓ 1 callers
Method
_handle_xlsx
(self, path: str)
server/excel_tool.py:62
↓ 1 callers
Method
_initialize_if_needed
r"""Initialize the kernel manager and client if they are not already initialized.
server/interpreters/ipython_interpreter.py:47
↓ 1 callers
Method
_initialize_if_needed
(self)
server/interpreters/docker_interpreter.py:100
↓ 1 callers
Method
_initialize_interpreter
Initializes the correct interpreter.
server/code_agent.py:353
↓ 1 callers
Method
_massage_args_for_tool
(self, tool_name: str, args: Dict[str, Any])
client/agent_local_server.py:396
↓ 1 callers
Method
_memory_prompt_for
(self, task_text: str)
client/no_parametric_cbr.py:340
↓ 1 callers
Function
_normalize
(img: Image.Image, target_width: int = 512)
server/video_tool.py:88
↓ 1 callers
Function
_normalize_filename
Sanitizes and normalizes a filename to prevent directory traversal. - Removes leading/trailing whitespace and quotes. - Replaces backsla
server/code_agent.py:557
↓ 1 callers
Method
_prepare_image
Turn *path* (local path or URL) into a URL or data‑URL acceptable to the OpenAI Vision endpoint.
server/image_tool.py:114
↓ 1 callers
Method
_resolve_tool_name
(self, requested: str)
client/agent_local_server.py:379
↓ 1 callers
Method
_run_file_in_container
( self, file: Path, code_type: str, )
server/interpreters/docker_interpreter.py:153
↓ 1 callers
Method
_score_batch
(self, natural: List[str], icl: List[str])
memory/parametric_memory.py:25
↓ 1 callers
Function
_strip_fences
Remove markdown code fences and extract JSON content. Args: text: Text that may contain markdown fences or JSON Returns:
client/agent_local_server.py:264
↓ 1 callers
Function
_strip_fences
(text: str)
client/agent.py:120
↓ 1 callers
Method
_tools_schema
Get the schema for all available tools in a format suitable for OpenAI. Returns: List of tool schemas in OpenAI function
client/agent_local_server.py:439
↓ 1 callers
Method
_tools_schema
(self)
client/agent.py:185
↓ 1 callers
Method
_tools_schema
(self)
client/no_parametric_cbr.py:381
↓ 1 callers
Method
_tools_schema
(self)
client/parametric_memory_cbr.py:317
↓ 1 callers
Function
_transcribe_audio_async
Whisper transcription via AsyncOpenAI; returns '' if disabled.
server/video_tool.py:77
↓ 1 callers
Function
_truncate_text
Truncate text to approximately max_tokens, showing start and end. For code files (.py, .js, .ts, .java, .cpp, .c, .h, .cs, .php, .rb, .g
server/code_agent.py:195
↓ 1 callers
Method
_try_chunkr_then_fallback
(self, path: str)
server/documents_tool.py:210
next →
1–100 of 224, ranked by callers