fix: Handle OpenAI API errors (#9560)

This commit is contained in:
Muhsin Keloth
2024-08-22 10:24:13 +05:30
committed by GitHub
parent 6571baf211
commit 429d281501
8 changed files with 30 additions and 18 deletions

View File

@@ -31,7 +31,7 @@ module Enterprise::Integrations::OpenaiProcessorService
# To what you ask? Sometimes, the response includes
# "Labels:" in it's response in some format. This is a hacky way to remove it
# TODO: Fix with with a better prompt
response.present? ? response.gsub(/^(label|labels):/i, '') : ''
response[:message] ? response[:message].gsub(/^(label|labels):/i, '') : ''
end
private