mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Inference Endpoints View] Adds Amazon Bedrock to Deletion, search and filtering of inference endpoints (#188670)
## Summary Adds Amazon Bedrock support to the [Inference Endpoints management UI](https://github.com/elastic/kibana/pull/186206) (`relevance/inference_endpoints`) management list view. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
841e95c64b
commit
25960d251e
6 changed files with 61 additions and 0 deletions
|
@ -259,6 +259,16 @@ export type InferenceServiceSettings =
|
|||
api_key: string;
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
| {
|
||||
service: 'amazonbedrock';
|
||||
service_settings: {
|
||||
access_key: string;
|
||||
secret_key: string;
|
||||
region: string;
|
||||
provider: string;
|
||||
model: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type InferenceAPIConfigResponse = {
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
<svg width="80" height="80" viewBox="0 0 80 80" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1_4)">
|
||||
<path d="M74 0H6C2.68629 0 0 2.68629 0 6V74C0 77.3137 2.68629 80 6 80H74C77.3137 80 80 77.3137 80 74V6C80 2.68629 77.3137 0 74 0Z" fill="#01A88D"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M64 38.9999C62.897 38.9999 62 38.1029 62 36.9999C62 35.8969 62.897 34.9999 64 34.9999C65.103 34.9999 66 35.8969 66 36.9999C66 38.1029 65.103 38.9999 64 38.9999ZM32.113 65.9079L28.865 64.0139L35.53 59.8479L34.47 58.1519L26.913 62.8749L21 59.4259V50.5349L26.555 46.8319L25.445 45.1679L19.959 48.8249L14 45.4199V40.5799L20.496 36.8679L19.504 35.1319L14 38.2769V34.5799L20 31.1519L26 34.5799V38.4339L21.485 41.1429L22.515 42.8569L27 40.1659L31.485 42.8569L32.515 41.1429L28 38.4339V34.5349L33.555 30.8319C33.833 30.6459 34 30.3339 34 29.9999V22.9999H32V29.4649L26.959 32.8249L21 29.4199V20.5739L26 17.6579V25.9999H28V16.4909L32.113 14.0919L40 16.7209V45.4339L25.485 54.1429L26.515 55.8569L40 47.7659V63.2789L32.113 65.9079ZM62 49.9999C62 51.1029 61.103 51.9999 60 51.9999C58.897 51.9999 58 51.1029 58 49.9999C58 48.8969 58.897 47.9999 60 47.9999C61.103 47.9999 62 48.8969 62 49.9999ZM52 59.9999C52 61.1029 51.103 61.9999 50 61.9999C48.897 61.9999 48 61.1029 48 59.9999C48 58.8969 48.897 57.9999 50 57.9999C51.103 57.9999 52 58.8969 52 59.9999ZM51 19.9999C51 18.8969 51.897 17.9999 53 17.9999C54.103 17.9999 55 18.8969 55 19.9999C55 21.1029 54.103 21.9999 53 21.9999C51.897 21.9999 51 21.1029 51 19.9999ZM64 32.9999C62.141 32.9999 60.589 34.2799 60.142 35.9999H42V30.9999H53C53.553 30.9999 54 30.5519 54 29.9999V23.8579C55.72 23.4109 57 21.8579 57 19.9999C57 17.7939 55.206 15.9999 53 15.9999C50.794 15.9999 49 17.7939 49 19.9999C49 21.8579 50.28 23.4109 52 23.8579V28.9999H42V15.9999C42 15.5689 41.725 15.1879 41.316 15.0509L32.316 12.0509C32.042 11.9609 31.744 11.9909 31.496 12.1359L19.496 19.1359C19.188 19.3149 19 19.6449 19 19.9999V29.4199L12.504 33.1319C12.192 33.3099 12 33.6409 12 33.9999V45.9999C12 46.3589 12.192 46.6899 12.504 46.8679L19 50.5799V59.9999C19 60.3549 19.188 60.6849 19.496 60.8639L31.496 67.8639C31.65 67.9539 31.825 67.9999 32 67.9999C32.106 67.9999 32.213 67.9829 32.316 67.9489L41.316 64.9489C41.725 64.8119 42 64.4309 42 63.9999V51.9999H49V56.1419C47.28 56.5889 46 58.1419 46 59.9999C46 62.2059 47.794 63.9999 50 63.9999C52.206 63.9999 54 62.2059 54 59.9999C54 58.1419 52.72 56.5889 51 56.1419V50.9999C51 50.4479 50.553 49.9999 50 49.9999H42V44.9999H54.5L56.638 47.8499C56.239 48.4719 56 49.2069 56 49.9999C56 52.2059 57.794 53.9999 60 53.9999C62.206 53.9999 64 52.2059 64 49.9999C64 47.7939 62.206 45.9999 60 45.9999C59.316 45.9999 58.682 46.1879 58.119 46.4919L55.8 43.3999C55.611 43.1479 55.314 42.9999 55 42.9999H42V37.9999H60.142C60.589 39.7199 62.141 40.9999 64 40.9999C66.206 40.9999 68 39.2059 68 36.9999C68 34.7939 66.206 32.9999 64 32.9999Z" fill="white"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1_4">
|
||||
<rect width="80" height="80" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
After Width: | Height: | Size: 3 KiB |
|
@ -265,6 +265,26 @@ describe('RenderEndpoint component tests', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('with amazonbedrock service', () => {
|
||||
const mockEndpoint = {
|
||||
model_id: 'amazon-bedrock-1',
|
||||
service: 'amazonbedrock',
|
||||
service_settings: {
|
||||
region: 'us-west-1',
|
||||
provider: 'AMAZONTITAN',
|
||||
model: 'model-bedrock-xyz',
|
||||
},
|
||||
} as any;
|
||||
|
||||
it('renders the component with endpoint details', () => {
|
||||
render(<EndpointInfo endpoint={mockEndpoint} />);
|
||||
|
||||
expect(screen.getByText('amazon-bedrock-1')).toBeInTheDocument();
|
||||
expect(screen.getByText('model-bedrock-xyz')).toBeInTheDocument();
|
||||
expect(screen.getByText('region: us-west-1, provider: amazontitan')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('for MIT licensed models', () => {
|
||||
const mockEndpointWithMitLicensedModel = {
|
||||
model_id: 'model-123',
|
||||
|
|
|
@ -94,6 +94,8 @@ function endpointModelAtrributes(endpoint: InferenceAPIConfigResponse) {
|
|||
return mistralAttributes(endpoint);
|
||||
case ServiceProviderKeys.googleaistudio:
|
||||
return googleAIStudioAttributes(endpoint);
|
||||
case ServiceProviderKeys.amazonbedrock:
|
||||
return amazonBedrockAttributes(endpoint);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
@ -175,6 +177,18 @@ function mistralAttributes(endpoint: InferenceAPIConfigResponse) {
|
|||
.join(', ');
|
||||
}
|
||||
|
||||
function amazonBedrockAttributes(endpoint: InferenceAPIConfigResponse) {
|
||||
const serviceSettings = endpoint.service_settings;
|
||||
|
||||
const region = 'region' in serviceSettings ? serviceSettings.region : undefined;
|
||||
const provider =
|
||||
'provider' in serviceSettings ? serviceSettings.provider.toLocaleLowerCase() : undefined;
|
||||
|
||||
return [region && `region: ${region}`, provider && `provider: ${provider}`]
|
||||
.filter(Boolean)
|
||||
.join(', ');
|
||||
}
|
||||
|
||||
function googleAIStudioAttributes(endpoint: InferenceAPIConfigResponse) {
|
||||
const serviceSettings = endpoint.service_settings;
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import azureAIStudioIcon from '../../../../assets/images/providers/azure_ai_stud
|
|||
import azureOpenAIIcon from '../../../../assets/images/providers/azure_open_ai.svg';
|
||||
import googleAIStudioIcon from '../../../../assets/images/providers/google_ai_studio.svg';
|
||||
import mistralIcon from '../../../../assets/images/providers/mistral.svg';
|
||||
import amazonBedrockIcon from '../../../../assets/images/providers/amazon_bedrock.svg';
|
||||
import { ServiceProviderKeys } from '../../types';
|
||||
|
||||
interface ServiceProviderProps {
|
||||
|
@ -27,6 +28,10 @@ interface ServiceProviderRecord {
|
|||
}
|
||||
|
||||
export const SERVICE_PROVIDERS: Record<ServiceProviderKeys, ServiceProviderRecord> = {
|
||||
[ServiceProviderKeys.amazonbedrock]: {
|
||||
icon: amazonBedrockIcon,
|
||||
name: 'Amazon Bedrock',
|
||||
},
|
||||
[ServiceProviderKeys.azureaistudio]: {
|
||||
icon: azureAIStudioIcon,
|
||||
name: 'Azure AI Studio',
|
||||
|
|
|
@ -9,6 +9,7 @@ import { InferenceAPIConfigResponse } from '@kbn/ml-trained-models-utils';
|
|||
export const INFERENCE_ENDPOINTS_TABLE_PER_PAGE_VALUES = [10, 25, 50, 100];
|
||||
|
||||
export enum ServiceProviderKeys {
|
||||
amazonbedrock = 'amazonbedrock',
|
||||
azureopenai = 'azureopenai',
|
||||
azureaistudio = 'azureaistudio',
|
||||
cohere = 'cohere',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue