mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-09 02:40:50 +00:00
* FEATURE: Native PDF support This amends it so we use PDF Reader gem to extract text from PDFs * This means that our simple pdf eval passes at last * fix spec * skip test in CI * test file support * Update lib/utils/image_to_text.rb Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com> * address pr comments --------- Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
22 lines
461 B
Ruby
22 lines
461 B
Ruby
# frozen_string_literal: true
|
|
|
|
class AiCustomToolListSerializer < ApplicationSerializer
|
|
attributes :meta
|
|
|
|
has_many :ai_tools, serializer: AiCustomToolSerializer, embed: :objects
|
|
|
|
def meta
|
|
{
|
|
presets: AiTool.presets,
|
|
llms: DiscourseAi::Configuration::LlmEnumerator.values_for_serialization,
|
|
settings: {
|
|
rag_images_enabled: SiteSetting.ai_rag_images_enabled,
|
|
},
|
|
}
|
|
end
|
|
|
|
def ai_tools
|
|
object[:ai_tools]
|
|
end
|
|
end
|