Flutter assistantOverrides Variable + tool call
# support
s
I am using the Vapi Flutter SDK https://pub.dev/packages/vapi My tool call API endpoint needs the user token, then I pass it inside like this. The name works perfectly but it doesn't see my {{authToken}} at the tool call section. I'm stuck for days on this. Note: Have also declared it in my tool call as well (See the image)
Copy code
Map<String, dynamic> _assistantOverrides(String token) => {
        'recordingEnabled': false,
        'variableValues': {
          'name': widget.userAccount.firstname,
          'authToken': token,
          'transaction_id': widget.transactionId ??
              "e022a120-5583-4a4c-aa46-deea27979980"
        },
      };


      final assistantOverrides = _assistantOverrides(token);

      final call = await vapiClient!.start(
        assistantId: assistantId,
        assistantOverrides: assistantOverrides,
      );
https://cdn.discordapp.com/attachments/1426905462980476968/1426905464037310586/image.png?ex=68ececc5&is=68eb9b45&hm=5c81723d27eb0c7569fb792f812a82b5a29d93b9df72463c96506e7db1b3d009&
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
Hi SkiteTech, To address the issue with your variable substitution, ensure that the
{{authToken}}
variable is correctly configured and passed to your tool call. Here are some steps to verify: 1. **Configuration Check**: - Make sure that
{{authToken}}
is included and referenced correctly in your tool setup within the Vapi dashboard or in your API request configuration. - Confirm the tool is programmed to read and use this variable in the API call section. 2. **Variable Values**: - Double-check your
assistantOverrides
setup to ensure all variables are correctly set and passed. The structure seems correct, so ensure there's no context mismatch or missing setup in your tool that may prevent
authToken
from being recognized. 3. **Call Logs**: - Review your call logs to verify that the
authToken
is being captured and passed during the tool execution. This can help you identify any gaps in the workflow. 4. **Dynamic Variables**: - Consider using LiquidJS to ensure that the values are dynamically resolved within the assistant interaction. This can provide more flexibility in variable substitution during the conversation flow. Review these aspects, and if everything seems configured correctly, the issue may lie in the tool's handling of dynamic inputs. In such cases, reviewing the exact point of use and any logs can be particularly insightful.
s
Don't worry. Already fix it myself. It was because the token is too Long.
c
Glad you were able to get it resolved. If I may ask, how many characters was your token?
2 Views