Skip to content

Commit d702600

Browse files
Update modelfield options and callout (#622)
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com> (cherry picked from commit 33ae93f) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 39ed7aa commit d702600

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

common/constants.ts

+2
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ export const SEARCH_PIPELINE_DOCS_LINK =
259259
'https://opensearch.org/docs/latest/search-plugins/search-pipelines/using-search-pipeline/';
260260
export const ML_RESPONSE_PROCESSOR_EXAMPLE_DOCS_LINK =
261261
'https://opensearch.org/docs/latest/search-plugins/search-pipelines/ml-inference-search-response/#example-externally-hosted-text-embedding-model';
262+
export const UPDATE_MODEL_DOCS_LINK =
263+
'https://opensearch.org/docs/latest/ml-commons-plugin/api/model-apis/update-model/';
262264

263265
/**
264266
* Text chunking algorithm constants

public/pages/workflow_detail/workflow_inputs/input_fields/model_field.tsx

+23-7
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ import {
1818
EuiSmallButtonIcon,
1919
EuiFlexGroup,
2020
EuiFlexItem,
21+
EuiHealth,
2122
} from '@elastic/eui';
2223
import {
2324
MODEL_STATE,
2425
WorkflowFormValues,
2526
ModelFormValue,
2627
ML_CHOOSE_MODEL_LINK,
2728
FETCH_ALL_QUERY_LARGE,
29+
UPDATE_MODEL_DOCS_LINK,
2830
} from '../../../../../common';
2931
import { AppState, searchModels, useAppDispatch } from '../../../../store';
3032
import { getDataSourceId } from '../../../../utils';
@@ -92,8 +94,15 @@ export function ModelField(props: ModelFieldProps) {
9294
<>
9395
<EuiCallOut
9496
size="s"
95-
title="The selected model does not have a model interface. Cannot automatically determine model inputs and outputs."
96-
iconType={'alert'}
97+
title={
98+
<EuiText size="s">
99+
This model has no interface set up yet.{' '}
100+
<EuiLink href={UPDATE_MODEL_DOCS_LINK} target="_blank">
101+
Learn more
102+
</EuiLink>{' '}
103+
about updating a model. Refresh the list when you finish.
104+
</EuiText>
105+
}
97106
color="warning"
98107
/>
99108
<EuiSpacer size="s" />
@@ -137,12 +146,19 @@ export function ModelField(props: ModelFieldProps) {
137146
),
138147
dropdownDisplay: (
139148
<>
140-
<EuiText size="s">{option.name}</EuiText>
141-
<EuiText size="xs" color="subdued">
142-
Deployed
143-
</EuiText>
149+
<EuiHealth
150+
color={
151+
isEmpty(option.interface)
152+
? 'warning'
153+
: 'success'
154+
}
155+
>
156+
<EuiText size="s">{option.name}</EuiText>
157+
</EuiHealth>
144158
<EuiText size="xs" color="subdued">
145-
{option.algorithm}
159+
{isEmpty(option.interface)
160+
? 'Not ready - no model interface'
161+
: 'Deployed'}
146162
</EuiText>
147163
</>
148164
),

public/pages/workflow_detail/workflow_inputs/processor_inputs/ml_processor_inputs/ml_processor_inputs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export function MLProcessorInputs(props: MLProcessorInputsProps) {
224224
) : (
225225
<ModelField
226226
fieldPath={modelFieldPath}
227-
hasModelInterface={modelInterface !== undefined}
227+
hasModelInterface={!isEmpty(modelInterface)}
228228
onModelChange={onModelChange}
229229
/>
230230
)}

0 commit comments

Comments
 (0)