llmOS-Agent / README.md
tech-envision
Allow limited imports in execute_python
7bd7366
|
raw
history blame
801 Bytes

llm-backend

This project provides a simple async interface to interact with an Ollama model and demonstrates basic tool usage. Chat histories are stored in a local SQLite database using Peewee. Histories are persisted per user and session so conversations can be resumed with context. Two example tools are included:

  • add_two_numbers – Adds two integers.
  • execute_python – Executes Python code in a sandbox with selected built-ins and allows importing safe modules like math. The result is returned from a result variable or captured output.

Usage

python run.py

The script will ask the model to compute an arithmetic expression and print the answer. Conversations are automatically persisted to chat.db and are now associated with a user and session.