Skip to content

Commit

Permalink
Merge pull request #2120 from solliancenet/ah-ui-indexing-profiles
Browse files Browse the repository at this point in the history
Add Indexing Profiles management UI
  • Loading branch information
ciprianjichici authored Jan 16, 2025
2 parents ff1b94b + ab04c64 commit 0c854a4
Show file tree
Hide file tree
Showing 9 changed files with 1,089 additions and 5 deletions.
9 changes: 8 additions & 1 deletion src/ui/ManagementPortal/components/AgentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
</template>

<!-- Table -->
<DataTable :value="agents" striped-rows scrollable table-style="max-width: 100%" size="small">
<DataTable
:value="agents"
striped-rows
scrollable
sortField="resource.name"
:sortOrder="1"
table-style="max-width: 100%"
size="small">
<template #empty>
<div role="alert" aria-live="polite">
No agents found. Please use the menu on the left to create a new agent.
Expand Down
11 changes: 10 additions & 1 deletion src/ui/ManagementPortal/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,17 @@
</h3>
<ul>
<li><NuxtLink to="/data-sources" class="sidebar__item">Data Sources</NuxtLink></li>
<li><NuxtLink to="/vector-stores" class="sidebar__item">Vector Stores</NuxtLink></li>
</ul>
<!-- <div class="sidebar__item">Vector Stores</div> -->

<!-- Pipeline -->
<!-- <h3 class="sidebar__section-header">
<span class="pi pi-equals" aria-hidden="true"></span>
<span>Data Pipeline</span>
</h3>
<ul>
<li><NuxtLink to="/pipeline/indexing-profiles" class="sidebar__item">Indexing Profiles</NuxtLink></li>
</ul> -->

<!-- Quotas -->
<!-- <div class="sidebar__section-header">
Expand Down
64 changes: 63 additions & 1 deletion src/ui/ManagementPortal/js/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {
ExternalOrchestrationService,
// Role,
RoleAssignment,
APIEndpointConfiguration,
} from './types';
import { convertToDataSource, convertToAppConfigKeyVault, convertToAppConfig } from '@/js/types';

Expand Down Expand Up @@ -870,4 +871,65 @@ export default {
},
);
},
};

/*
Indexing Profiles
*/
async getIndexingProfiles(): Promise<any> {
const data = (await this.fetch(
`/instances/${this.instanceId}/providers/FoundationaLLM.Vectorization/indexingProfiles?api-version=${this.apiVersion}`,
)) as ResourceProviderGetResult<AgentIndex>[];
return data;
},

async getIndexingProfile(indexingProfileId: string): Promise<any> {
const data = await this.fetch(
`/instances/${this.instanceId}/providers/FoundationaLLM.Vectorization/indexingProfiles/${indexingProfileId}?api-version=${this.apiVersion}`,
);
return data[0];
},

async createIndexingProfile(request): Promise<any> {
console.log('createIndexingProfile', request);
return await this.fetch(
`/instances/${this.instanceId}/providers/FoundationaLLM.Vectorization/indexingProfiles/${request.name}?api-version=${this.apiVersion}`,
{
method: 'POST',
body: JSON.stringify(request),
headers: {
'Content-Type': 'application/json',
},
},
);
},

async deleteIndexingProfile(indexingProfileId: string): Promise<any> {
return await this.fetch(
`/instances/${this.instanceId}/providers/FoundationaLLM.Vectorization/indexingProfiles/${indexingProfileId}?api-version=${this.apiVersion}`,
{
method: 'DELETE',
},
);
},

async checkIndexingProfileName(name): Promise<any> {
const payload = {
name,
type: 'indexing-profile',
};

return (await this.fetch(
`/instances/${this.instanceId}/providers/FoundationaLLM.Vectorization/indexingProfiles/checkname?api-version=${this.apiVersion}`,
{
method: 'POST',
body: payload,
},
)) as CheckNameResponse;
},

async getOrchestrationServices(): Promise<APIEndpointConfiguration> {
return await this.fetch(
`/instances/${this.instanceId}/providers/FoundationaLLM.Configuration/apiEndpointConfigurations?api-version=${this.apiVersion}`,
) as APIEndpointConfiguration;
},
};
47 changes: 47 additions & 0 deletions src/ui/ManagementPortal/js/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,50 @@ export function convertToAppConfigKeyVault(baseConfig: AppConfigUnion): AppConfi
content_type: 'application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8',
};
}

export type APIEndpointConfiguration = ResourceBase & {
type: string;
category: APIEndpointCategory;
subcategory?: APIEndpointSubcategory;
authenticationType: AuthenticationTypes;
url: string;
statusUrl?: string;
urlExceptions: UrlException[];
authenticationParameters: { [key: string]: any };
timeoutSeconds: number;
retryStrategyName: string;
provider?: string;
apiVersion?: string;
operationType?: string;
}

export type UrlException = {
userPrincipalName: string;
url: string;
enabled: boolean;
}

export enum APIEndpointCategory {
Orchestration,
ExternalOrchestration,
LLM,
Gatekeeper,
AzureAIDirect,
AzureOpenAIDirect,
FileStoreConnector,
General
}

export enum APIEndpointSubcategory {
OneDriveWorkSchool,
Indexing,
AIModel
}

export enum AuthenticationTypes {
Unknown = -1,
AzureIdentity,
APIKey,
ConnectionString,
AccountKey
}
2 changes: 2 additions & 0 deletions src/ui/ManagementPortal/pages/data-sources/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
:value="dataSources"
striped-rows
scrollable
sortField="resource.name"
:sortOrder="1"
table-style="max-width: 100%"
size="small"
>
Expand Down
10 changes: 8 additions & 2 deletions src/ui/ManagementPortal/pages/prompts/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
</template>

<!-- Table -->
<DataTable :value="prompts" striped-rows scrollable table-style="max-width: 100%" size="small">
<DataTable
:value="prompts"
striped-rows
scrollable
sortField="resource.name"
:sortOrder="1"
table-style="max-width: 100%"
size="small">
<template #empty>
<div role="alert" aria-live="polite">
No prompts found.
Expand Down Expand Up @@ -106,7 +113,6 @@ export default {
this.loading = true;
try {
this.prompts = (await api.getPrompts()) || [];
this.prompts.sort((a, b) => a.resource.name.localeCompare(b.resource.name));
} catch (error) {
this.$toast.add({
severity: 'error',
Expand Down
Loading

0 comments on commit 0c854a4

Please sign in to comment.