-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tyler Ohlsen <[email protected]>
- Loading branch information
Showing
23 changed files
with
1,028 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { IConfig, IConfigField } from '../../common'; | ||
|
||
/** | ||
* A base UI config class. | ||
*/ | ||
export abstract class BaseConfig implements IConfig { | ||
id: string; | ||
fields: IConfigField[]; | ||
|
||
// No-op constructor. If there are general / defaults for field values, add in here. | ||
constructor() { | ||
this.id = ''; | ||
this.fields = []; | ||
} | ||
|
||
// Persist a standard toObj() fn that all component classes can use. This is necessary | ||
// so we have standard JS Object when serializing comoponent state in redux. | ||
toObj() { | ||
return Object.assign({}, this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './ingest_processors'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { BaseConfig } from '../base_config'; | ||
|
||
/** | ||
* A base ingest processor config | ||
*/ | ||
export abstract class BaseIngestProcessor extends BaseConfig { | ||
name: string; | ||
type: string; | ||
constructor() { | ||
super(); | ||
this.name = ''; | ||
this.type = ''; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
export * from './text_embedding_processor'; |
46 changes: 46 additions & 0 deletions
46
public/configs/ingest_processors/text_embedding_processor.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { generateId } from '../../utils'; | ||
import { BaseIngestProcessor } from './base_ingest_processor'; | ||
|
||
/** | ||
* A specialized text embedding processor config | ||
*/ | ||
export class TextEmbeddingProcessor extends BaseIngestProcessor { | ||
constructor() { | ||
super(); | ||
this.id = generateId('text_embedding_processor'); | ||
this.name = 'Text embedding processor'; | ||
this.type = 'text_embedding'; | ||
this.fields = [ | ||
{ | ||
label: 'Text Embedding Model', | ||
id: 'model', | ||
type: 'model', | ||
helpText: 'A text embedding model for embedding text.', | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ml-commons-plugin/integrating-ml-models/#choosing-a-model', | ||
}, | ||
{ | ||
label: 'Input Field', | ||
id: 'inputField', | ||
type: 'string', | ||
helpText: | ||
'The name of the document field from which to obtain text for generating text embeddings.', | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ingest-pipelines/processors/text-embedding/', | ||
}, | ||
{ | ||
label: 'Vector Field', | ||
id: 'vectorField', | ||
type: 'string', | ||
helpText: `The name of the document's vector field in which to store the generated text embeddings.`, | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ingest-pipelines/processors/text-embedding/', | ||
}, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.