-
Notifications
You must be signed in to change notification settings - Fork 332
Enable internal text embedding API #3441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0dc589e
d3187bd
6064826
0653f15
21e81b9
0cd8e53
7fa1c49
c3f6937
1e18c25
857203a
89cb2d9
64b592e
e8d7238
d9c8a29
3e02c0f
5c05464
c9eba20
d3a5209
203e232
2cb3999
b432e4f
a8442f4
a301290
5f12542
bd84c84
fb59389
7100b8a
73658de
ece97ae
d065f4b
c33c643
a3f0b1d
1d6f9ea
8a00bad
f2261f6
1ece78a
896a111
d3e0413
4c073aa
17414c6
d8f66b0
17fba18
d61b340
0d97b0b
da2bc83
b8f84bc
b00e9ef
f83e119
c220bbd
215873a
8095db5
a4a1b6d
1c44f45
6cd5fe8
437bad5
48b1020
f6b830a
2ffd643
fac1c38
02b72c9
85326de
202aed4
d79c80e
32448bc
fc26f9e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -770,6 +770,195 @@ | |
| "default": 4 | ||
| } | ||
| } | ||
| }, | ||
| "embeddings": { | ||
| "type": "object", | ||
| "description": "Configuration for text embedding/vectorization service. Supports OpenAI and Azure OpenAI providers.", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "Whether the embedding service is enabled. Defaults to true.", | ||
| "default": true | ||
| }, | ||
| "provider": { | ||
| "type": "string", | ||
| "description": "The embedding provider type.", | ||
| "enum": ["azure-openai", "openai"] | ||
| }, | ||
| "base-url": { | ||
| "type": "string", | ||
| "description": "The provider base URL. For Azure OpenAI, use the Azure resource endpoint. For OpenAI, use https://api.openai.com." | ||
| }, | ||
| "api-key": { | ||
| "type": "string", | ||
| "description": "The API key for authentication. Supports environment variable substitution with @env('VAR_NAME')." | ||
| }, | ||
| "model": { | ||
| "type": "string", | ||
| "description": "The model or deployment name. Required for Azure OpenAI (deployment name). For OpenAI, defaults to 'text-embedding-3-small' if not specified." | ||
| }, | ||
| "api-version": { | ||
| "type": "string", | ||
| "description": "Azure API version. Only used for Azure OpenAI provider.", | ||
| "default": "2023-05-15" | ||
| }, | ||
| "dimensions": { | ||
| "type": "integer", | ||
| "description": "Output vector dimensions. Defaults to 1536 if not specified. Useful for Redis schema alignment.", | ||
| "default": 1536, | ||
| "minimum": 1 | ||
| }, | ||
| "timeout-ms": { | ||
| "type": "integer", | ||
| "description": "Request timeout in milliseconds.", | ||
| "default": 30000, | ||
| "minimum": 1, | ||
| "maximum": 300000 | ||
| }, | ||
| "endpoint": { | ||
| "type": "object", | ||
| "description": "REST endpoint configuration for the embedding service.", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "Whether the /embed REST endpoint is enabled. Defaults to false.", | ||
| "default": false | ||
| }, | ||
| "path": { | ||
| "type": "string", | ||
| "description": "The URL path for the embedding endpoint. Defaults to '/embed'.", | ||
| "default": "/embed" | ||
| }, | ||
| "roles": { | ||
| "type": "array", | ||
| "description": "The roles allowed to access the embedding endpoint. Defaults to ['authenticated'].", | ||
| "default": ["authenticated"], | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "health": { | ||
| "type": "object", | ||
| "description": "Health check configuration for the embedding service.", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "Whether health checks are enabled for embeddings. Defaults to false.", | ||
| "default": false | ||
| }, | ||
| "threshold-ms": { | ||
| "type": "integer", | ||
| "description": "The maximum response time in milliseconds to be considered healthy.", | ||
| "default": 1000, | ||
| "minimum": 1, | ||
| "maximum": 300000 | ||
| }, | ||
| "test-text": { | ||
| "type": "string", | ||
| "description": "The text to use for health check validation.", | ||
| "default": "health check" | ||
| }, | ||
| "expected-dimensions": { | ||
| "type": "integer", | ||
| "description": "The expected number of dimensions in the embedding result. If specified, dimension validation is performed.", | ||
| "minimum": 1 | ||
| } | ||
| } | ||
| }, | ||
| "cache": { | ||
| "type": "object", | ||
| "description": "Cache configuration for embedding results.", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "Whether caching is enabled for embeddings. Defaults to true.", | ||
| "default": true | ||
| }, | ||
| "level": { | ||
| "type": "string", | ||
| "description": "Cache level (L1 for in-memory only, L1L2 for in-memory + distributed). Defaults to L1.", | ||
| "enum": ["L1", "L1L2"], | ||
| "default": "L1" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldnt the default cache be
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this phase we only support L1 via Fusion cache. In phase 2 we will enable support for L2 with redis which would default to L1 or L1L2 like you have suggested. |
||
| }, | ||
| "ttl-seconds": { | ||
| "type": "integer", | ||
| "description": "Time-to-live for cached embeddings in seconds. Defaults to 86400 (24 hours).", | ||
| "default": 86400, | ||
| "minimum": 1 | ||
| } | ||
| } | ||
| }, | ||
| "chunking": { | ||
| "type": "object", | ||
| "description": "Chunking configuration for text processing before embedding. Used to split large text inputs into smaller chunks.", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "Whether chunking is enabled. Defaults to true.", | ||
| "default": true | ||
| }, | ||
| "size-chars": { | ||
| "type": "integer", | ||
| "description": "The size of each chunk in characters.", | ||
| "default": 800, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PR description says default is 1000. What is the correct default?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified the PR description, you can refer to PRD as a SOT: #3331 |
||
| "minimum": 1 | ||
| }, | ||
| "overlap-chars": { | ||
| "type": "integer", | ||
| "description": "The number of characters to overlap between consecutive chunks. Overlap helps maintain context across chunk boundaries.", | ||
| "default": 100, | ||
| "minimum": 0 | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "required": ["provider", "base-url", "api-key"], | ||
| "allOf": [ | ||
| { | ||
| "$comment": "Azure OpenAI requires the model (deployment name) to be specified.", | ||
| "if": { | ||
| "properties": { | ||
| "provider": { | ||
| "const": "azure-openai" | ||
| } | ||
| }, | ||
| "required": ["provider"] | ||
| }, | ||
| "then": { | ||
| "required": ["model"], | ||
| "properties": { | ||
| "api-version": { | ||
| "type": "string", | ||
| "description": "Azure API version. Required for Azure OpenAI provider.", | ||
| "default": "2023-05-15" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "$comment": "OpenAI does not require model (defaults to text-embedding-3-small) and does not use api-version.", | ||
| "if": { | ||
| "properties": { | ||
| "provider": { | ||
| "const": "openai" | ||
| } | ||
| }, | ||
| "required": ["provider"] | ||
| }, | ||
| "then": { | ||
| "properties": { | ||
| "api-version": false | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.