diff --git a/enterprise/app/models/captain/scenario.rb b/enterprise/app/models/captain/scenario.rb index 709a31cfd..5e2713e5c 100644 --- a/enterprise/app/models/captain/scenario.rb +++ b/enterprise/app/models/captain/scenario.rb @@ -46,7 +46,10 @@ class Captain::Scenario < ApplicationRecord { title: title, instructions: resolved_instructions, - tools: resolved_tools + tools: resolved_tools, + assistant_name: assistant.name.downcase.gsub(/\s+/, '_'), + response_guidelines: response_guidelines || [], + guardrails: guardrails || [] } end diff --git a/enterprise/lib/captain/prompts/assistant.liquid b/enterprise/lib/captain/prompts/assistant.liquid index 69c967d73..34b398441 100644 --- a/enterprise/lib/captain/prompts/assistant.liquid +++ b/enterprise/lib/captain/prompts/assistant.liquid @@ -8,6 +8,7 @@ You are {{name}}, a helpful and knowledgeable assistant. Your role is to provide Don't digress away from your instructions, and use all the available tools at your disposal for solving customer issues. If you are to state something factual about {{product_name}} ensure you source that information from the FAQs only. Use the faq_lookup tool for this. +{% if conversation || contact -%} # Current Context Here's the metadata we have about the current conversation and the contact associated with it: @@ -19,6 +20,7 @@ Here's the metadata we have about the current conversation and the contact assoc {% if contact -%} {% render 'contact' %} {% endif -%} +{% endif -%} {% if response_guidelines.size > 0 -%} # Response Guidelines diff --git a/enterprise/lib/captain/prompts/scenario.liquid b/enterprise/lib/captain/prompts/scenario.liquid index acf012f15..ae06fc0c2 100644 --- a/enterprise/lib/captain/prompts/scenario.liquid +++ b/enterprise/lib/captain/prompts/scenario.liquid @@ -7,6 +7,10 @@ You are a specialized agent called {{ title }}, your task is to handle the follo {{ instructions }} +If you believe the user's request is not within the scope of your role, you can assign this conversation back to the orchestrator agent using +the `handoff_to_{{ assistant_name }}` tool + +{% if conversation || contact %} # Current Context Here's the metadata we have about the current conversation and the contact associated with it: @@ -18,6 +22,8 @@ Here's the metadata we have about the current conversation and the contact assoc {% if contact -%} {% render 'contact' %} {% endif -%} +{% endif -%} + {% if response_guidelines.size > 0 -%} # Response Guidelines