Skip to content

Commit 42a7760

Browse files
committed
[APIM] Update llm cache example
1 parent 0c40100 commit 42a7760

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

articles/api-management/llm-semantic-cache-lookup-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Use the `llm-semantic-cache-lookup` policy to perform cache lookup of responses
7171

7272
### Example with corresponding llm-semantic-cache-store policy
7373

74-
[!INCLUDE [api-management-semantic-cache-example](../../includes/api-management-semantic-cache-example.md)]
74+
[!INCLUDE [api-management-llm-semantic-cache-example](../../includes/api-management-llm-semantic-cache-example.md)]
7575

7676
## Related policies
7777

articles/api-management/llm-semantic-cache-store-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The `llm-semantic-cache-store` policy caches responses to chat completion API an
5454

5555
### Example with corresponding llm-semantic-cache-lookup policy
5656

57-
[!INCLUDE [api-management-semantic-cache-example](../../includes/api-management-semantic-cache-example.md)]
57+
[!INCLUDE [api-management-llm-semantic-cache-example](../../includes/api-management-llm-semantic-cache-example.md)]
5858

5959
## Related policies
6060

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
author: dlepow
3+
ms.service: azure-api-management
4+
ms.custom:
5+
- build-2024
6+
ms.topic: include
7+
ms.date: 08/21/2024
8+
ms.author: danlep
9+
---
10+
11+
```xml
12+
<policies>
13+
<inbound>
14+
<base />
15+
<llm-semantic-cache-lookup
16+
score-threshold="0.05"
17+
embeddings-backend-id ="azure-openai-backend"
18+
embeddings-backend-auth ="system-assigned" >
19+
<vary-by>@(context.Subscription.Id)</vary-by>
20+
</azure-openai-semantic-cache-lookup>
21+
</inbound>
22+
<outbound>
23+
<azure-openai-semantic-cache-store duration="60" />
24+
<base />
25+
</outbound>
26+
</policies>
27+
```

0 commit comments

Comments
 (0)