RAG implementation, content moderation, prompt classification, new LLM chain, document storage
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
from django.contrib import admin
|
||||
from .models import CustomUser, Announcement, Company, LLMModels, Conversation, Prompt, Feedback, PromptMetric
|
||||
from .models import (
|
||||
CustomUser,
|
||||
Announcement,
|
||||
Company,
|
||||
LLMModels,
|
||||
Conversation,
|
||||
Prompt,
|
||||
Feedback,
|
||||
PromptMetric,
|
||||
DocumentWorkspace,
|
||||
Document
|
||||
)
|
||||
|
||||
# Register your models here.
|
||||
|
||||
@@ -27,16 +38,16 @@ class CustomUserAdmin(admin.ModelAdmin):
|
||||
"has_signed_tos",
|
||||
"last_login",
|
||||
"slug",
|
||||
"get_set_password_url"
|
||||
"get_set_password_url",
|
||||
)
|
||||
search_fields = ("fields", "username", "first_name", "last_name", "slug")
|
||||
|
||||
|
||||
class FeedbackAdmin(admin.ModelAdmin):
|
||||
model = Feedback
|
||||
search_fields = ("status", "text", "get_user_email")
|
||||
list_display= (
|
||||
"status", "get_user_email", "title", "category"
|
||||
)
|
||||
list_display = ("status", "get_user_email", "title", "category")
|
||||
|
||||
|
||||
class LLMModelsAdmin(admin.ModelAdmin):
|
||||
model = LLMModels
|
||||
@@ -46,7 +57,7 @@ class LLMModelsAdmin(admin.ModelAdmin):
|
||||
|
||||
class ConversationAdmin(admin.ModelAdmin):
|
||||
model = Conversation
|
||||
list_display = ("title", "get_user_email","deleted")
|
||||
list_display = ("title", "get_user_email", "deleted")
|
||||
search_fields = ("title",)
|
||||
|
||||
|
||||
@@ -55,9 +66,35 @@ class PromptAdmin(admin.ModelAdmin):
|
||||
list_display = ("message", "user_created", "get_conversation_title")
|
||||
search_fields = ("message",)
|
||||
|
||||
|
||||
class PromptMetricAdmin(admin.ModelAdmin):
|
||||
model = PromptMetric
|
||||
list_display = ("event", "model_name", "prompt_length","reponse_length",'has_file','file_type', "get_duration")
|
||||
list_display = (
|
||||
"event",
|
||||
"model_name",
|
||||
"prompt_length",
|
||||
"reponse_length",
|
||||
"has_file",
|
||||
"file_type",
|
||||
"get_duration",
|
||||
)
|
||||
|
||||
class DocumentWorkspaceAdmin(admin.ModelAdmin):
|
||||
model = DocumentWorkspace
|
||||
list_display = (
|
||||
"name",
|
||||
"company",
|
||||
|
||||
)
|
||||
|
||||
class DocumentAdmin(admin.ModelAdmin):
|
||||
model = Document
|
||||
list_display = (
|
||||
"file",
|
||||
"active",
|
||||
"created",
|
||||
"processed",
|
||||
)
|
||||
|
||||
|
||||
admin.site.register(Announcement, AnnouncmentAdmin)
|
||||
@@ -69,3 +106,6 @@ admin.site.register(Conversation, ConversationAdmin)
|
||||
admin.site.register(Prompt, PromptAdmin)
|
||||
admin.site.register(PromptMetric, PromptMetricAdmin)
|
||||
admin.site.register(Feedback, FeedbackAdmin)
|
||||
|
||||
admin.site.register(DocumentWorkspace, DocumentWorkspaceAdmin)
|
||||
admin.site.register(Document, DocumentAdmin)
|
||||
|
||||
Reference in New Issue
Block a user