{"record":{"id":"88abb8e728ad0b7a","repo":"appsmithorg/appsmith","slug":"pe-arg-5000-88abb8","errorCode":"PE-ARG-5000","errorMessage":"No generate content model is selected in the configuration","messagePattern":"No generate content model is selected in the configuration","errorType":"exception","errorClass":"AppsmithPluginException","httpStatus":500,"severity":"error","filePath":"app/server/appsmith-plugins/googleAiPlugin/src/main/java/com/external/plugins/commands/GenerateContentCommand.java","lineNumber":69,"sourceCode":"     */\n    @Override\n    public URI createTriggerUri() {\n        return URI.create(\"\");\n    }\n\n    @Override\n    public URI createExecutionUri(ActionConfiguration actionConfiguration) {\n        return RequestUtils.createUriFromCommand(GoogleAIConstants.GENERATE_CONTENT, selectModel(actionConfiguration));\n    }\n\n    private String selectModel(ActionConfiguration actionConfiguration) {\n        if (actionConfiguration != null\n                && actionConfiguration.getFormData() != null\n                && actionConfiguration.getFormData().containsKey(GENERATE_CONTENT_MODEL)) {\n            return ((Map<String, String>) actionConfiguration.getFormData().get(GENERATE_CONTENT_MODEL)).get(DATA);\n        }\n        // throw error if no model selected\n        throw new AppsmithPluginException(\n                AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                \"No generate content model is selected in the configuration\");\n    }\n\n    @Override\n    public GoogleAIRequestDTO makeRequestBody(ActionConfiguration actionConfiguration) {\n        Map<String, Object> formData = actionConfiguration.getFormData();\n        GoogleAIRequestDTO googleAIRequestDTO = new GoogleAIRequestDTO();\n        List<Map<String, String>> messages = getMessages((Map<String, Object>) formData.get(MESSAGES));\n        if (messages == null || messages.isEmpty()) {\n            throw new AppsmithPluginException(\n                    AppsmithPluginError.PLUGIN_EXECUTE_ARGUMENT_ERROR,\n                    String.format(STRING_APPENDER, EXECUTION_FAILURE, INCORRECT_MESSAGE_FORMAT));\n        }\n        // as of today, we are going to support only text input to text output, so we will condense user messages in\n        // a single content parts of request body\n        List<GoogleAIRequestDTO.Part> userQueryParts = new ArrayList<>();\n        for (Map<String, String> message : messages) {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/appsmithorg/appsmith/blob/8cd9021c24cdbea1c3c12c966073708e83db60c2/app/server/appsmith-plugins/googleAiPlugin/src/main/java/com/external/plugins/commands/GenerateContentCommand.java#L51-L87","documentation":"GenerateContentCommand.selectModel (GenerateContentCommand.java:62-72) throws this when the action configuration's formData does not contain the GENERATE_CONTENT_MODEL key. This method is called during createExecutionUri (line 58-59) to build the API URL with the model name in the path. Without a model, the URI cannot be constructed. Categorized as PLUGIN_EXECUTE_ARGUMENT_ERROR (PE-ARG-5000).","triggerScenarios":"The Google AI query's form data is missing the 'generateContentModel' key entirely, or actionConfiguration/formData is null. The three-way null check (actionConfiguration != null, formData != null, containsKey(GENERATE_CONTENT_MODEL)) at lines 63-65 fails on the third condition. This fires during URI construction, before the request body is even built.","commonSituations":"1) User creates a new Google AI query but forgets to select a model from the dropdown. 2) The model field was cleared or never populated after switching from another command type. 3) JS mode is enabled and the bound expression returns undefined/null for the model field. 4) Form data structure changed due to a UI/plugin update.","solutions":["Select a model from the model dropdown in the Google AI query editor (e.g., gemini-2.5-pro).","If using JS mode, ensure the bound expression returns a valid model identifier string in the generateContentModel form field's data key.","Verify the form data includes the 'generateContentModel' key with a nested 'data' field containing the model name.","Re-save the query after selecting the model to persist the form data."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure a model is selected before executing\nif (!form.generateContentModel || !form.generateContentModel.data) {\n  showAlert('Please select a Google AI model before running the query', 'error');\n} else {\n  await googleAiQuery.run();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always select a model from the dropdown when creating a Google AI query.","Verify the form data includes the generateContentModel key with a nested data value.","Use validateRequest-equivalent checks in a pre-execution JS callback."],"tags":["google-ai","gemini","model-selection","configuration","appsmith"],"backgroundTag":null,"analyzedSha":"8cd9021c24cdbea1c3c12c966073708e83db60c2","analyzedAt":"2026-08-12T22:14:19.293Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}