feat: add response guidelines and guardrails field (#11911)

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Shivam Mishra
2025-07-15 08:56:03 +05:30
committed by GitHub
parent 1132556512
commit 4378506a35
6 changed files with 72 additions and 16 deletions

View File

@@ -43,12 +43,18 @@ class Api::V1::Accounts::Captain::AssistantsController < Api::V1::Accounts::Base
end
def assistant_params
params.require(:assistant).permit(:name, :description,
config: [
:product_name, :feature_faq, :feature_memory,
:welcome_message, :handoff_message, :resolution_message,
:instructions, :temperature
])
permitted = params.require(:assistant).permit(:name, :description,
config: [
:product_name, :feature_faq, :feature_memory,
:welcome_message, :handoff_message, :resolution_message,
:instructions, :temperature
])
# Handle array parameters separately to allow partial updates
permitted[:response_guidelines] = params[:assistant][:response_guidelines] if params[:assistant][:response_guidelines].present?
permitted[:guardrails] = params[:assistant][:guardrails] if params[:assistant][:guardrails].present?
permitted
end
def playground_params