# Enhancing Conversational Agent Development Through a Semi-Automatization Development Proposal
## 4 Proposal
### Integration with GPT-3 as an Alternative for Resolving User Queries  
Closed-domain conversational agents, relying on predefined intents and training sentences to classify user queries, exhibit inherent limitations in addressing unanticipated  
Figure 5: Part of the implementation of the M2T transformation using the Eclipse Acceleo plugin. requests. Although effective for common, predefined questions, this approach struggles with user requests not explicitly considered during development, hindering proper NLP service detection and response. Consequently, research has explored alternative strategies to enhance query resolution beyond predefined intents. One such approach, as detailed in Section 3, involves consulting external documentation (e.g., manuals, FAQs) owned by the bot provider [38]. This expands the bot's knowledge base, potentially transitioning it towards open-domain capabilities. When these sources prove insufficient, recourse to general knowledge sources, such as Transformer models, becomes a viable option. These models, which are capable of generating human-like text, offer broader knowledge bases applicable to a wider range of user queries. To mitigate the aforementioned limitations of closed-domain conversational agents, this article introduces, as a key novelty, the implementation of the autoregressive natural language model GPT-3 [39], a model trained on approximately 175 billion parameters with extensive knowledge of the cross domain. GPT-3 was selected as a robust alternative for addressing user queries when the primary natural language processing service is unable to detect user intent and generate a suitable response. The proposed methodology leverages GPT-3 in instances where the agent encounters unclassifiable messages. Instead of simply replying with a default \"cannot answer\" message, the bot offers contextually related information, guiding the user towards reformulating their query and maintaining conversational flow. This approach aims to re-engage the user and mitigate the negative impact of failed intent detection. The first step consisted of designing a suitable input for the model, considering OpenAI's recommendations for designing a good prompt. Subsequently, a series of tests were performed for different question scenarios, and it was concluded that the model should contain four elements to be able to generate useful suggestions for the user when the bot requires it. The elements defined are as follows:  
* Provide information about the context in which the chatbot is being used. This information can be extracted directly from the chatbot's training sentences and can be implemented in the form of a list of options in the prompt. * Precise instructions on how the model should act. Here, you specify in brief and clear words the task that the model should perform--for example, in the prompt, you detail how it is explicitly instructed to generate a suggestion from the user's message. The suggestion should be selected from the list of options mentioned above. The instructions will depend on the needs or preferences of the chatbot designer; for example, it can be specified to generate the suggestions in a specific language or use the same language as the user's message. * A list of examples. This list shows how the suggestions are expected to be generated. The examples should follow the instructions of the previous item. Generally, increasing the number of examples results in a higher quality of suggestions, but it should be considered that increasing the number of characters in the prompt implies a higher cost and response time. * The user's message. Finally, at least the last message written by the user should be included. The reason for doing it this way is that it is the key piece of information from which the model will generate a suggestion. In most scenarios between the user and the conversational agent, the first three elements will be static, i.e., previously defined, while the fourth will change dynamically according to the conversation.