Skip to content

Commit c3019d6

Browse files
committed
Generate ingest pipeline ID on the fly
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
1 parent e52c6ab commit c3019d6

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

public/component_types/transformer/text_embedding_transformer.ts

-8
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,6 @@ export class TextEmbeddingTransformer extends MLTransformer {
1818
this.baseClasses = [...this.baseClasses, this.type];
1919
this.inputs = [];
2020
this.createFields = [
21-
{
22-
label: 'Ingest Pipeline',
23-
id: 'ingestPipelineName',
24-
type: 'string',
25-
helpText:
26-
'The name of the ingest pipeline configured with the text embedding transformer',
27-
helpLink: 'https://opensearch.org/docs/latest/ingest-pipelines/',
28-
},
2921
{
3022
label: 'Model',
3123
id: 'model',

public/pages/workflow_detail/utils/workflow_to_template_utils.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
MPNET_SENTENCE_TRANSFORMER,
2929
BERT_SENTENCE_TRANSFORMER,
3030
REGISTER_LOCAL_PRETRAINED_MODEL_STEP_TYPE,
31+
generateId,
3132
} from '../../../../common';
3233

3334
/**
@@ -128,18 +129,15 @@ function toIngestPipelineNodes(flowNode: ReactFlowComponent): TemplateNode[] {
128129
switch (flowNode.data.type) {
129130
case COMPONENT_CLASS.TEXT_EMBEDDING_TRANSFORMER:
130131
default: {
131-
const {
132-
ingestPipelineName,
133-
model,
134-
inputField,
135-
vectorField,
136-
} = componentDataToFormik(flowNode.data) as {
137-
ingestPipelineName: string;
132+
const { model, inputField, vectorField } = componentDataToFormik(
133+
flowNode.data
134+
) as {
138135
model: ModelFormValue;
139136
inputField: string;
140137
vectorField: string;
141138
};
142139
const modelId = model.id;
140+
const ingestPipelineName = generateId('ingest_pipeline');
143141

144142
let registerModelStep = undefined as
145143
| RegisterPretrainedModelNode

0 commit comments

Comments
 (0)