I am new to using APIM, so I have only opened up our existing APIM and tried to add a policy. I followed some snippets, so obviously I am missing something simple, yet complex for me. I just wanted to try only getting the id for now, but ultimately I want just 2 attributes:
{
"id": "chatcmpl-7twCOMGznD52ANyKiuDiRpXwBavT4",
"content": "The size of a horse can vary greatly depending on the breed, age, and individual horse. On average, horses typically stand between 14 to 17 hands high at the withers, which is equivalent to 56 to 68 inches (142 to 173 cm) in height at the shoulder. However, there are smaller horse breeds that can be as short as 8 to 10 hands (32 to 40 inches) and larger draft horse breeds that can reach heights of 18 hands (72 inches) or more."
}
The response is normally like this:
{
"id": "chatcmpl-7twCOMGznD52ANyKiuDiRpXwBavT4",
"object": "chat.completion",
"created": 1693566112,
"model": "gpt-3.5-turbo-0613",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "The size of a horse can vary greatly depending on the breed, age, and individual horse. On average, horses typically stand between 14 to 17 hands high at the withers, which is equivalent to 56 to 68 inches (142 to 173 cm) in height at the shoulder. However, there are smaller horse breeds that can be as short as 8 to 10 hands (32 to 40 inches) and larger draft horse breeds that can reach heights of 18 hands (72 inches) or more."
},
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 14,
"completion_tokens": 107,
"total_tokens": 121
}
}
I am trying to add this to my Outbound processing, however, I get an Internal Server Error 500. When I send without modifying a policy, I get my results.
<outbound>
<base />
<set-body template="liquid">{
"id": {{body.id}}
}</set-body>
</outbound>