Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic models and endpoints UI #901

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
b1a09d4
Add more margin utility classes
Sensational-Code Apr 25, 2024
65d763c
Rough models and endpoints list and create pages
Sensational-Code Apr 25, 2024
7974a33
Run linter
Sensational-Code Apr 25, 2024
05e0863
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Apr 25, 2024
41f87f6
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Jul 24, 2024
9f1ed87
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Oct 25, 2024
4a5c28e
Fix sidebar comment formatting
Sensational-Code Oct 25, 2024
aeab0eb
Add api method to get workflows
Sensational-Code Nov 15, 2024
8820d47
Formatting
Sensational-Code Nov 19, 2024
0460335
Rename getWorkflows to getAgentWorkflows
Sensational-Code Nov 19, 2024
020f14a
Get workflow options on create agent page
Sensational-Code Nov 19, 2024
43f7bc0
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Nov 19, 2024
fa6c2e5
Ensure style is scoped
Sensational-Code Nov 19, 2024
3763a54
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Nov 29, 2024
cba566d
Merge sc-ui-select-workflow-for-agent into sc-basic-models-and-endpoi…
Sensational-Code Nov 29, 2024
175f002
Make principal display name optional if null
Sensational-Code Dec 3, 2024
00e2e0d
Create mock workflows
Sensational-Code Dec 3, 2024
4b4a1d3
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Dec 11, 2024
c36d2f3
Post merge clean up
Sensational-Code Dec 11, 2024
ad909ff
Merge sc-fix-agent-form-buttons into sc-basic-models-and-endpoints-ui
Sensational-Code Dec 11, 2024
4e763af
Add more utility classes
Sensational-Code Dec 11, 2024
03ef4b2
Add more utility classes
Sensational-Code Dec 12, 2024
e3031bb
Merge sc-agent-workflow-and-tools-options into sc-basic-models-and-en…
Sensational-Code Dec 12, 2024
9c63482
Split models and model endpoint into separate page groups
Sensational-Code Jan 15, 2025
114c70f
Merge sc-agent-workflow-and-tools-options into sc-basic-models-and-en…
Sensational-Code Jan 15, 2025
d7701e8
Minor clean up
Sensational-Code Jan 15, 2025
0275757
Only display model endpoints with 'AIModel' subcategory and clean up
Sensational-Code Jan 15, 2025
218f5f5
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Jan 15, 2025
4d7709b
Set model endpoint on edit form load
Sensational-Code Jan 15, 2025
361c704
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Jan 17, 2025
225e82e
Fix data source edit
Sensational-Code Jan 17, 2025
809e3bb
Formatting
Sensational-Code Jan 17, 2025
fc3c75f
Add checkAIModelName api method
Sensational-Code Jan 17, 2025
09bed41
Update AI model create form fields
Sensational-Code Jan 17, 2025
6128b7e
Fix creating AI model by enforcing type as first property in payload
Sensational-Code Jan 19, 2025
b5f8ef3
Fix post create model routing
Sensational-Code Jan 19, 2025
c617a9a
Add ability to delete AI model from table
Sensational-Code Jan 19, 2025
7f7d82b
Add comment
Sensational-Code Jan 19, 2025
f96d7b0
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Jan 21, 2025
0af86ca
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Jan 22, 2025
226da0c
Post merge clean up
Sensational-Code Jan 22, 2025
1cccfa6
Update api methods and clean up
Sensational-Code Jan 22, 2025
762c11f
Add additional fields to create endpoint form
Sensational-Code Jan 22, 2025
35b42ab
Use "API Endpoint" instead of "Model Endpoint"
Sensational-Code Jan 22, 2025
348b42b
Rename "model-endpoints" directory to "api-endpoints"
Sensational-Code Jan 22, 2025
11567fb
Rename route param name
Sensational-Code Jan 22, 2025
6f43a71
Lint fix
Sensational-Code Jan 22, 2025
bb6c592
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Jan 24, 2025
57cc39b
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Jan 28, 2025
7ab27c7
Lint fix
Sensational-Code Jan 29, 2025
e830a12
Create initial AuthenticationParametersBuilder component
Sensational-Code Jan 29, 2025
21635c3
Update api endpoint authentication parameter handling in UI
Sensational-Code Jan 29, 2025
7db872e
Create initial EditURLExceptionDialog component
Sensational-Code Jan 29, 2025
69b8c19
Improve UI for managing url exception on api endpoints
Sensational-Code Jan 29, 2025
e5fe220
Update EditURLExceptionDialog title logic
Sensational-Code Jan 29, 2025
e571a68
Add css utility class
Sensational-Code Jan 29, 2025
6326009
Update and clean up AuthenticationParametersBuilder
Sensational-Code Jan 29, 2025
8d8d875
Lint fix
Sensational-Code Jan 29, 2025
31ce3cc
Update api endpoint category options
Sensational-Code Jan 29, 2025
1dce0f4
Add api endpoint subcategory dropdown
Sensational-Code Jan 29, 2025
9bb733f
Update api endpoint authentication parameters to take text input for …
Sensational-Code Jan 31, 2025
c0ea93e
Preserve api endpoint parameter order on key name edit
Sensational-Code Jan 31, 2025
647fc1e
Add JSDoc documentation
Sensational-Code Jan 31, 2025
ad526f8
Lint fix
Sensational-Code Jan 31, 2025
91d89ff
Clean up api method return types
Sensational-Code Jan 31, 2025
ef704ec
Merge main into sc-basic-models-and-endpoints-ui
Sensational-Code Feb 13, 2025
0a152b4
Remove outdated mock workflows
Sensational-Code Feb 13, 2025
ebf1021
Remove unused types
Sensational-Code Feb 13, 2025
b69a12c
Type fixes
Sensational-Code Feb 13, 2025
a213b58
Lint fix
Sensational-Code Feb 13, 2025
2116c22
Add deployment name and model version to AI Model form
codingbandit Feb 14, 2025
48e824d
Fix grammar
Sensational-Code Feb 15, 2025
c19e307
Lint fix
Sensational-Code Feb 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions src/ui/ManagementPortal/app.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<template>
<div class="main-content">
<Head>
<Title>{{ pageTitle }}</Title>
<Meta name="description" :content="pageTitle" />
<Link rel="icon" type="image/x-icon" :href="iconLink" />
</Head>
<Head>
<Title>{{ pageTitle }}</Title>
<Meta name="description" :content="pageTitle" />
<Link rel="icon" type="image/x-icon" :href="iconLink" />
</Head>

<div class="main-content">
<NuxtLayout>
<NuxtPage />
</NuxtLayout>

<Toast position="top-center" />
</div>
</template>
Expand Down Expand Up @@ -110,6 +109,15 @@ body,
margin-right: 4px !important;
}

.mr-2 {
margin-right: 8px !important;
}

.mx-2 {
margin-left: 8px !important;
margin-right: 8px !important;
}

.mt-2 {
margin-top: 8px !important;
}
Expand Down
17 changes: 13 additions & 4 deletions src/ui/ManagementPortal/components/AgentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
}"
>
<template #body="{ data }">
<span>{{ data.resource.name }} {{ data.resource.display_name ? `(${data.resource.display_name})` : '' }}</span>
<span
>{{ data.resource.name }}
{{ data.resource.display_name ? `(${data.resource.display_name})` : '' }}</span
>
<template v-if="data.resource.properties?.default_resource === 'true'">
<Chip label="Default" icon="pi pi-star" style="margin-left: 8px" />
</template>
Expand Down Expand Up @@ -101,7 +104,9 @@
<i class="pi pi-cog" style="font-size: 1.2rem" aria-hidden="true"></i>
</Button>
<template #popper
><div role="tooltip">Edit {{ data.resource.display_name || data.resource.name }}</div></template
><div role="tooltip">
Edit {{ data.resource.display_name || data.resource.name }}
</div></template
>
</VTooltip>
</NuxtLink>
Expand Down Expand Up @@ -131,7 +136,9 @@
<i class="pi pi-trash" style="font-size: 1.2rem" aria-hidden="true"></i>
</Button>
<template #popper
><div role="tooltip">Delete {{ data.resource.display_name || data.resource.name }}</div></template
><div role="tooltip">
Delete {{ data.resource.display_name || data.resource.name }}
</div></template
>
</VTooltip>
</template>
Expand Down Expand Up @@ -160,7 +167,9 @@
<i class="pi pi-star" style="font-size: 1.2rem" aria-hidden="true"></i>
</Button>
<template #popper
><div role="tooltip">Set {{ data.resource.display_name || data.resource.name }} as default agent</div></template
><div role="tooltip">
Set {{ data.resource.display_name || data.resource.name }} as default agent
</div></template
>
</VTooltip>
</template>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
<template>
<div class="d-flex flex-column gap-4">
<!-- Authenication parameters table -->
<DataTable
:value="Object.keys(parameters).map((key) => ({ key, value: parameters[key] }))"
striped-rows
scrollable
table-style="max-width: 100%"
size="small"
>
<template #empty>No authentication parameters added.</template>

<!-- Parameter secret toggle -->
<!-- <Column
field="secret"
header="Secret"
sortable
:pt="{
headerCell: {
style: { backgroundColor: 'var(--primary-color)', color: 'var(--primary-text)' },
},
sortIcon: { style: { color: 'var(--primary-text)' } },
}"
>
<template #body="{ data }">
<i v-if="data.secret" class="pi pi-lock mr-2"></i>
<span>{{ data.secret }}</span>
</template>
</Column> -->

<!-- Parameter key -->
<Column
field="key"
header="Parameter Key"
sortable
:pt="{
headerCell: {
style: { backgroundColor: 'var(--primary-color)', color: 'var(--primary-text)' },
},
sortIcon: { style: { color: 'var(--primary-text)' } },
}"
/>

<!-- Parameter value -->
<Column
field="value"
header="Parameter Value"
sortable
:pt="{
headerCell: {
style: { backgroundColor: 'var(--primary-color)', color: 'var(--primary-text)' },
},
sortIcon: { style: { color: 'var(--primary-text)' } },
}"
>
<!-- <template #body="{ data }">
{{ data.secret ? '[VALUE HIDDEN]' : data.value }}
</template> -->
</Column>

<!-- Edit parameter -->
<Column
header="Edit"
header-style="width:6rem"
style="text-align: center"
:pt="{
headerCell: {
style: { backgroundColor: 'var(--primary-color)', color: 'var(--primary-text)' },
},
headerContent: { style: { justifyContent: 'center' } },
}"
>
<template #body="{ data }">
<Button link @click="handleEditParameter(data.key)">
<i class="pi pi-cog" style="font-size: 1.2rem"></i>
</Button>
</template>
</Column>

<!-- Delete parameter -->
<Column
header="Delete"
header-style="width:6rem"
style="text-align: center"
:pt="{
headerCell: {
style: { backgroundColor: 'var(--primary-color)', color: 'var(--primary-text)' },
},
headerContent: { style: { justifyContent: 'center' } },
}"
>
<template #body="{ data }">
<Button link @click="handleDeleteParameter(data.key)">
<i class="pi pi-trash" style="font-size: 1.2rem"></i>
</Button>
</template>
</Column>
</DataTable>

<!-- Add parameter button -->
<div class="d-flex w-100 justify-content-end">
<Button
severity="primary"
style="word-wrap: none"
@click="showCreateOrEditParameterDialog = true"
>
Add Authentication Parameter
</Button>
</div>

<!-- Create / edit parameter dialog -->
<div class="d-flex gap-4">
<Dialog
v-if="showCreateOrEditParameterDialog"
:visible="showCreateOrEditParameterDialog"
modal
:header="
parameterToEdit.currentKey
? 'Edit Authentication Parameter'
: 'Add Authentication Parameter'
"
:style="{ minWidth: '50%' }"
:closable="false"
>
<!-- Parameter key -->
<div class="mb-1">Parameter Key:</div>
<InputText
v-model="parameterToEdit.key"
type="text"
placeholder="Enter parameter key"
@input="handleParameterKeyInput"
/>

<!-- Parameter secret toggle -->
<!-- <div class="mb-1 mt-4">Is the parameter secret?</div>
<ToggleButton
v-model="parameterToEdit.secret"
onIcon="pi pi-lock"
offIcon="pi pi-lock-open"
class="w-36"
aria-label="Do you confirm"
/> -->

<!-- Parameter value -->
<div class="mb-1 mt-4">Parameter Value:</div>

<!-- Secret value -->
<!-- <SecretKeyInput
v-if="parameterToEdit.secret"
v-model="parameterToEdit.value"
placeholder="Enter parameter secret value"
aria-labelledby="aria-api-key"
/> -->

<!-- Plain value -->
<InputText v-model="parameterToEdit.value" placeholder="Enter parameter value" />

<template #footer>
<!-- Save -->
<Button severity="primary" label="Save" @click="handleAddParameter" />

<!-- Cancel -->
<Button class="ml-2" label="Close" text @click="handleClose" />
</template>
</Dialog>
</div>
</div>
</template>

<script lang="ts">
import { renameObjectKey } from '@/js/helpers';

export default {
props: {
modelValue: {
type: Object,
required: false,
default: () => ({}),
},
},

data() {
return {
parameters: {},

showCreateOrEditParameterDialog: false,
parameterToEdit: {
key: '',
value: '',
secret: false,
},
};
},

watch: {
modelValue: {
immediate: true,
deep: true,
handler() {
this.parameters = this.modelValue;
},
},
},

methods: {
handleParameterKeyInput(event) {
// Filter to only allow lowercase letters and underscores
let sanitizedValue = event.target.value.replace(/[^a-zA-Z_]/g, '').toLowerCase();

event.target.value = sanitizedValue;
this.parameterToEdit.key = sanitizedValue;
},

handleClose() {
this.showCreateOrEditParameterDialog = false;
this.parameterToEdit = {
currentKey: '',
key: '',
value: '',
// secret: false,
};
},

handleEditParameter(propertyKey) {
this.parameterToEdit = {
currentKey: propertyKey,
key: propertyKey,
value: this.parameters[propertyKey],
};
this.showCreateOrEditParameterDialog = true;
},

handleDeleteParameter(propertyKey) {
delete this.parameters[propertyKey];
this.$emit('update:modelValue', this.parameters);
},

handleAddParameter() {
const errors = [];

if (!this.parameterToEdit.key) {
errors.push('The parameter requires a key name.');
}

if (!this.parameterToEdit.value) {
errors.push('The parameter requires a value.');
}

if (errors.length > 0) {
this.$toast.add({
severity: 'error',
detail: errors.join('\n'),
life: 5000,
});

return;
}

// Rename the parameter key while preserving the key order
this.parameters = renameObjectKey(
this.parameters,
this.parameterToEdit.currentKey,
this.parameterToEdit.key,
);
this.parameters[this.parameterToEdit.key] = this.parameterToEdit.value;

this.showCreateOrEditParameterDialog = false;
this.parameterToEdit = {
currentKey: '',
key: '',
value: '',
// secret: false,
};
this.$emit('update:modelValue', this.parameters);
},
},
};
</script>

<style lang="scss"></style>
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default {
} else if (type === 'aiModels') {
return 'AI Model';
} else if (type === 'textEmbeddingProfiles') {
return 'Embedding Profile';
return 'Embedding Profile';
} else if (type === 'indexingProfiles') {
return 'Vector Store';
} else if (type === 'apiEndpointConfigurations') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default {
},
{
label: 'Embedding profile',
value: 'textEmbeddingProfile'
value: 'textEmbeddingProfile',
},
{
label: 'Vector store',
Expand Down Expand Up @@ -134,10 +134,9 @@ export default {
if (this.resourceType === 'model') {
this.loadingStatusText = 'Loading models...';
apiMethod = api.getAIModels;
}
else if (this.resourceType === 'textEmbeddingProfile') {
} else if (this.resourceType === 'textEmbeddingProfile') {
this.loadingStatusText = 'Loading text embedding profiles...';
apiMethod = api.getTextEmbeddingProfiles;
apiMethod = api.getTextEmbeddingProfiles;
} else if (this.resourceType === 'indexingProfile') {
this.loadingStatusText = 'Loading vector stores...';
apiMethod = api.getAgentIndexes;
Expand Down
Loading
Loading