How it works
At a high level, context injection works like this:- set your Vocode prompt to include template values
- include a
context_endpoint
parameter to your bot - when an inbound call comes in, Vocode will query the context endpoint provided with the caller phone number
- the queried information from the endpoint is then filled into the prompt template
Context injection example
In order to have your bot use injected variables, the prompt must include template variables. Let’s set up our prompt to accept a user’s first name and link it to our context endpoint.http://localhost:8000/my-context-endpoint
that accepts phone_number
as a URL param, i.e.
http://localhost:8000/my-context-endpoint?phone_number=15555555555
.
Now, when either Kian or Ajay call the bot – the prompt will reflect the name of the person
the bot is talking to!
Note: This feature is experimental… improvements and proper authentication coming.