-
Notifications
You must be signed in to change notification settings - Fork 0
story/HOP-8 #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
story/HOP-8 #9
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
69108f9
[HOP-7] Added django-allauth, configured settings, added views and urls
Girik1105 ed39b3c
[HOP-7] Templates
Girik1105 66ac0c7
[HOP-7] Resolved merge conflicts
Girik1105 9f8a3ef
[HOP-7] Final templates, better comments in settings, uv lock
Girik1105 08ca48c
[HOP-8] Added models, views for QA storage and added to admin
Girik1105 e19ba98
[HOP-7] Resolved merge conflicts
Girik1105 5b6217f
[HOP-7] comments
Girik1105 dc5268c
Merge branch 'story/HOP-7' into story/HOP-8
Girik1105 878af42
[HOP-8] Removed debug print
Girik1105 0cea583
[HOP-7] Merge conflicts resolved
Girik1105 a808edf
[HOP-7] Added login view to /
Girik1105 be00571
[HOP-8] Resolved merge conflicts with HOP-7]
Girik1105 77534de
[HOP-8] missing try except block, added record before sending to llm …
Girik1105 8da315e
Merge branch 'develop' into story/HOP-8
Girik1105 215f66a
[HOP-8] Added toggle sidebar for nice ui, mock and real response is n…
Girik1105 821ba86
Revert "[HOP-8] Added toggle sidebar for nice ui, mock and real respo…
Girik1105 5e88a84
[HOP-8] Mock and real LLM use same response format
Girik1105 77688eb
[HOP-8] Logger added, exception would log full stack trace
Girik1105 4daf314
Merge branch 'develop' into story/HOP-8
Girik1105 a587991
Merge branch 'develop' into story/HOP-8
Girik1105 0dafc69
[HOP-11] Added loggers
Girik1105 5794f6e
[HOP-8] Added loggers (previous commit had wrong ticket number
Girik1105 ad489bc
[HOP-8] Added comment explaining logger.exception
Girik1105 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,16 @@ | ||
| from django.contrib import admin | ||
| from ask.models import QARecord | ||
|
|
||
| # Register your models here. | ||
|
|
||
| @admin.register(QARecord) | ||
| class QARecordAdmin(admin.ModelAdmin): | ||
| list_display = ["id", "user", "truncated_question", "question_timestamp", "answer_timestamp"] | ||
| list_filter = ["question_timestamp", "user"] | ||
| search_fields = ["question_text", "answer_text", "user__username"] | ||
| readonly_fields = ["question_timestamp", "answer_timestamp", "answer_raw_response"] | ||
| raw_id_fields = ["user"] | ||
| date_hierarchy = "question_timestamp" | ||
|
|
||
| def truncated_question(self, obj): | ||
| return obj.question_text[:75] + "..." if len(obj.question_text) > 75 else obj.question_text | ||
| truncated_question.short_description = "Question" |
This file contains hidden or 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,35 @@ | ||
| # Generated by Django 6.0.1 on 2026-01-30 19:36 | ||
|
|
||
| import django.db.models.deletion | ||
| from django.conf import settings | ||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| initial = True | ||
|
|
||
| dependencies = [ | ||
| migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.CreateModel( | ||
| name='QARecord', | ||
| fields=[ | ||
| ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
| ('question_text', models.TextField()), | ||
| ('question_timestamp', models.DateTimeField(auto_now_add=True)), | ||
| ('answer_text', models.TextField(blank=True, default='')), | ||
| ('answer_raw_response', models.JSONField(default=dict)), | ||
| ('answer_timestamp', models.DateTimeField(blank=True, null=True)), | ||
| ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='qa_records', to=settings.AUTH_USER_MODEL)), | ||
| ], | ||
| options={ | ||
| 'verbose_name': 'Q&A Record', | ||
| 'verbose_name_plural': 'Q&A Records', | ||
| 'ordering': ['-question_timestamp'], | ||
| 'indexes': [models.Index(fields=['user', '-question_timestamp'], name='ask_qarecor_user_id_f4353f_idx')], | ||
| }, | ||
| ), | ||
| ] |
This file contains hidden or 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,18 @@ | ||
| # Generated by Django 6.0.1 on 2026-02-04 23:32 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ('ask', '0001_initial'), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name='qarecord', | ||
| name='is_error', | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| ] |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,3 +1,32 @@ | ||
| from django.db import models | ||
| from django.conf import settings | ||
|
|
||
| # Create your models here. | ||
|
|
||
| class QARecord(models.Model): | ||
| """ | ||
| Stores a question-answer pair from user interactions with the LLM. | ||
| """ | ||
| # Question fields | ||
| question_text = models.TextField() | ||
| question_timestamp = models.DateTimeField(auto_now_add=True) | ||
|
|
||
| # Answer fields | ||
| answer_text = models.TextField(blank=True, default="") | ||
| answer_raw_response = models.JSONField(default=dict) | ||
| answer_timestamp = models.DateTimeField(null=True, blank=True) | ||
| is_error = models.BooleanField(default=False) | ||
|
|
||
| user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="qa_records") | ||
|
|
||
| class Meta: | ||
| ordering = ["-question_timestamp"] | ||
| verbose_name = "Q&A Record" | ||
| verbose_name_plural = "Q&A Records" | ||
| indexes = [ | ||
| models.Index(fields=["user", "-question_timestamp"]), | ||
| ] | ||
|
|
||
| def __str__(self): | ||
| truncated = self.question_text[:50] | ||
| suffix = "..." if len(self.question_text) > 50 else "" | ||
| return f"{self.user.username}: {truncated}{suffix}" |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the exceptions need to be logged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see above