AxiomAi.PythonInterface (AxiomAI v0.1.11)
View SourcePython Interface - Interface module for embedded python functionality.
This module provides a clean API for interacting with the embedded python library within the axiom project. It handles Python environment management, code execution, and provides utilities for AI model inference.
Summary
Functions
Clean up Python environment for a specific category.
Execute AI model inference using Python.
Execute Python code with python_interface.
Execute streaming inference for AI models.
Get available Python packages in the environment.
Initialize Python environment with specified dependencies.
Functions
Clean up Python environment for a specific category.
Parameters
category: Category to clean up
Returns
:ok
Execute AI model inference using Python.
Parameters
model_path: Path to the AI modelmessage: Input message for the modelpython_code: Python code template for inferenceconfig: Configuration map with model parameterscategory: Category for environment isolation
Returns
{:ok, response}with model response{:error, reason}on failure
Execute Python code with python_interface.
Parameters
code: Python code string to executeglobals: Global variables dictionary (optional)category: Category for environment isolation
Returns
{:ok, result}with decoded Python result{:error, reason}on failure
Execute streaming inference for AI models.
Parameters
model_path: Path to the AI modelmessage: Input message for the modelpython_code: Python code template for streaming inferenceconfig: Configuration map with model parameterscategory: Category for environment isolation
Returns
- Stream of responses or error
Get available Python packages in the environment.
Parameters
category: Category for environment isolation
Returns
{:ok, packages}list of installed packages{:error, reason}on failure
Initialize Python environment with specified dependencies.
Parameters
python_deps: List of Python dependencies to installcategory: Category identifier for environment isolation
Returns
:okon success{:error, reason}on failure