-
Notifications
You must be signed in to change notification settings - Fork 142
/
Copy pathpolicy.xml
23 lines (23 loc) · 1.09 KB
/
policy.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<policies>
<inbound>
<base />
<!-- Check the embeddings in the Redis cache for a cached prompt response according to the score threshold. If successful, the policy automatically moves past the azure-openai-semantic-cache-store policy. -->
<azure-openai-semantic-cache-lookup score-threshold="0.8" embeddings-backend-id ="embeddings-backend" embeddings-backend-auth ="system-assigned" />
<authentication-managed-identity resource="https://cognitiveservices.azure.com" output-token-variable-name="managed-id-access-token" ignore-error="false" />
<set-header name="Authorization" exists-action="override">
<value>@("Bearer " + (string)context.Variables["managed-id-access-token"])</value>
</set-header>
<set-backend-service backend-id="{backend-id}" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<!-- Cache the Gen AI response in Redis for 2 minutes -->
<azure-openai-semantic-cache-store duration="120" />
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>