-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Onboard ML inference ingest processor (#172)
Signed-off-by: Tyler Ohlsen <[email protected]> (cherry picked from commit f077c82)
- Loading branch information
1 parent
191d0dc
commit 8004a2d
Showing
19 changed files
with
361 additions
and
234 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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
*/ | ||
|
||
export * from './text_embedding_processor'; | ||
export * from './ml_ingest_processor'; |
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,18 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { generateId } from '../../utils'; | ||
import { MLProcessor } from '../ml_processor'; | ||
|
||
/** | ||
* The ML processor in the context of ingest | ||
*/ | ||
export class MLIngestProcessor extends MLProcessor { | ||
constructor() { | ||
super(); | ||
this.id = generateId('ml_ingest_processor'); | ||
this.name = 'ML ingest processor'; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { BaseConfig } from './base_config'; | ||
|
||
/** | ||
* A generic ML processor config. Used in ingest and search flows. | ||
* The interfaces are identical across ingest / search request / search response processors. | ||
*/ | ||
export abstract class MLProcessor extends BaseConfig { | ||
constructor() { | ||
super(); | ||
this.fields = [ | ||
{ | ||
label: 'Model', | ||
id: 'model', | ||
type: 'model', | ||
helpText: 'The model ID.', | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ml-commons-plugin/integrating-ml-models/#choosing-a-model', | ||
}, | ||
{ | ||
label: 'Input Map', | ||
id: 'inputMap', | ||
type: 'map', | ||
helpText: `An array specifying how to map fields from the ingested document to the model’s input.`, | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ingest-pipelines/processors/ml-inference/#configuration-parameters', | ||
}, | ||
{ | ||
label: 'Output Map', | ||
id: 'outputMap', | ||
type: 'map', | ||
helpText: `An array specifying how to map the model’s output to new fields.`, | ||
helpLink: | ||
'https://opensearch.org/docs/latest/ingest-pipelines/processors/ml-inference/#configuration-parameters', | ||
}, | ||
]; | ||
} | ||
} |
Oops, something went wrong.