Skip to content

Commit e8b0fc1

Browse files
committed
fix: treat openAIServices.openAI() return value as string
1 parent f2f4274 commit e8b0fc1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/api/views/uploadFile/title.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ def summarize_pdf(pdf: fitz.Document) -> str:
5858
prompt = "Please provide a title for this document. The title should be less than 256 characters and will be displayed on a webpage."
5959
response = openAIServices.openAI(
6060
first_page_content, prompt, model='gpt-4o', temp=0.0)
61-
title = response.choices[0].message.content.strip().strip('"').strip("'")
61+
title = response.strip().strip('"').strip("'")
6262
# Truncate to fit UploadFile model's max_length=255 title field as a final safeguard
6363
return title[:255]

0 commit comments

Comments
 (0)