4e15b44d3941ba45288e4cb57dd35efd52f8bfdf
Major refactoring to support isolated run objects with streaming, events, and OpenAI-compatible endpoints. ## Backend Changes - **Agent class**: Added `run()` method, `received_message()` wraps chat into AgentRun - **AgentRun class**: New class for run state with event system, serialization, and user tracking - **inference.py**: Complete refactor with `build_messages()`, `chat_completion()`, tool support for llama-cpp/ollama/replicate - **tools.py**: New centralized tool management (ToolSpec, ToolParameter, format_tools_for_engine) - **tools.py**: Removed legacy Toolset/Action/ToolDescription system - **server.py**: Added OpenAI-compatible `/api/openai/v1/chat/completions` endpoint with streaming support - **temporary.py**: Added `self.runs` dict to State class - **expert.py**: Refactored to use new Agent.run() signature - **scripted.py**: Updated to raise NotImplementedError ## Frontend Changes - **backend.js**: Added `onRunEvents()` for run event subscriptions - **Sidebar.vue**: Added runs navigation mode - **router/index.js**: Renamed User route to RunsView - **RunsView.vue**: New view for listing/monitoring agent runs ## Breaking Changes - Agent `prompt()` signature changed: `(instruction, input=None, **kwargs)` instead of `(content)` - Agent `received_message()` must use AgentRun pattern - Tools.py removed, functionality moved to tool.py - Deprecated tool prompt/action system removed
Backend
To run the Flask server, follow these steps:
- Build and activate the virtual environment, install the required dependencies, and build the gui by running make with the default target:
make - Run the server using the provided script:
./run.sh
Now, visit http://127.0.0.1:5000 in your web browser to see the application in action.
Frontend
Frontend uses flutter. For Ubuntu you can use this guideline to install it.
Configuration
You can set the backend URL for Android and native builds using the environment variable BACKEND_URL. Make sure to set this variable before running the application. Defaults to null if nothing is set.
Languages
Python
45.8%
Vue
34.1%
JavaScript
16.6%
Shell
1.7%
CSS
1.4%
Other
0.4%