assistantOverrides behavior in Squad calls
# support
d
I'm triggering calls using a squadId. However, if I use assistantOverrides in the payload, these don't seem to be used in any of the assistants of the squad, and there's no squadOverrides field either. Is there a way around this? I want to use variables in the prompts of each of the assistants. I also want to avoid having to build an entirely new squad dynamically for each call. Thanks!
k
To utilize member overrides with the transient squad feature, you must retrieve your squad configuration immediately prior to the call. Subsequently, pass the membersOverrides as a parameter. Please note that membersOverrides are not currently supported with the squadID. Here's how to work around the squadId limitation with member overrides: 1\. First, fetch your squad configuration 2\. Create a transient squad with the same configuration plus your overrides 3\. Use that transient squad in your call Here's an example:
Copy code
// 1. Get your squad configuration
const squad = {...squadConfig}

// 2. Create transient squad configuration with overrides
const callPayload = {
  squad: {
    ...squad,
    membersOverrides: {
      variableValues: {
        customer_name: "John",
        product_type: "Premium"
      }
    }
  }
};
// 3. Make the call with the transient squad
// use create call API or SDK
Copy code
class Squad {
  /**
   * This is the name of the squad.
   */
  name?: string;
/**This is the list of assistants that make up the squad.The call will start with the first assistant in the list.
*/
members: SquadMemberDTO[];/**This can be used to override all the assistants' settings and provide values for their template variables.Both membersOverrides and members[n].assistantOverrides can be used together. First, members[n].assistantOverrides is applied. Then, membersOverrides is applied as a global override.
*/
membersOverrides?: AssistantOverrides;
}
g
Hello, I was having similar issue. So in the scenario where I want to update the assistants before the call I always need to create a transient one? Can't I just override the squad setting before the call starts? For example I want to pass variables to both assistant, variables are given right before starting the call (there is a form before that fetch data). I would need a "base squad" I retrieve this squad I do modification and create a new "modified_squad" I start the call with this "modified_squad" Is it correct? Is it the only way or the best one?
s
@giorgior27 instead of fetch and creating transient squad if
membersOverrides
works, you can make use of it.
g