-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
945626a
commit 4c73262
Showing
5 changed files
with
74 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.db import models | ||
Check failure on line 1 in explorer/assistant/models.py GitHub Actions / isort
|
||
from django.conf import settings | ||
|
||
|
||
class PromptLog(models.Model): | ||
|
||
class Meta: | ||
app_label = 'explorer' | ||
|
||
prompt = models.TextField(blank=True) | ||
response = models.TextField(blank=True) | ||
run_by_user = models.ForeignKey( | ||
settings.AUTH_USER_MODEL, | ||
null=True, | ||
blank=True, | ||
on_delete=models.CASCADE | ||
) | ||
run_at = models.DateTimeField(auto_now_add=True) | ||
duration = models.FloatField(blank=True, null=True) # seconds | ||
model = models.CharField(blank=True, max_length=128, default='') | ||
error = models.TextField(blank=True, null=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Generated by Django 4.2.8 on 2024-01-11 08:22 | ||
Check failure on line 1 in explorer/migrations/0014_promptlog.py GitHub Actions / isort
|
||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('explorer', '0013_querylog_error_querylog_success'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='PromptLog', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('prompt', models.TextField(blank=True)), | ||
('response', models.TextField(blank=True)), | ||
('run_at', models.DateTimeField(auto_now_add=True)), | ||
('duration', models.FloatField(blank=True, null=True)), | ||
('model', models.CharField(blank=True, default='', max_length=128)), | ||
('error', models.TextField(blank=True, null=True)), | ||
('run_by_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), | ||
], | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters