diff --git a/ChatHistoryService.cs b/ChatHistoryService.cs index a54c8a8..c40630a 100644 --- a/ChatHistoryService.cs +++ b/ChatHistoryService.cs @@ -39,7 +39,7 @@ namespace ChatApi else { var msg = new List(); - PromptLiliana(msg); + PromptEn(msg); string json = JsonSerializer.Serialize(msg); var history = new ChatHistory(JsonSerializer.Deserialize>(json)); _keyValues[sessionId] = history; @@ -58,5 +58,17 @@ namespace ChatApi msg.Add(new ChatMessageContent(AuthorRole.System, "Você responde sempre em português do Brasil e fala sobre detalhes de projeto, arquitetura e criação de casos de teste.")); msg.Add(new ChatMessageContent(AuthorRole.User, "Use sempre portugues do Brasil.")); } + + public void PromptEn(List msg) + { + msg.Add(new ChatMessageContent(AuthorRole.System, "You are an expert software analyst and QA professional.")); + msg.Add(new ChatMessageContent(AuthorRole.System, "Please provide a comprehensive response in English. Consider the project context and requirements above to generate accurate and relevant information.")); + msg.Add(new ChatMessageContent(AuthorRole.System, "If you have test case requests: Use Gherkin format (Given-When-Then) with realistic scenarios covering happy path, edge cases, and error handling.")); + msg.Add(new ChatMessageContent(AuthorRole.System, "If you have project summaries: Include objectives, key features, technologies, and main challenges.")); + msg.Add(new ChatMessageContent(AuthorRole.System, "If you have a task list request for one developer: Organize tasks by priority and estimated effort for a single developer, including technical dependencies.")); + msg.Add(new ChatMessageContent(AuthorRole.System, "If you have a task list request for more than one developer: Organize tasks by priority and estimated effort for a every developer, including technical dependencies.")); + //msg.Add(new ChatMessageContent(AuthorRole.User, "Use sempre portugues do Brasil.")); + } + } } diff --git a/Services/ResponseService/ResponseCompanyService.cs b/Services/ResponseService/ResponseCompanyService.cs index 4795e19..eba07e5 100644 --- a/Services/ResponseService/ResponseCompanyService.cs +++ b/Services/ResponseService/ResponseCompanyService.cs @@ -49,7 +49,20 @@ namespace ChatRAG.Services.ResponseService var project = $"Nome: {projectData.Nome} \n\n Descrição:{projectData.Descricao}"; - question = $"Para responder à solicitação/pergunta: \"{question }\" por favor, considere o projeto: \"{project}\" e os requisitos: \"{resposta}\""; + //question = $"Para responder à solicitação/pergunta: \"{question}\" por favor, considere o projeto: \"{project}\" e os requisitos: \"{resposta}\""; + // Base prompt template + string basePrompt = @"You are an expert software analyst and QA professional. + + Project Context: {0} + Requirements: {1} + + User Request: ""{2}"" + + Please answer the question above from User Request with a comprehensive response in English. Consider the project context and requirements above to generate accurate and relevant information."; + + // Usage + question = string.Format(basePrompt, project, resposta, question); + ChatHistory history = _chatHistoryService.GetSumarizer(sessionId); history.AddUserMessage(question); diff --git a/appsettings.json b/appsettings.json index 933fafa..bf802ce 100644 --- a/appsettings.json +++ b/appsettings.json @@ -1,9 +1,9 @@ { "DomvsDatabase": { "ConnectionString": "mongodb://admin:c4rn31r0@k3sw2:27017,k3ss1:27017/?authSource=admin", - "DatabaseName": "RAGProjects-dev", + "DatabaseName": "RAGProjects-dev-en", "TextCollectionName": "Texts", - "ProjectCollectionName": "Projects", + "ProjectCollectionName": "Groups", "UserDataName": "UserData" }, "Logging": {