refactor: label suggestion service

This commit is contained in:
Shivam Mishra
2025-12-17 17:12:33 +05:30
parent a65861ada6
commit 61f01ebc2e
+1 -6
View File
@@ -5,7 +5,7 @@ class Captain::LabelSuggestionService < Captain::BaseEditorService
payload = label_suggestion_body
return nil if payload.blank?
response = make_api_call(label_suggestion_body)
response = make_api_call(payload)
return response if response[:error].present?
# LLMs are not deterministic - sometimes response includes "Labels:" prefix
@@ -59,11 +59,6 @@ class Captain::LabelSuggestionService < Captain::BaseEditorService
true
end
def conversation_messages(in_array_format: false)
messages = init_messages_body(in_array_format)
add_messages_until_token_limit(conversation, messages, in_array_format)
end
def init_messages_body(in_array_format)
in_array_format ? [] : ''
end