diff --git a/common/constants.ts b/common/constants.ts index 1088940b..9e4453b4 100644 --- a/common/constants.ts +++ b/common/constants.ts @@ -115,7 +115,6 @@ export enum WORKFLOW_TYPE { SEMANTIC_SEARCH = 'Semantic search', MULTIMODAL_SEARCH = 'Multimodal search', HYBRID_SEARCH = 'Hybrid search', - SENTIMENT_ANALYSIS = 'Sentiment analysis', RAG = 'Retrieval-augmented generation', CUSTOM = 'Custom', UNKNOWN = 'Unknown', @@ -174,6 +173,8 @@ export const ML_INFERENCE_RESPONSE_DOCS_LINK = 'https://opensearch.org/docs/latest/search-plugins/search-pipelines/ml-inference-search-response/#request-fields'; export const ML_CHOOSE_MODEL_LINK = 'https://opensearch.org/docs/latest/ml-commons-plugin/integrating-ml-models/#choosing-a-model'; +export const ML_REMOTE_MODEL_LINK = + 'https://opensearch.org/docs/latest/ml-commons-plugin/remote-models/index/'; export const TEXT_CHUNKING_PROCESSOR_LINK = 'https://opensearch.org/docs/latest/ingest-pipelines/processors/text-chunking/'; export const CREATE_WORKFLOW_LINK = @@ -206,7 +207,6 @@ export const SHARED_OPTIONAL_FIELDS = ['max_chunk_limit', 'description', 'tag']; export const DEFAULT_TEXT_FIELD = 'my_text'; export const DEFAULT_VECTOR_FIELD = 'my_embedding'; export const DEFAULT_IMAGE_FIELD = 'my_image'; -export const DEFAULT_LABEL_FIELD = 'label'; export const DEFAULT_LLM_RESPONSE_FIELD = 'llm_response'; /** @@ -239,15 +239,6 @@ export const TERM_QUERY_TEXT = { }, }, }; -export const TERM_QUERY_LABEL = { - query: { - term: { - [LABEL_FIELD_PATTERN]: { - value: QUERY_TEXT_PATTERN, - }, - }, - }, -}; export const KNN_QUERY = { _source: { excludes: [VECTOR_FIELD_PATTERN], diff --git a/public/pages/workflow_detail/workflow_inputs/input_fields/model_field.tsx b/public/pages/workflow_detail/workflow_inputs/input_fields/model_field.tsx index cb8ec809..f4bddc8a 100644 --- a/public/pages/workflow_detail/workflow_inputs/input_fields/model_field.tsx +++ b/public/pages/workflow_detail/workflow_inputs/input_fields/model_field.tsx @@ -15,6 +15,7 @@ import { EuiCompressedSuperSelect, EuiSuperSelectOption, EuiText, + EuiSmallButton, } from '@elastic/eui'; import { MODEL_STATE, @@ -22,6 +23,7 @@ import { ModelFormValue, IConfigField, ML_CHOOSE_MODEL_LINK, + ML_REMOTE_MODEL_LINK, } from '../../../../../common'; import { AppState } from '../../../../store'; @@ -45,6 +47,7 @@ export function ModelField(props: ModelFieldProps) { // re-fetch here as it could overload client-side if user clicks back and forth / // keeps re-rendering this component (and subsequently re-fetching data) as they're building flows const models = useSelector((state: AppState) => state.ml.models); + //const models = {}; const { errors, touched, values } = useFormikContext(); @@ -83,6 +86,31 @@ export function ModelField(props: ModelFieldProps) { )} + {isEmpty(deployedModels) && ( + <> + + + To create and deploy models and make them accessible in + OpenSearch, see documentation. + + + + Documentation + + + + + )} {({ field, form }: FieldProps) => { return ( @@ -98,6 +126,7 @@ export function ModelField(props: ModelFieldProps) { helpText={'The model ID.'} > ({ diff --git a/public/pages/workflows/new_workflow/quick_configure_inputs.tsx b/public/pages/workflows/new_workflow/quick_configure_inputs.tsx index e5eb5f5c..e590ae4f 100644 --- a/public/pages/workflows/new_workflow/quick_configure_inputs.tsx +++ b/public/pages/workflows/new_workflow/quick_configure_inputs.tsx @@ -19,7 +19,6 @@ import { BEDROCK_DIMENSIONS, COHERE_DIMENSIONS, DEFAULT_IMAGE_FIELD, - DEFAULT_LABEL_FIELD, DEFAULT_LLM_RESPONSE_FIELD, DEFAULT_TEXT_FIELD, DEFAULT_VECTOR_FIELD, @@ -87,13 +86,6 @@ export function QuickConfigureInputs(props: QuickConfigureInputsProps) { }; break; } - case WORKFLOW_TYPE.SENTIMENT_ANALYSIS: { - defaultFieldValues = { - textField: DEFAULT_TEXT_FIELD, - labelField: DEFAULT_LABEL_FIELD, - }; - break; - } case WORKFLOW_TYPE.RAG: { defaultFieldValues = { textField: DEFAULT_TEXT_FIELD, @@ -188,17 +180,13 @@ export function QuickConfigureInputs(props: QuickConfigureInputsProps) { )} - {props.workflowType === WORKFLOW_TYPE.SENTIMENT_ANALYSIS && ( - - { - setFieldValues({ - ...fieldValues, - labelField: e.target.value, - }); - }} - /> - - )} {props.workflowType === WORKFLOW_TYPE.RAG && ( <> {selectedWorkflow?.ui_metadata === undefined || isEmpty(selectedWorkflow?.ui_metadata) || - selectedWorkflow?.ui_metadata?.type === WORKFLOW_TYPE.CUSTOM ? ( + selectedWorkflow?.ui_metadata?.type === WORKFLOW_TYPE.UNKNOWN ? ( Invalid workflow type} titleSize="s" body={ <> - Displaying resources from custom workflows is not + Displaying resources from workflows of unknown type is not currently supported. diff --git a/server/resources/templates/sentiment_analysis.json b/server/resources/templates/sentiment_analysis.json deleted file mode 100644 index 70db4a51..00000000 --- a/server/resources/templates/sentiment_analysis.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "Sentiment Analysis", - "description": "A basic workflow containing the ingest pipeline, search pipeline, and index configurations for performing sentiment analysis", - "version": { - "template": "1.0.0", - "compatibility": ["2.18.0", "3.0.0"] - }, - "ui_metadata": { - "type": "Sentiment analysis" - } -}