Skip to content

Commit 3281719

Browse files
authored
ai semantic caching distance threshold API update (#10494)
1 parent 97edbf8 commit 3281719

File tree

11 files changed

+229
-167
lines changed

11 files changed

+229
-167
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
changelog:
2+
- type: FIX
3+
issueLink: https://github.com/solo-io/solo-projects/issues/7440
4+
resolvesIssue: false
5+
description: >
6+
Fixes an issue where the ai semantic caching distance is not being set correctly in the cache. Also
7+
move the distance threshold to the cache configuration, rather than per datastore.
8+
9+

docs/content/reference/api/github.com/solo-io/gloo/projects/gloo/api/v1/enterprise/options/ai/ai.proto.sk.md

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

install/helm/gloo/crds/gateway.solo.io_v1_RouteOption.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ spec:
275275
type: boolean
276276
type: object
277277
type: object
278+
distanceThreshold:
279+
type: number
278280
embedding:
279281
properties:
280282
azureOpenai:

install/helm/gloo/crds/gateway.solo.io_v1_RouteTable.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,8 @@ spec:
385385
type: boolean
386386
type: object
387387
type: object
388+
distanceThreshold:
389+
type: number
388390
embedding:
389391
properties:
390392
azureOpenai:

install/helm/gloo/crds/gateway.solo.io_v1_VirtualService.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -3492,6 +3492,8 @@ spec:
34923492
type: boolean
34933493
type: object
34943494
type: object
3495+
distanceThreshold:
3496+
type: number
34953497
embedding:
34963498
properties:
34973499
azureOpenai:

projects/gloo/api/v1/enterprise/options/ai/ai.proto

+9
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ message SemanticCache {
431431
//
432432
// +kubebuilder:validation:Minimum=0
433433
// +kubebuilder:validation:Maximum=1
434+
// Deprecated: Prefer setting the distance threshold in the RouteOptions.SemanticCache resource.
434435
float score_threshold = 2;
435436
}
436437

@@ -474,6 +475,14 @@ message SemanticCache {
474475
uint32 ttl = 3;
475476
// The caching mode to use for the request and response lifecycle. Supported values include `READ_WRITE` or `READ_ONLY`.
476477
Mode mode = 4;
478+
479+
// Distance score threshold value between 0.0 and 1.0 that determines how similar
480+
// two queries must be in order to return a cached result.
481+
// The lower the number, the more similar the queries must be for a cache hit.
482+
//
483+
// +kubebuilder:validation:Minimum=0
484+
// +kubebuilder:validation:Maximum=1
485+
float distance_threshold = 5;
477486
}
478487

479488
// [Retrieval augmented generation (RAG)](https://research.ibm.com/blog/retrieval-augmented-generation-RAG)

projects/gloo/pkg/api/v1/enterprise/options/ai/ai.pb.clone.go

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

projects/gloo/pkg/api/v1/enterprise/options/ai/ai.pb.equal.go

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)