Error in OpenAI connector

0
hello everyone,  I am using a Mendix app called Support Assistant Starter to develop a RAG (Retrieval-Augmented Generation) system with an open-source LLM (Mistral).Initially, I followed Mendix’s instructions and successfully tested the toy example using the OpenAI API. However, when switching to Mistral as the foundational model, I consistently encounter an error.The error seems to be related to a REST call, but I am not sure where exactly the issue occurs. Thank you for your Help!
asked
1 answers
0

I would just put the error message here: 

--------------------------------------------------

An error occurred in the REST call for operation Chat Completions.Microflow: Request_POSTHttpStatus : 422Content: {"detail":[{"type":"missing","loc":["body","tools","list[Tool]",1,"function","parameters"],"msg":"Field required","input":{"name":"GetCurrentTicketDetails","description":"This function is ALWAYS called when the user wants to update or edit a ticket during the creation process to extract the current ticket information or values. This is essential for these type of requests because the user has the option to manually update or edit the ticket outside the chat."}},{"type":"missing","loc":["body","tools","list[Tool]",5,"function","parameters"],"msg":"Field required","input":{"name":"RetrieveMyOpenTickets","description":"Function to retrieve all tickets of the current user, where the status is open."}},{"type":"missing","loc":["body","tools","list[Tool]",8,"function","parameters"],"msg":"Field required","input":{"name":"RetrieveMyTickets","description":"This function is to retrieve ALL support tickets of the current user. Do not provide details to the user unless it is asked."}},{"type":"string_type","loc":["body","tools","list[str]",0],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"CreateNewTicket","description":"Function to instantiate a new ticket. It should be written in the user perspective.\nThe input is a JSON string that represents the ticket that needs to be created.\nOnly use the following JSON schema: {\n\"subject\": \"Browser crashes when opening multiple tabs\",\n\"description\": \"When I try to open many tabs simultaneously, the browser crashes.\",\n\"category\": \"IT_support\",\n\"reproduction_steps\": \"1. Open the browser\\n2. Quickly open multiple tabs.\",\n\"proposed_solution\": \"Please update your browser to the latest available version.\"\n}\nThe field \"category\" only accepts the values: \"IT_support\", \"License_request\" or \"Hardware_request\".\nThe field \"proposed_solution\" must contain the same text of the possible solution presented in the user's chat conversation.\nDo not provide a \"Proposed_solution\" and \"reproduction_steps\" for hardware or license requests.\nMake sure to escape quotes. The JSON string should be on one line.","parameters":{"type":"object","properties":{"TicketString":{"type":"string"}},"required":["TicketString"]}}}},{"type":"string_type","loc":["body","tools","list[str]",1],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"GetCurrentTicketDetails","description":"This function is ALWAYS called when the user wants to update or edit a ticket during the creation process to extract the current ticket information or values. This is essential for these type of requests because the user has the option to manually update or edit the ticket outside the chat."}}},{"type":"string_type","loc":["body","tools","list[str]",2],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"UpdateNewTicket","description":"Function called ONLY when user requests an update/edit in newly created but unsaved ticket. Update ONLY requested fields. IF the request changes the overall meaning of the ticket, adjust the necessary fields and inform the user.\nOnly use the following JSON schema: {\n\"subject\": \"Browser crashes when opening multiple tabs\",\n\"description\": \"When I try to open many tabs simultaneously, the browser crashes.\",\n\"category\": \"IT_support\",\n\"reproduction_steps\": \"1. Open the browser\\n2. Quickly open multiple tabs.\",\n\"proposed_solution\": \"Please update your browser to the latest available version.\"\n}\nThe field \"category\" only accepts the values: \"IT_support\", \"License_request\" or \"Hardware_request\".\nThe field \"proposed_solution\" must contain the same text of the possible solution presented in the user's chat conversation.\nDo not provide a \"Proposed_solution\" and \"reproduction_steps\" for hardware or license requests.\nMake sure to escape quotes. The JSON string should be on one line.","parameters":{"type":"object","properties":{"TicketString":{"type":"string"}},"required":["TicketString"]}}}},{"type":"string_type","loc":["body","tools","list[str]",3],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"RetrieveStaticInformation","description":"This function is ALWAYS the FIRST one called when the user asks for help with an issue (e.g., battery drain, connection problems, etc.) because it is considered the knowledge base containing, e.g., product manuals, company documentation, etc.","parameters":{"type":"object","properties":{"ProblemDescriptionAndReproductionSteps":{"type":"string"}},"required":["ProblemDescriptionAndReproductionSteps"]}}}},{"type":"string_type","loc":["body","tools","list[str]",4],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"RetrieveSimilarTickets","description":"Retrieve support tickets that are similar to the user's issue. Never expose historical problem descriptions to the user, only use the solution fields to propose a solution.","parameters":{"type":"object","properties":{"ProblemDescriptionAndReproductionSteps":{"type":"string"}},"required":["ProblemDescriptionAndReproductionSteps"]}}}},{"type":"string_type","loc":["body","tools","list[str]",5],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"RetrieveMyOpenTickets","description":"Function to retrieve all tickets of the current user, where the status is open."}}},{"type":"string_type","loc":["body","tools","list[str]",6],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"RetrieveTicketByIdentifier","description":"Function to retrieve a specific ticket of the current user by the ticket ID or ticket identifier.","parameters":{"type":"object","properties":{"TicketIdentifier":{"type":"string"}},"required":["TicketIdentifier"]}}}},{"type":"string_type","loc":["body","tools","list[str]",7],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"CountTicketsByCategoryStatus","description":"This function counts the user's tickets with a specific ticket category and/or status. \nUse this format to pass the values:\n\"<status>status value</status><category>category value</category>\"\nIf the user does only provide one of those, leave out the value of the other. Do not assume any values.\nThe following values are valid\nfor category: {\"IT_support\", \"License_request\", \"Hardware_request\"}\nfor status: {\"Open\", \"Closed\"}","parameters":{"type":"object","properties":{"StatusCategory":{"type":"string"}},"required":["StatusCategory"]}}}},{"type":"string_type","loc":["body","tools","list[str]",8],"msg":"Input should be a valid string","input":{"type":"function","function":{"name":"RetrieveMyTickets","description":"This function is to retrieve ALL support tickets of the current user. Do not provide details to the user unless it is asked."}}}]}Reasonphrase: Unprocessable Entity

com.mendix.modules.microflowengine.MicroflowException 422: Unprocessable Entity    at OpenAIConnector.Request_POST (CallRest : 'Call REST (POST)')    at OpenAIConnector.Request_CallAPI (SubMicroflow : 'Request_POST')    at {"name":"GenAICommons.Request_ExecuteFromConnector","type":"JavaAction"}    at OpenAIConnector.ChatCompletions_WithHistory_Execute (JavaAction : 'Request_ExecuteFromConnector')    at {"name":"GenAICommons.ChatCompletions_WithHistory","type":"JavaAction"}    at GenAICommons.ChatCompletions_WithHistory (JavaAction : 'ChatCompletions_WithHistory')    at MyFirstSupportAssistant.SupportAssistant_ActionMicroflow (SubMicroflow : 'Chat Completions (with history)')    at {"name":"ConversationalUI.ProviderConfig_ExecuteAction","type":"JavaAction"}    at ConversationalUI.ChatContext_ExecuteAction (JavaAction : 'ProviderConfig_ExecuteAction')

Advanced stacktrace:Error calling REST service    at OpenAIConnector.Request_POST (CallRest : 'Call REST (POST)')    at OpenAIConnector.Request_CallAPI (SubMicroflow : 'Request_POST')    at {"name":"GenAICommons.Request_ExecuteFromConnector","type":"JavaAction"}    at OpenAIConnector.ChatCompletions_WithHistory_Execute (JavaAction : 'Request_ExecuteFromConnector')    at {"name":"GenAICommons.ChatCompletions_WithHistory","type":"JavaAction"}    at GenAICommons.ChatCompletions_WithHistory (JavaAction : 'ChatCompletions_WithHistory')    at MyFirstSupportAssistant.SupportAssistant_ActionMicroflow (SubMicroflow : 'Chat Completions (with history)')    at {"name":"ConversationalUI.ProviderConfig_ExecuteAction","type":"JavaAction"}    at ConversationalUI.ChatContext_ExecuteAction (JavaAction : 'ProviderConfig_ExecuteAction')

Advanced stacktrace:    at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:84)

Caused by:422: Unprocessable Entity    at OpenAIConnector.Request_POST (CallRest : 'Call REST (POST)')    at OpenAIConnector.Request_CallAPI (SubMicroflow : 'Request_POST')    at {"name":"GenAICommons.Request_ExecuteFromConnector","type":"JavaAction"}    at OpenAIConnector.ChatCompletions_WithHistory_Execute (JavaAction : 'Request_ExecuteFromConnector')    at {"name":"GenAICommons.ChatCompletions_WithHistory","type":"JavaAction"}    at GenAICommons.ChatCompletions_WithHistory (JavaAction : 'ChatCompletions_WithHistory')    at MyFirstSupportAssistant.SupportAssistant_ActionMicroflow (SubMicroflow : 'Chat Completions (with history)')    at {"name":"ConversationalUI.ProviderConfig_ExecuteAction","type":"JavaAction"}    at ConversationalUI.ChatContext_ExecuteAction (JavaAction : 'ProviderConfig_ExecuteAction')

Advanced stacktrace:    at com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:84)

answered