From f07aace305859566885534262f4575d8b75ebce2 Mon Sep 17 00:00:00 2001 From: Edwin Zhang Date: Fri, 24 May 2024 16:57:02 -0400 Subject: [PATCH 1/2] Add multiple assistants to docs --- assistants/multiple-assistants.mdx | 63 ++++++++++++++++++++++++++++++ mint.json | 3 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 assistants/multiple-assistants.mdx diff --git a/assistants/multiple-assistants.mdx b/assistants/multiple-assistants.mdx new file mode 100644 index 0000000..9eec750 --- /dev/null +++ b/assistants/multiple-assistants.mdx @@ -0,0 +1,63 @@ +--- +title: "Multiple Assistants" +sidebarTitle: "Multiple Assistants" +description: "Use Multiple Assistants to handle complex workflows and tasks." +--- + +Sometimes, complex workflows are easier to manage with multiple assistants. +For example, you might have one assistant for asking about personal information, and another for booking appointments. +Each of these assistants can have their own configuration and may require drastically different prompts. + +Multiple assistants enable calls to transfer assistants mid-conversation, while maintaining full conversation context. + +## Usage + +To use multiple assistants, you can pass multiple assistants in the `assistants` array when starting a call. +Each assistant model should be assigned the relevant transfer tool for other assistants. +Assistants are specified by name and are transferred when the model recognizes a specific trigger. + +```json +{ + "assistants": [ + { + "name": "Personal Information", + "model": { + "provider": "openai", + "model": "gpt-4o", + "tools": [ + { + "type": "transferCall", + "destinations": [ + { + "type": "assistant", + "assistantName": "Appointment Booking", + "message": "Please hold on while I transfer you to our appointment booking assistant.", + "description": "Transfer the user to the appointment booking assistant after they say their name." + } + ] + } + ] + }, + "firstMessage": "Hello! What's your name?", + ... + }, + { + "name": "Appointment Booking", + "model": { + "provider": "openai", + "model": "gpt-4o", + }, + ... + } + ] +} +``` + + +## Best practices + +The following are some best practices for using multiple assistants to reduce errors: + +- Group assistants by closely related tasks +- Create as few assistants as possible to reduce complexity +- Make sure descriptions for transfers are clear and concise diff --git a/mint.json b/mint.json index 93cef35..9e78e55 100644 --- a/mint.json +++ b/mint.json @@ -156,7 +156,8 @@ "assistants/custom-llm", "assistants/persistent-assistants", "assistants/dynamic-variables", - "assistants/background-messages" + "assistants/background-messages", + "assistants/multiple-assistants" ] }, { From af744fceb4ef043eaedcbf8921377d0dfef149ba Mon Sep 17 00:00:00 2001 From: Edwin Zhang Date: Wed, 29 May 2024 16:47:47 -0400 Subject: [PATCH 2/2] Change to squads --- assistants/multiple-assistants.mdx | 63 ------------------------------ mint.json | 7 +++- squads.mdx | 52 ++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 65 deletions(-) delete mode 100644 assistants/multiple-assistants.mdx create mode 100644 squads.mdx diff --git a/assistants/multiple-assistants.mdx b/assistants/multiple-assistants.mdx deleted file mode 100644 index 9eec750..0000000 --- a/assistants/multiple-assistants.mdx +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: "Multiple Assistants" -sidebarTitle: "Multiple Assistants" -description: "Use Multiple Assistants to handle complex workflows and tasks." ---- - -Sometimes, complex workflows are easier to manage with multiple assistants. -For example, you might have one assistant for asking about personal information, and another for booking appointments. -Each of these assistants can have their own configuration and may require drastically different prompts. - -Multiple assistants enable calls to transfer assistants mid-conversation, while maintaining full conversation context. - -## Usage - -To use multiple assistants, you can pass multiple assistants in the `assistants` array when starting a call. -Each assistant model should be assigned the relevant transfer tool for other assistants. -Assistants are specified by name and are transferred when the model recognizes a specific trigger. - -```json -{ - "assistants": [ - { - "name": "Personal Information", - "model": { - "provider": "openai", - "model": "gpt-4o", - "tools": [ - { - "type": "transferCall", - "destinations": [ - { - "type": "assistant", - "assistantName": "Appointment Booking", - "message": "Please hold on while I transfer you to our appointment booking assistant.", - "description": "Transfer the user to the appointment booking assistant after they say their name." - } - ] - } - ] - }, - "firstMessage": "Hello! What's your name?", - ... - }, - { - "name": "Appointment Booking", - "model": { - "provider": "openai", - "model": "gpt-4o", - }, - ... - } - ] -} -``` - - -## Best practices - -The following are some best practices for using multiple assistants to reduce errors: - -- Group assistants by closely related tasks -- Create as few assistants as possible to reduce complexity -- Make sure descriptions for transfers are clear and concise diff --git a/mint.json b/mint.json index 9e78e55..1b8e70b 100644 --- a/mint.json +++ b/mint.json @@ -156,8 +156,7 @@ "assistants/custom-llm", "assistants/persistent-assistants", "assistants/dynamic-variables", - "assistants/background-messages", - "assistants/multiple-assistants" + "assistants/background-messages" ] }, { @@ -172,6 +171,10 @@ { "group": "Phone Calling", "pages": ["phone-calling"] + }, + { + "group": "Squads", + "pages": ["squads"] } ] }, diff --git a/squads.mdx b/squads.mdx new file mode 100644 index 0000000..fe92efa --- /dev/null +++ b/squads.mdx @@ -0,0 +1,52 @@ +--- +title: "Squads" +sidebarTitle: "Introduction" +description: "Use Squads to handle complex workflows and tasks." +--- + +Sometimes, complex workflows are easier to manage with multiple assistants. +For example, you might have one assistant for asking about personal information, and another for booking appointments. +Each of these assistants can have their own configuration and may require drastically different prompts. + +Squads enable calls to transfer assistants mid-conversation, while maintaining full conversation context. + +## Usage + +To use Squads, you can create a `squad` when starting a call and specify `members` as a list of assistants and destinations. +The first member is the assistant that will start the call, and assistants can be either persistent or transient. + +Each assistant should be assigned the relevant assistant transfer destinations. +Transfers are specified by assistant name and are used when the model recognizes a specific trigger. + +```json +{ + "squad": { + "members": [ + { + "assistantId": "information-gathering-assistant-id", + "assistantDestinations": [{ + "type": "assistant", + "assistantName": "Appointment Booking", + "message": "Please hold on while I transfer you to our appointment booking assistant.", + "description": "Transfer the user to the appointment booking assistant after they say their name." + }], + }, + { + "assistant": { + "name": "Appointment Booking", + ... + }, + } + ] + } +} +``` + + +## Best practices + +The following are some best practices for using Squads to reduce errors: + +- Group assistants by closely related tasks +- Create as few assistants as possible to reduce complexity +- Make sure descriptions for transfers are clear and concise