falseVacuum
01/13/2025, 5:08 PMjson
[
{
"task_name": "Call customer ABC co.",
"vapi_assistant": "1"
},
{
"task_name": "Call customer XYZ co.",
"vapi_assistant": "2"
}
]
Each task requires the assistant to switch to a system prompt tailored for that task. For example, the system prompt for vapi_assistant "1" would look like this:
[Identity]
Your job is to assist the user in completing the Task for customer "ABC co.".
[Context]
Task:
{
"task_name": "Call customer ABC co.",
"vapi_assistant": "1"
}
Customer Details:
President: Jon Doe
Industry: Logistics
...etc
The key challenge is dynamically transferring to an assistant for a specific task, where the assistant’s system prompt includes details about the task. It would be ideal if I could use something like the "transferCall" tool to switch to a transient assistant or dynamically modify the current assistant’s system prompt to include the task-specific context.
Is there a recommended approach for achieving this without creating a massive squad of individual assistants for each task? Any tips or best practices would be greatly appreciated.
Thank you for your help!Vapi
01/13/2025, 5:10 PMVapi
01/13/2025, 5:10 PMfalseVacuum
01/13/2025, 5:13 PMVapi
01/13/2025, 5:13 PM{{task_name}}
, {{president_name}}
, {{industry}}
, etc.
2. **Prepare Context**: Before initiating a call, prepare the context by filling in the template placeholders with the specific details of the task.
3. **Start Call with Custom Context**: When starting a call, pass the prepared context with the filled-in variables to the assistant. This way, the assistant will begin the call with a system prompt tailored to the specific task.
4. **Handle Transitions**: If you need to handle transitions between tasks during a call, you can design your assistant's logic to interpret user input and select the appropriate context for the next task. This would involve managing state within the call and using conditional logic to determine the next steps.
While this approach doesn't change the system prompt mid-call, it allows you to start each call with a customized prompt based on the task at hand. If you need to handle multiple tasks within a single call, you would need to design the assistant's logic to manage these transitions internally.
If you have further questions or need more detailed guidance on implementing this solution, please let me know!Shubham Bajaj
01/14/2025, 4:25 PM~Stu~ CoreAspect.Agency
04/05/2025, 2:47 AM