[Inference Endpoints View] Adds Alibaba AI Search to Deletion, search and filtering of inference endpoints (#190783)

Summary
Adds Alibaba AI Search support to the
https://github.com/elastic/kibana/pull/186206
(relevance/inference_endpoints) management list view.

The Elasticsearch PR is:
https://github.com/elastic/elasticsearch/pull/111181

I'm not very familiar with kibana. I made this PR from
https://github.com/elastic/kibana/pull/188670.

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Dima Arnautov <arnautov.dima@gmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
weizijun 2024-10-01 22:40:18 +08:00 committed by GitHub
parent 67f30433fd
commit 12205d51c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 85 additions and 0 deletions

View file

@ -265,6 +265,19 @@ export type InferenceServiceSettings =
url: string;
};
}
| {
service: 'alibabacloud-ai-search';
service_settings: {
api_key: string;
service_id: string;
host: string;
workspace: string;
http_schema: 'https' | 'http';
rate_limit: {
requests_per_minute: number;
};
};
}
| {
service: 'amazonbedrock';
service_settings: {

View file

@ -0,0 +1,46 @@
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 595.2 75" style="enable-background:new 0 0 595.2 75;" xml:space="preserve">
<style type="text/css">
.st0{fill:#ED6B1E;}
</style>
<rect x="40.1" y="32.8" class="st0" width="40.1" height="9"/>
<path class="st0" d="M100.2,0H73.7l6.4,9.1L99.5,15c3.6,1.1,5.9,4.5,5.8,8c0,0,0,0,0,0V52c0,0,0,0,0,0c0,3.6-2.3,6.9-5.8,8
l-19.3,5.9L73.7,75h26.5c11.1,0,20-9,20-20V20C120.3,9,111.3,0,100.2,0"/>
<path class="st0" d="M20,0h26.5l-6.4,9.1L20.8,15c-3.6,1.1-5.9,4.5-5.8,8c0,0,0,0,0,0V52c0,0,0,0,0,0c0,3.6,2.3,6.9,5.8,8l19.3,5.9
l6.4,9.1H20C9,75,0,66,0,55V20C0,9,9,0,20,0"/>
<path class="st0" d="M444.9,52.4c0,6.5-5.3,11.7-11.9,11.7c-6.6,0-11.9-5.3-11.9-11.7V23.7c0-6.5,5.3-11.7,11.9-11.7
c6.5,0,11.9,5.3,11.9,11.7V24h9.1v-0.4C454,12.3,444.6,3,433,3s-21,9.3-21,20.7v28.6c0,11.4,9.4,20.7,21,20.7
c11.5,0,20.9-9.3,21-20.7V52h-9.1V52.4z"/>
<path class="st0" d="M492.1,21.5c-9.6,0-17.6,7.5-18,17v17.6c0.5,9.5,8.4,17,18,17c9.6,0,17.5-7.5,18-17V38.5
C509.7,29,501.8,21.5,492.1,21.5 M501,55c-0.1,5-4,8.9-8.9,8.9c-4.9,0-8.8-3.9-8.9-8.9V39.5c0-4.9,4-8.9,8.9-8.9
c4.9,0,8.9,4,8.9,8.9V55z"/>
<rect x="458.5" y="3" class="st0" width="9.1" height="69"/>
<rect x="208.8" y="21.5" class="st0" width="9.1" height="50.4"/>
<rect x="190.7" y="3" class="st0" width="9.1" height="69"/>
<path class="st0" d="M167.8,3h-11.1l-18.3,68.9l0,0.1h9l4.9-18.3l20,0.1l4.8,18.2l0,0.1h9L167.8,3L167.8,3z M169.9,44.7h-15.2
l7.6-28.6L169.9,44.7z"/>
<path class="st0" d="M543.6,56c0,4.9-4,8.9-8.9,8.9c-4.9,0-8.9-4-8.9-8.9V21.5h-9.1v36c0,8.6,7,15.6,15.6,15.6
c1.6,0,3.1-0.2,4.6-0.7c0.9-0.3,1.7-0.6,2.5-1c1.4-0.7,2.7-1.6,3.8-2.7l0.4-0.4v3.7h9.1V21.5h-9.1V56z"/>
<rect x="208.8" y="3" class="st0" width="9.1" height="9.1"/>
<path class="st0" d="M247.3,21.5c-4.1,0-8,1.6-10.9,4.5l-0.4,0.4V3h-9.1v69h9.1v-3.7l0.4,0.4c2.9,2.9,6.8,4.5,10.9,4.5
c8.6,0,15.6-7,15.6-15.6V37.1C262.9,28.4,255.9,21.5,247.3,21.5 M253.9,38.7v17.1c0,4.9-4,9-9,9c-4.9,0-9-4-9-9V38.7c0-4.9,4-9,9-9
C249.9,29.8,253.9,33.8,253.9,38.7"/>
<path class="st0" d="M331.7,21.4c-4.1,0-8,1.6-10.9,4.5l-0.4,0.4V3h-9.1v69h9.1v-3.7l0.4,0.4c2.9,2.9,6.8,4.5,10.9,4.5
c8.6,0,15.6-7,15.6-15.6V37C347.3,28.4,340.3,21.4,331.7,21.4 M338.3,38.7v17.1c0,4.9-4,9-9,9c-4.9,0-9-4-9-9V38.7c0-4.9,4-9,9-9
C334.3,29.7,338.3,33.8,338.3,38.7"/>
<path class="st0" d="M586.2,3v23.3l-0.4-0.4c-2.9-2.9-6.8-4.5-10.9-4.5c-8.6,0-15.6,7-15.6,15.6v20.4l0,0.1c0,8.6,7,15.5,15.6,15.5
c4.1,0,8-1.6,10.9-4.5l0.4-0.4v3.7h9.1V3H586.2z M586.1,38.7v17.1c0,4.9-4,9-9,9c-4.9,0-9-4-9-9V38.7c0-4.9,4-9,9-9
C582.1,29.7,586.1,33.8,586.1,38.7"/>
<path class="st0" d="M304.8,38.6c0-0.5-0.1-1.1-0.2-1.8l0-0.2c-0.5-2.7-1.5-5.3-3.1-7.6c-3.2-4.5-8.1-7.2-13.5-7.5c-0.1,0-0.7,0-1,0
c-4.2,0-8.3,1.5-11.6,4.2c-3.2,2.7-5.4,6.4-6.2,10.6l0,0.1h8.9l0-0.1c0.8-4.2,4.5-7.2,8.7-7.2c2.3,0,4.5,0.9,6.2,2.5
c1.7,1.6,2.6,3.8,2.7,6.1l0,4.2h-12.9c-8.6,0-15.6,7-15.6,15.6c0,7.2,5,13.3,11.7,15.1c0.1,0,0.2,0,0.2,0.1c0.3,0.1,0.6,0.1,0.9,0.2
c0.3,0.1,0.7,0.1,1.1,0.2c0.1,0,0.1,0,0.2,0c0.7,0.1,1.5,0.1,2.4,0.1c2.2,0,4.1-0.3,5.4-0.8c2.3-0.7,4.4-2,6.2-3.7l0.4-0.4v3.7h9.1
v-6V38.6z M284.6,48.7h11v6.4c0,4.8-3.5,9-8.2,9.9c-0.7,0.2-1.4,0.2-2,0.2c-1.6,0-3.1-0.4-4.6-1.3c-0.4-0.2-0.8-0.5-1.2-0.7
c-0.5-0.4-1-0.9-1.4-1.4l-0.1-0.1c-1.1-1.4-1.7-3.1-1.7-4.9C276.5,52.3,280.1,48.7,284.6,48.7"/>
<path class="st0" d="M389.3,38.6c0-0.5-0.1-1.1-0.2-1.8l0-0.2c-0.5-2.7-1.5-5.3-3.1-7.6c-3.2-4.5-8.1-7.2-13.5-7.5c-0.1,0-0.7,0-1,0
c-4.2,0-8.3,1.5-11.6,4.2c-3.2,2.7-5.4,6.4-6.2,10.6l0,0.1h8.9l0-0.1c0.8-4.2,4.5-7.2,8.7-7.2c2.3,0,4.5,0.9,6.2,2.5
c1.7,1.6,2.6,3.8,2.7,6.1l0,4.2h-12.9c-8.6,0-15.6,7-15.6,15.6c0,7.2,5,13.3,11.7,15.1c0.1,0,0.2,0,0.2,0.1c0.3,0.1,0.6,0.1,0.9,0.2
c0.3,0.1,0.7,0.1,1.1,0.2c0.1,0,0.1,0,0.2,0c0.7,0.1,1.5,0.1,2.4,0.1c2.2,0,4.1-0.3,5.4-0.8c2.3-0.7,4.4-2,6.2-3.7l0.4-0.4v3.7h9.1
v-6V38.6z M369.1,48.7h11v6.4c0,4.8-3.5,9-8.2,9.9c-0.7,0.2-1.4,0.2-2,0.2c-1.6,0-3.1-0.4-4.6-1.3c-0.4-0.2-0.8-0.5-1.2-0.7
c-0.5-0.4-1-0.9-1.4-1.4l-0.1-0.1c-1.1-1.4-1.7-3.1-1.7-4.9C361,52.4,364.6,48.7,369.1,48.7"/>
</svg>

After

Width:  |  Height:  |  Size: 4 KiB

View file

@ -268,4 +268,24 @@ describe('ServiceProvider component', () => {
expect(screen.getByText('model-bedrock-xyz')).toBeInTheDocument();
});
});
describe('with alibabacloud-ai-search service', () => {
const mockEndpoint = {
inference_id: 'alibabacloud-ai-search-1',
service: 'alibabacloud-ai-search',
service_settings: {
service_id: 'service-123',
host: 'host-123',
workspace: 'default-123',
},
} as any;
it('renders the component with endpoint details', () => {
render(<ServiceProvider providerEndpoint={mockEndpoint} />);
expect(screen.getByText('AlibabaCloud AI Search')).toBeInTheDocument();
const icon = screen.getByTestId('table-column-service-provider-alibabacloud-ai-search');
expect(icon).toBeInTheDocument();
});
});
});

View file

@ -20,6 +20,7 @@ import azureOpenAIIcon from '../../../../assets/images/providers/azure_open_ai.s
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 alibabaCloudAISearchIcon from '../../../../assets/images/providers/alibaba_cloud_ai_search.svg';
import { ServiceProviderKeys } from '../../types';
import * as i18n from './translations';
@ -33,6 +34,10 @@ interface ServiceProviderRecord {
}
export const SERVICE_PROVIDERS: Record<ServiceProviderKeys, ServiceProviderRecord> = {
[ServiceProviderKeys['alibabacloud-ai-search']]: {
icon: alibabaCloudAISearchIcon,
name: 'AlibabaCloud AI Search',
},
[ServiceProviderKeys.amazonbedrock]: {
icon: amazonBedrockIcon,
name: 'Amazon Bedrock',

View file

@ -10,6 +10,7 @@ import { TaskTypes } from '../../types';
export const INFERENCE_ENDPOINTS_TABLE_PER_PAGE_VALUES = [25, 50, 100];
export enum ServiceProviderKeys {
'alibabacloud-ai-search' = 'alibabacloud-ai-search',
amazonbedrock = 'amazonbedrock',
azureopenai = 'azureopenai',
azureaistudio = 'azureaistudio',