Skip to content
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ const geographiesListQueryDoc: any = graphql(`
}
`);

const promptDomainEnumValuesQueryDoc: any = graphql(`
query PromptDomainEnum {
__type(name: "PromptDomain") {
enumValues {
name
description
}
}
}
`);

const FetchAIModelDetails: any = graphql(`
query AIModelDetails($filters: AIModelFilter) {
aiModels(filters: $filters) {
Expand Down Expand Up @@ -191,6 +202,11 @@ export default function AIModelDetailsPage() {
)
);

const getPromptDomainEnumValues: { data: any; isLoading: boolean; error: any } =
useQuery([`prompt_domain_enum_values_query`], () =>
GraphQL(promptDomainEnumValuesQueryDoc, {}, [] as any)
);

const AIModelData: {
data: any;
isLoading: boolean;
Expand Down Expand Up @@ -377,20 +393,16 @@ export default function AIModelDetailsPage() {

const domainOptions = [
{ label: 'Click to select from dropdown', value: '' },
{ label: 'Healthcare', value: 'HEALTHCARE' },
{ label: 'Education', value: 'EDUCATION' },
{ label: 'Legal', value: 'LEGAL' },
{ label: 'Finance', value: 'FINANCE' },
{ label: 'Agriculture', value: 'AGRICULTURE' },
{ label: 'Environment', value: 'ENVIRONMENT' },
{ label: 'Government', value: 'GOVERNMENT' },
{ label: 'Technology', value: 'TECHNOLOGY' },
{ label: 'Science', value: 'SCIENCE' },
{ label: 'Social Services', value: 'SOCIAL_SERVICES' },
{ label: 'Transportation', value: 'TRANSPORTATION' },
{ label: 'Energy', value: 'ENERGY' },
{ label: 'General', value: 'GENERAL' },
{ label: 'Other', value: 'OTHER' },
...(
getPromptDomainEnumValues.data?.__type?.enumValues?.map((item: { name: string }) => ({
label: item.name
.toLowerCase()
.split('_')
.map((word: string) => word.charAt(0).toUpperCase() + word.slice(1))
.join(' '),
value: item.name,
})) || []
),
];

const modelTypeOptions = [
Expand Down
Loading