syntax tree
This commit is contained in:
parent
593abadd37
commit
9d38e51cf5
|
@ -5,8 +5,7 @@ module DiscourseAi
|
|||
class AiPersonasController < ::Admin::AdminController
|
||||
requires_plugin ::DiscourseAi::PLUGIN_NAME
|
||||
|
||||
before_action :find_ai_persona,
|
||||
only: %i[show update destroy create_user]
|
||||
before_action :find_ai_persona, only: %i[show update destroy create_user]
|
||||
|
||||
def index
|
||||
ai_personas =
|
||||
|
@ -75,7 +74,6 @@ module DiscourseAi
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def find_ai_persona
|
||||
|
@ -133,7 +131,6 @@ module DiscourseAi
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -70,7 +70,6 @@ module DiscourseAi
|
|||
)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -72,11 +72,7 @@ class RagDocumentFragment < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def publish_status(upload, status)
|
||||
MessageBus.publish(
|
||||
"/discourse-ai/rag/#{upload.id}",
|
||||
status,
|
||||
user_ids: [upload.user_id],
|
||||
)
|
||||
MessageBus.publish("/discourse-ai/rag/#{upload.id}", status, user_ids: [upload.user_id])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -58,8 +58,10 @@ Discourse::Application.routes.draw do
|
|||
put "/ai-personas/:id/files/remove", to: "discourse_ai/admin/ai_personas#remove_file"
|
||||
get "/ai-personas/:id/files/status", to: "discourse_ai/admin/ai_personas#indexing_status_check"
|
||||
|
||||
post "/rag-document-fragments/files/upload", to: "discourse_ai/admin/rag_document_fragments#upload_file"
|
||||
get "/rag-document-fragments/files/status", to: "discourse_ai/admin/rag_document_fragments#indexing_status_check"
|
||||
post "/rag-document-fragments/files/upload",
|
||||
to: "discourse_ai/admin/rag_document_fragments#upload_file"
|
||||
get "/rag-document-fragments/files/status",
|
||||
to: "discourse_ai/admin/rag_document_fragments#indexing_status_check"
|
||||
|
||||
resources :ai_llms,
|
||||
only: %i[index create show update destroy],
|
||||
|
|
|
@ -38,9 +38,9 @@ RSpec.describe Jobs::GenerateRagEmbeddings do
|
|||
describe "Publishing progress updates" do
|
||||
it "sends an update through mb after a batch finishes" do
|
||||
updates =
|
||||
MessageBus.track_publish(
|
||||
"/discourse-ai/rag/#{rag_document_fragment_1.upload_id}",
|
||||
) { subject.execute(fragment_ids: [rag_document_fragment_1.id]) }
|
||||
MessageBus.track_publish("/discourse-ai/rag/#{rag_document_fragment_1.upload_id}") do
|
||||
subject.execute(fragment_ids: [rag_document_fragment_1.id])
|
||||
end
|
||||
|
||||
upload_index_stats = updates.last.data
|
||||
|
||||
|
|
Loading…
Reference in New Issue