nexy7574
2b4c324ba6
* /status works * starting up works * Config works * /ollama works * autocomplete works * downloading works * threads work * images work
13 lines
352 B
Python
13 lines
352 B
Python
import os
|
|
|
|
from tortoise.models import Model
|
|
from tortoise import fields
|
|
|
|
|
|
class OllamaThread(Model):
|
|
thread_id = fields.CharField(max_length=255, unique=True, default=lambda: os.urandom(4).hex())
|
|
messages = fields.JSONField(default=[])
|
|
created_at = fields.DatetimeField(auto_now_add=True)
|
|
|
|
class Meta:
|
|
table = "ollama_threads"
|