Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/utils/image_to_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,15 @@ def extract_text_from_page(page)
messages = [
{
type: :user,
content:
content: [
"The following text was extracted from an image using OCR. Please enhance, correct, and structure this content while maintaining the original text:\n\n#{raw_text}",
upload_ids: [page.id],
{ upload_id: page.id },
],
},
]
else
messages = [
{ type: :user, content: "Please OCR the content in the image.", upload_ids: [page.id] },
{ type: :user, content: ["Please OCR the content in the image.", { upload_id: page.id }] },
]
end
prompt = DiscourseAi::Completions::Prompt.new(system_message, messages: messages)
Expand Down
Loading