From a3700ca15a61b201b7ed5add0c567be61bcba2db Mon Sep 17 00:00:00 2001 From: Shivering Ocelot Date: Fri, 9 Jan 2026 18:09:30 -0500 Subject: [PATCH] some changes --- backend/src/database.py | 5 +++++ backend/src/inference.py | 9 ++++++--- backend/src/server.py | 6 ++++++ frontend/src/assets/base.css | 1 + frontend/src/assets/main.css | 2 +- frontend/src/components/TitleBar.vue | 10 +++++++++- frontend/src/components/main/Sidebar.vue | 15 ++++++++------- 7 files changed, 36 insertions(+), 12 deletions(-) diff --git a/backend/src/database.py b/backend/src/database.py index ec2bfdf..dfb201a 100644 --- a/backend/src/database.py +++ b/backend/src/database.py @@ -5,6 +5,11 @@ from sqlalchemy.sql.expression import select from tortoise import fields, models, Tortoise import asyncio +# These types don't represent all objects in Horde. +# Agents and Chats can be created for just a session, in which case, they +# are not saved on the database, as aren't all their associated values of +# other classes. + class Base(DeclarativeBase): pass diff --git a/backend/src/inference.py b/backend/src/inference.py index 08df92b..daad039 100644 --- a/backend/src/inference.py +++ b/backend/src/inference.py @@ -1,4 +1,5 @@ import threading +import ollama from stream import Stream @@ -18,13 +19,15 @@ class Models: qwen3_8b = "lucataco/qwen3-vl-8b-instruct:39e893666996acf464cff75688ad49ac95ef54e9f1c688fbc677330acc478e11" qwen3_235b = "qwen/qwen3-235b-a22b-instruct-2507" -async def ollama_chat_completion(app, messages, model, opts={}): - from ollama import AsyncClient +async def ollama_list(app, messages, model, opts={}): + # TODO: test the output, and use this + return ollama.list() +async def ollama_chat_completion(app, messages, model, opts={}): content_stream = Stream(app) print("START OLLAMA INFERENCE") - stream_response = await AsyncClient().chat( + stream_response = await ollama.AsyncClient().chat( model=model, messages=[{'role': msg.role, 'content': msg.content} for msg in messages], stream=True, diff --git a/backend/src/server.py b/backend/src/server.py index f97f4df..ed8f6e4 100644 --- a/backend/src/server.py +++ b/backend/src/server.py @@ -133,6 +133,12 @@ def start_server(app): body = req.get('body', {}) nonce = req.get('nonce', None) + def get_agent_id (): + raise Exception("Cannot get agent id") + + def get_chat_id (): + raise Exception("Cannot get chat id") + if action == "ping": await send({'message': "pong"}) diff --git a/frontend/src/assets/base.css b/frontend/src/assets/base.css index 5969cba..1c3638b 100644 --- a/frontend/src/assets/base.css +++ b/frontend/src/assets/base.css @@ -48,6 +48,7 @@ --border-radius: 6px; --section-gap: 160px; + --header-height: 4em; } /* Z-Index hierarchy */ diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 4c223f3..510795a 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -23,7 +23,7 @@ main { } .main-header { - height: 3em; + height: var(--header-height); border-bottom: 1px solid var(--color-border); display: flex; flex-direction: row; diff --git a/frontend/src/components/TitleBar.vue b/frontend/src/components/TitleBar.vue index a5313f9..eff03f7 100644 --- a/frontend/src/components/TitleBar.vue +++ b/frontend/src/components/TitleBar.vue @@ -8,8 +8,9 @@