Changed development_steps, command_runs, and user_inputs models - we don't need to hash any data - we can just use it as is

This commit is contained in:
Zvonimir Sabljic
2023-09-15 17:51:24 +02:00
parent 0e739f350f
commit 0dd6b6d996
7 changed files with 50 additions and 59 deletions

View File

@@ -8,14 +8,17 @@ from playhouse.postgres_ext import BinaryJSONField
class DevelopmentSteps(BaseModel):
id = AutoField() # This will serve as the primary key
app = ForeignKeyField(App, on_delete='CASCADE')
hash_id = CharField(null=False)
prompt_path = TextField(null=True)
llm_req_num = IntegerField(null=True)
if DATABASE_TYPE == 'postgres':
messages = BinaryJSONField(null=True)
llm_response = BinaryJSONField(null=False)
prompt_data = BinaryJSONField(null=True)
else:
messages = JSONField(null=True) # Custom JSON field for SQLite
llm_response = JSONField(null=False) # Custom JSON field for SQLite
prompt_data = JSONField(null=True)
previous_step = ForeignKeyField('self', null=True, column_name='previous_step')
high_level_step = CharField(null=True)
@@ -23,5 +26,5 @@ class DevelopmentSteps(BaseModel):
class Meta:
db_table = 'development_steps'
indexes = (
(('app', 'hash_id'), True),
(('app', 'previous_step', 'high_level_step'), True),
)