discourse-ai/app/serializers/ai_custom_tool_list_serializer.rb
Sam ce79a18790
FEATURE: Native PDF support (#1127)
* 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>
2025-02-18 09:22:57 +11:00

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