Pega GenAI configuration for Case Type Creation Model ID error

I am trying to configure Pega GenAI for case creation in my pega cloud trial version.

I have already set the configuration in the app studio and using a valid API Key.

I have also created custom GenAI Connect rule for my application.

But when trying to create a case type i am getting following exception in the tracer.

com.pega.pegarules.pub.clipboard.InvalidReferenceException: The reference .pxResults(-1) is not valid. Reason: unexpected character ‘-’ at position 11, expected subscript

I am trying to analyse the rc of the issue and found out that while setting the value of Param.ModelIndex it is setting value as “-1”, Because it is not able to match the modelID - “GPT-35-Turbo” in the D_pxGenAIModels Data page.

Param.ModelIndex = @IndexInPageList(Param.ModelID,“pyModelId”,D_pxGenAIModels.pxResults)

While running the data page D_pxGenAIModels i am getting the results for model details but the value pyModelId is not matching with the value of param.modelId which is being set in the page. Hence the index is setting to “-1”.

Can someone please help why the pyModelId is coming as “azure/openai/GPT-35-Turbo/1106”?? Please highlight if any configuration is missed.

@shrijap1The error occurs because the Param.ModelID value "GPT-35-Turbo" does not match the pyModelId value "azure/openai/GPT-35-Turbo/1106" returned by the D_pxGenAIModels data page. This mismatch causes the @IndexInPageList function to return -1, leading to an invalid index error in .pxResults. To fix this, ensure the Param.ModelID value matches the exact pyModelId from the data page. You can either update Param.ModelID to the full value "azure/openai/GPT-35-Turbo/1106" or modify the logic to handle partial matches. Also, confirm that the API key and GenAI model settings in App Studio are correctly configured. Running the data page manually can help verify the values returned. If the issue persists, try clearing caches and recompiling the ruleset

@Sairohith Thank you for your response!
The Model ID dropdown is not taking any custom values like “azure/openai/GPT-35-Turbo/1106” in the GenAI connect rule. And the logic for the match is in a data transform rule which is a Pega final rule.
I have configured the api key and Gen AI model in the app studio configuration but it is still not working as expected. Attached screenshot for your reference.

@shrijap1Since the Model ID dropdown in the GenAI Connect rule does not accept custom values like "azure/openai/GPT-35-Turbo/1106" and the matching logic is handled in a final Pega data transform rule, you cannot directly modify it. The issue arises because the model ID being passed does not match the one retrieved from the D_pxGenAIModels data page. To resolve this, ensure the model ID configured in App Studio matches the exact value returned by the data page. If the dropdown only allows specific values, verify the API key and model availability with your Azure OpenAI subscription. If the issue persists, consider raising a support ticket with Pega, as the final rule may require a product-level fix. Also, ensure the latest patch of your Pega version is installed, as this could be a known issue ​​​​​​​