Skip to content

Commit eac8012

Browse files
pmbrullclaude
andcommitted
fix(llm): address PR review feedback
- Bedrock extractText concatenates all text blocks (avoid truncating multi-block Converse output) - drop unused applicationConfig param from getEmbeddingConfigurationMessage - regenerate TS types for the llmConfiguration.embeddings / naturalLanguageSearch schema change Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c5052be commit eac8012

5 files changed

Lines changed: 86 additions & 386 deletions

File tree

openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/SystemRepository.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ StepValidation getEmbeddingsValidation(OpenMetadataApplicationConfig application
730730
.withPassed(false);
731731
}
732732

733-
String configMessage = getEmbeddingConfigurationMessage(applicationConfig);
733+
String configMessage = getEmbeddingConfigurationMessage();
734734

735735
if (searchRepository.getVectorIndexService() == null) {
736736
return retryInitAndReportError(
@@ -884,7 +884,7 @@ private StepValidation validateEmbeddingGeneration(
884884
.withPassed(true);
885885
}
886886

887-
private String getEmbeddingConfigurationMessage(OpenMetadataApplicationConfig applicationConfig) {
887+
private String getEmbeddingConfigurationMessage() {
888888
try {
889889
LLMConfiguration llmConfig = LlmConfigHolder.get();
890890
LLMEmbeddingsConfig embeddings = llmConfig != null ? llmConfig.getEmbeddings() : null;

openmetadata-service/src/main/java/org/openmetadata/service/llm/BedrockCompletionClient.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,15 @@ static CompletionResult toResult(ConverseResponse response) {
118118
}
119119

120120
private static String extractText(ConverseResponse response) {
121-
String text = "";
121+
StringBuilder text = new StringBuilder();
122122
if (response.output() != null && response.output().message() != null) {
123123
for (ContentBlock block : response.output().message().content()) {
124124
if (block.text() != null) {
125-
text = block.text();
126-
break;
125+
text.append(block.text());
127126
}
128127
}
129128
}
130-
return text;
129+
return text.toString();
131130
}
132131

133132
@Override

openmetadata-ui/src/main/resources/ui/src/generated/configuration/elasticSearchConfiguration.ts

Lines changed: 9 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,6 @@ export interface Aws {
118118
* Configuration for natural language search capabilities
119119
*/
120120
export interface NaturalLanguageSearch {
121-
/**
122-
* AWS Bedrock configuration for natural language processing
123-
*/
124-
bedrock?: Bedrock;
125-
/**
126-
* Embedding generation using Deep Java Library (DJL)
127-
*/
128-
djl?: Djl;
129-
/**
130-
* The provider to use for generating vector embeddings (e.g., bedrock, openai, google, djl).
131-
*/
132-
embeddingProvider?: string;
133121
/**
134122
* Enable or disable natural language search
135123
*/
@@ -138,10 +126,6 @@ export interface NaturalLanguageSearch {
138126
* NLQ filter extractor cache and prompt tuning.
139127
*/
140128
filterExtractor?: FilterExtractor;
141-
/**
142-
* Google Gemini configuration for embedding generation via the Generative Language API.
143-
*/
144-
google?: Google;
145129
/**
146130
* Hybrid search runtime tuning combining BM25 keyword and KNN semantic queries.
147131
*/
@@ -150,16 +134,6 @@ export interface NaturalLanguageSearch {
150134
* Weight for BM25 keyword search results in hybrid RRF pipeline (0.0-1.0)
151135
*/
152136
keywordWeight?: number;
153-
/**
154-
* Maximum number of concurrent embedding and NLQ provider requests. Controls the semaphore
155-
* used to throttle calls to the providers and prevent overwhelming HTTP/2 connection limits.
156-
*/
157-
maxConcurrentRequests?: number;
158-
/**
159-
* OpenAI configuration for embedding generation. Supports both OpenAI and Azure OpenAI
160-
* endpoints.
161-
*/
162-
openai?: Openai;
163137
/**
164138
* Fully qualified class name of the NLQService implementation to use
165139
*/
@@ -174,93 +148,6 @@ export interface NaturalLanguageSearch {
174148
semanticWeight?: number;
175149
}
176150

177-
/**
178-
* AWS Bedrock configuration for natural language processing
179-
*/
180-
export interface Bedrock {
181-
/**
182-
* AWS credentials configuration for Bedrock service
183-
*/
184-
awsConfig?: AWSBaseConfig;
185-
/**
186-
* Dimension of the embedding vector
187-
*/
188-
embeddingDimension?: number;
189-
/**
190-
* Bedrock embedding model identifier to use for vector search
191-
*/
192-
embeddingModelId?: string;
193-
/**
194-
* Maximum tokens the Bedrock model is allowed to generate.
195-
*/
196-
maxTokens?: number;
197-
/**
198-
* Bedrock model identifier to use for query transformation
199-
*/
200-
modelId?: string;
201-
/**
202-
* Sampling temperature for Bedrock requests.
203-
*/
204-
temperature?: number;
205-
/**
206-
* Bedrock InvokeModel API call timeout in seconds.
207-
*/
208-
timeoutSeconds?: number;
209-
}
210-
211-
/**
212-
* AWS credentials configuration for Bedrock service
213-
*
214-
* Base AWS configuration for authentication. Supports static credentials, IAM roles, and
215-
* default credential provider chain.
216-
*/
217-
export interface AWSBaseConfig {
218-
/**
219-
* AWS Access Key ID. Falls back to default credential provider chain if not set.
220-
*/
221-
accessKeyId?: string;
222-
/**
223-
* ARN of IAM role to assume for cross-account access.
224-
*/
225-
assumeRoleArn?: string;
226-
/**
227-
* Session name for assumed role.
228-
*/
229-
assumeRoleSessionName?: string;
230-
/**
231-
* Enable AWS IAM authentication. When enabled, uses the default credential provider chain
232-
* (environment variables, instance profile, etc.). Defaults to false for backward
233-
* compatibility.
234-
*/
235-
enabled?: boolean;
236-
/**
237-
* Custom endpoint URL for AWS-compatible services (MinIO, LocalStack).
238-
*/
239-
endpointUrl?: string;
240-
/**
241-
* AWS Region (e.g., us-east-1). Required when AWS authentication is enabled.
242-
*/
243-
region?: string;
244-
/**
245-
* AWS Secret Access Key. Falls back to default credential provider chain if not set.
246-
*/
247-
secretAccessKey?: string;
248-
/**
249-
* AWS Session Token for temporary credentials.
250-
*/
251-
sessionToken?: string;
252-
}
253-
254-
/**
255-
* Embedding generation using Deep Java Library (DJL)
256-
*/
257-
export interface Djl {
258-
/**
259-
* DJL model name for embedding generation
260-
*/
261-
embeddingModel?: string;
262-
}
263-
264151
/**
265152
* NLQ filter extractor cache and prompt tuning.
266153
*/
@@ -277,40 +164,23 @@ export interface FilterExtractor {
277164
* Max sample values shown per filter category in the system prompt.
278165
*/
279166
maxSampleValues?: number;
280-
}
281-
282-
/**
283-
* Google Gemini configuration for embedding generation via the Generative Language API.
284-
*/
285-
export interface Google {
286-
/**
287-
* API key from Google AI Studio for authenticating with the Generative Language API.
288-
*/
289-
apiKey?: string;
290167
/**
291-
* Dimension of the embedding vector, sent to Google as `outputDimensionality`. For
292-
* `gemini-embedding-001` valid values are 768, 1536, or 3072. For `text-embedding-004` use
293-
* 768.
168+
* Maximum tokens the model may generate for NLQ filter extraction.
294169
*/
295-
embeddingDimension?: number;
170+
maxTokens?: number;
296171
/**
297-
* Gemini embedding model identifier (e.g., gemini-embedding-001, text-embedding-004).
172+
* Optional model override for NLQ filter extraction. Leave empty to use the model from
173+
* llmConfiguration.
298174
*/
299-
embeddingModelId?: string;
175+
modelId?: string;
300176
/**
301-
* Optional override for the full embedding endpoint URL. Must be the complete URL including
302-
* the model and `:embedContent` action (e.g.
303-
* `https://generativelanguage.googleapis.com/v1beta/models/text-embedding-004:embedContent`),
304-
* not just a base URL. Leave empty to use the default Generative Language API endpoint,
305-
* which is constructed from `embeddingModelId`. The `key` query parameter is appended
306-
* automatically.
177+
* Sampling temperature for NLQ filter extraction.
307178
*/
308-
endpoint?: string;
179+
temperature?: number;
309180
/**
310-
* Gemini chat model identifier for query transformation (e.g., gemini-2.5-flash,
311-
* gemini-1.5-flash).
181+
* Per-call timeout in seconds for NLQ filter extraction completion.
312182
*/
313-
modelId?: string;
183+
timeoutSeconds?: number;
314184
}
315185

316186
/**
@@ -339,54 +209,6 @@ export interface HybridSearch {
339209
semanticScoreThreshold?: number;
340210
}
341211

342-
/**
343-
* OpenAI configuration for embedding generation. Supports both OpenAI and Azure OpenAI
344-
* endpoints.
345-
*/
346-
export interface Openai {
347-
/**
348-
* API key for authenticating with OpenAI or Azure OpenAI.
349-
*/
350-
apiKey?: string;
351-
/**
352-
* Azure OpenAI API version. Only used with Azure OpenAI.
353-
*/
354-
apiVersion?: string;
355-
/**
356-
* Azure OpenAI deployment name. Required when using Azure OpenAI.
357-
*/
358-
deploymentName?: string;
359-
/**
360-
* Dimension of the embedding vector. Default is 1536 for text-embedding-3-small.
361-
*/
362-
embeddingDimension?: number;
363-
/**
364-
* OpenAI embedding model identifier (e.g., text-embedding-3-small, text-embedding-ada-002).
365-
*/
366-
embeddingModelId?: string;
367-
/**
368-
* Custom endpoint URL. For Azure OpenAI, use the Azure resource endpoint (e.g.,
369-
* https://your-resource.openai.azure.com). Leave empty for standard OpenAI API.
370-
*/
371-
endpoint?: string;
372-
/**
373-
* Maximum tokens the OpenAI model is allowed to generate.
374-
*/
375-
maxTokens?: number;
376-
/**
377-
* OpenAI model identifier to use for query transformation (chat completions).
378-
*/
379-
modelId?: string;
380-
/**
381-
* Sampling temperature for OpenAI requests.
382-
*/
383-
temperature?: number;
384-
/**
385-
* OpenAI HTTP request and connect timeout in seconds.
386-
*/
387-
timeoutSeconds?: number;
388-
}
389-
390212
/**
391213
* This schema defines the language options available for search index mappings.
392214
*/

openmetadata-ui/src/main/resources/ui/src/generated/configuration/llmConfiguration.ts

Lines changed: 63 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,24 @@
1616
*/
1717
export interface LlmConfiguration {
1818
anthropic?: Anthropic;
19-
bedrock?: Bedrock;
19+
bedrock?: LlmConfigurationBedrock;
20+
/**
21+
* Vector embedding configuration for semantic search. Credentials are reused from the
22+
* sibling provider blocks (bedrock.awsConfig, openai.apiKey/endpoint,
23+
* google.apiKey/endpoint); this section selects the embedding provider and per-provider
24+
* embedding model. The embedding provider may differ from the chat completion provider.
25+
*/
26+
embeddings?: Embeddings;
2027
/**
2128
* Whether LLM completion features are enabled.
2229
*/
2330
enabled?: boolean;
24-
google?: Google;
31+
google?: LlmConfigurationGoogle;
2532
/**
2633
* Maximum number of concurrent LLM completion requests.
2734
*/
2835
maxConcurrentRequests?: number;
29-
openai?: Openai;
36+
openai?: LlmConfigurationOpenai;
3037
provider?: LlmProvider;
3138
}
3239

@@ -39,7 +46,7 @@ export interface Anthropic {
3946
timeoutSeconds?: number;
4047
}
4148

42-
export interface Bedrock {
49+
export interface LlmConfigurationBedrock {
4350
/**
4451
* AWS credentials configuration for Bedrock service.
4552
*/
@@ -93,7 +100,57 @@ export interface AWSBaseConfig {
93100
sessionToken?: string;
94101
}
95102

96-
export interface Google {
103+
/**
104+
* Vector embedding configuration for semantic search. Credentials are reused from the
105+
* sibling provider blocks (bedrock.awsConfig, openai.apiKey/endpoint,
106+
* google.apiKey/endpoint); this section selects the embedding provider and per-provider
107+
* embedding model. The embedding provider may differ from the chat completion provider.
108+
*/
109+
export interface Embeddings {
110+
bedrock?: EmbeddingsBedrock;
111+
djl?: Djl;
112+
google?: EmbeddingsGoogle;
113+
/**
114+
* Maximum number of concurrent embedding requests.
115+
*/
116+
maxConcurrentRequests?: number;
117+
openai?: EmbeddingsOpenai;
118+
/**
119+
* Embedding provider to use for semantic search vectors.
120+
*/
121+
provider?: Provider;
122+
}
123+
124+
export interface EmbeddingsBedrock {
125+
embeddingDimension?: number;
126+
embeddingModelId?: string;
127+
}
128+
129+
export interface Djl {
130+
embeddingModel?: string;
131+
}
132+
133+
export interface EmbeddingsGoogle {
134+
embeddingDimension?: number;
135+
embeddingModelId?: string;
136+
}
137+
138+
export interface EmbeddingsOpenai {
139+
embeddingDimension?: number;
140+
embeddingModelId?: string;
141+
}
142+
143+
/**
144+
* Embedding provider to use for semantic search vectors.
145+
*/
146+
export enum Provider {
147+
Bedrock = "bedrock",
148+
Djl = "djl",
149+
Google = "google",
150+
Openai = "openai",
151+
}
152+
153+
export interface LlmConfigurationGoogle {
97154
apiKey?: string;
98155
endpoint?: string;
99156
maxTokens?: number;
@@ -102,7 +159,7 @@ export interface Google {
102159
timeoutSeconds?: number;
103160
}
104161

105-
export interface Openai {
162+
export interface LlmConfigurationOpenai {
106163
apiKey?: string;
107164
apiVersion?: string;
108165
deploymentName?: string;

0 commit comments

Comments
 (0)