Improve search model config display for admin (#887) from aam-at/feature/improve_search_model_config_admin

Currently, the search model config display for admins only shows the id of the search model config, which is not very informative. 

The changes enhances the admin console by displaying the name of the search model config (name), as well as the bi-encoder model (bi_encoder) and cross-encoder model (cross_encoder) along the id.
This commit is contained in:
Debanjum 2024-08-16 07:33:55 -07:00 committed by GitHub
commit 8dad9362e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -94,7 +94,6 @@ admin.site.register(KhojUser, KhojUserAdmin)
admin.site.register(ProcessLock)
admin.site.register(SpeechToTextModelOptions)
admin.site.register(SearchModelConfig)
admin.site.register(ReflectiveQuestion)
admin.site.register(UserSearchModelConfig)
admin.site.register(ClientApplication)
@ -178,6 +177,17 @@ class OpenAIProcessorConversationConfigAdmin(admin.ModelAdmin):
search_fields = ("id", "name", "api_key", "api_base_url")
@admin.register(SearchModelConfig)
class SearchModelConfigAdmin(admin.ModelAdmin):
list_display = (
"id",
"name",
"bi_encoder",
"cross_encoder",
)
search_fields = ("id", "name", "bi_encoder", "cross_encoder")
@admin.register(ServerChatSettings)
class ServerChatSettingsAdmin(admin.ModelAdmin):
list_display = (