14 lines
352 B
Python
14 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"
|