diff --git a/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.tsx b/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.tsx index ac465b98f267..5f854384dbb5 100644 --- a/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.tsx +++ b/x-pack/plugins/stack_connectors/public/connector_types/inference/connector.tsx @@ -123,7 +123,6 @@ const InferenceAPIConnectorFields: React.FunctionComponent p.task_type === taskType); setSelectedTaskType(taskType); - generateInferenceEndpointId(config, setFieldValue); // transform the schema const newTaskTypeSchema = Object.keys(newTaskType?.configuration ?? {}).map((k) => ({ @@ -151,6 +150,10 @@ const InferenceAPIConnectorFields: React.FunctionComponent = ({ const renderProviderOption = useCallback>( (option, searchValue) => { - const provider = SERVICE_PROVIDERS[option.label as ServiceProviderKeys]; + const provider = Object.keys(SERVICE_PROVIDERS).includes(option.label) + ? SERVICE_PROVIDERS[option.label as ServiceProviderKeys] + : undefined; + + const supportedBySolutions = (provider && + provider.solutions.map((solution) => ( + + {solution} + + ))) ?? ( + + {'Search' as ProviderSolution} + + ); return ( @@ -65,12 +79,7 @@ const SelectableProviderComponent: React.FC = ({ - {provider && - provider.solutions.map((solution) => ( - - {solution} - - ))} + {supportedBySolutions}