syntax tree

This commit is contained in:
Sam Saffron 2024-09-18 10:37:40 +10:00
parent 593abadd37
commit 9d38e51cf5
No known key found for this signature in database
GPG Key ID: B9606168D2FFD9F5
5 changed files with 9 additions and 15 deletions

View File

@ -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

View File

@ -70,7 +70,6 @@ module DiscourseAi
)
end
end
end
end
end

View File

@ -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

View File

@ -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],

View File

@ -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