I’m using the function tool to call an external API, but I’m facing an issue when trying to pass global variables into query parameters. Here’s what I’ve done:
-
I’m extracting variables like
nameandbirthdatefrom the conversation using the “Extract Dynamic Variable” function. -
I then pass these values into the API Endpoint URL using query parameters, such as
https://hapi.fhir.org/baseR4/Patient?name={name}&birthdate={birthdate}. -
However, when I run the tool, the correct arguments are retrieved, but the variables are not passed properly into the query parameters.
The function returns the error HAPI-1940: Invalid date/time/quantity format: "{birthdate}", meaning the global variables are not being interpolated in the URL as expected.
Question:
-
Is there a specific step or configuration I might be missing to ensure the global variables are correctly passed in the query parameters?
-
How can I ensure that the variables extracted in the conversation are properly inserted into the API endpoint during the function call?
Any guidance on this would be appreciated. Thanks!