fix: OpenAPI label suggestion response payload (#10008)

This commit is contained in:
Muhsin Keloth
2024-08-22 15:32:33 +05:30
committed by GitHub
parent d19a9c38d7
commit eb6de74269
3 changed files with 6 additions and 4 deletions

View File

@@ -27,11 +27,13 @@ module Enterprise::Integrations::OpenaiProcessorService
response = make_api_call(label_suggestion_body)
return response if response[:error].present?
# LLMs are not deterministic, so this is bandaid solution
# 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[:message] ? response[:message].gsub(/^(label|labels):/i, '') : ''
{ message: response[:message] ? response[:message].gsub(/^(label|labels):/i, '') : '' }
end
private