feat: Add support for more tool, standardize copilot chat service (#11560)

This commit is contained in:
Pranav
2025-05-23 01:07:07 -07:00
committed by GitHub
parent d40a59f7fa
commit 03c0a7c62e
12 changed files with 334 additions and 107 deletions

View File

@@ -19,9 +19,9 @@ module Enterprise::Api::V1::Accounts::ConversationsController
response = Captain::Copilot::ChatService.new(
assistant,
previous_messages: copilot_params[:previous_messages],
conversation_history: @conversation.to_llm_text,
language: @conversation.account.locale_english_name
previous_history: copilot_params[:previous_history],
conversation_id: @conversation.display_id,
user_id: Current.user.id
).generate_response(copilot_params[:message])
render json: { message: response['response'] }
@@ -44,6 +44,6 @@ module Enterprise::Api::V1::Accounts::ConversationsController
private
def copilot_params
params.permit(:previous_messages, :message, :assistant_id)
params.permit(:previous_history, :message, :assistant_id)
end
end