@@ -53,6 +53,17 @@ const geographiesListQueryDoc: any = graphql(`
5353 }
5454` ) ;
5555
56+ const promptDomainEnumValuesQueryDoc : any = graphql ( `
57+ query PromptDomainEnum {
58+ __type(name: "PromptDomain") {
59+ enumValues {
60+ name
61+ description
62+ }
63+ }
64+ }
65+ ` ) ;
66+
5667const FetchAIModelDetails : any = graphql ( `
5768 query AIModelDetails($filters: AIModelFilter) {
5869 aiModels(filters: $filters) {
@@ -191,6 +202,11 @@ export default function AIModelDetailsPage() {
191202 )
192203 ) ;
193204
205+ const getPromptDomainEnumValues : { data : any ; isLoading : boolean ; error : any } =
206+ useQuery ( [ `prompt_domain_enum_values_query` ] , ( ) =>
207+ GraphQL ( promptDomainEnumValuesQueryDoc , { } , [ ] as any )
208+ ) ;
209+
194210 const AIModelData : {
195211 data : any ;
196212 isLoading : boolean ;
@@ -377,20 +393,16 @@ export default function AIModelDetailsPage() {
377393
378394 const domainOptions = [
379395 { label : 'Click to select from dropdown' , value : '' } ,
380- { label : 'Healthcare' , value : 'HEALTHCARE' } ,
381- { label : 'Education' , value : 'EDUCATION' } ,
382- { label : 'Legal' , value : 'LEGAL' } ,
383- { label : 'Finance' , value : 'FINANCE' } ,
384- { label : 'Agriculture' , value : 'AGRICULTURE' } ,
385- { label : 'Environment' , value : 'ENVIRONMENT' } ,
386- { label : 'Government' , value : 'GOVERNMENT' } ,
387- { label : 'Technology' , value : 'TECHNOLOGY' } ,
388- { label : 'Science' , value : 'SCIENCE' } ,
389- { label : 'Social Services' , value : 'SOCIAL_SERVICES' } ,
390- { label : 'Transportation' , value : 'TRANSPORTATION' } ,
391- { label : 'Energy' , value : 'ENERGY' } ,
392- { label : 'General' , value : 'GENERAL' } ,
393- { label : 'Other' , value : 'OTHER' } ,
396+ ...(
397+ getPromptDomainEnumValues . data ?. __type ?. enumValues ?. map ( ( item : { name : string } ) => ( {
398+ label : item . name
399+ . toLowerCase ( )
400+ . split ( '_' )
401+ . map ( ( word : string ) => word . charAt ( 0 ) . toUpperCase ( ) + word . slice ( 1 ) )
402+ . join ( ' ' ) ,
403+ value : item . name ,
404+ } ) ) || [ ]
405+ ) ,
394406 ] ;
395407
396408 const modelTypeOptions = [
0 commit comments