Compare commits
2 Commits
main
...
feat/en-ve
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94c0395e68 | ||
|
|
63b455dc34 |
@ -39,7 +39,7 @@ namespace ChatApi
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var msg = new List<ChatMessageContent>();
|
var msg = new List<ChatMessageContent>();
|
||||||
PromptLiliana(msg);
|
PromptEn(msg);
|
||||||
string json = JsonSerializer.Serialize(msg);
|
string json = JsonSerializer.Serialize(msg);
|
||||||
var history = new ChatHistory(JsonSerializer.Deserialize<List<ChatMessageContent>>(json));
|
var history = new ChatHistory(JsonSerializer.Deserialize<List<ChatMessageContent>>(json));
|
||||||
_keyValues[sessionId] = history;
|
_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.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."));
|
msg.Add(new ChatMessageContent(AuthorRole.User, "Use sempre portugues do Brasil."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void PromptEn(List<ChatMessageContent> 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."));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,6 +89,24 @@ namespace ChatApi.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
[Route("savetexts")]
|
||||||
|
public async Task<IActionResult> SaveTexts([FromBody] List<TextRequest> requests)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach(var request in requests)
|
||||||
|
{
|
||||||
|
await _textData.SalvarNoMongoDB(request.Id, request.Title, request.Content, request.ProjectId);
|
||||||
|
}
|
||||||
|
return Created();
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return StatusCode(500, ex.Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[Route("texts")]
|
[Route("texts")]
|
||||||
public async Task<IEnumerable<TextResponse>> GetTexts()
|
public async Task<IEnumerable<TextResponse>> GetTexts()
|
||||||
|
|||||||
@ -49,7 +49,20 @@ namespace ChatRAG.Services.ResponseService
|
|||||||
|
|
||||||
var project = $"Nome: {projectData.Nome} \n\n Descrição:{projectData.Descricao}";
|
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);
|
ChatHistory history = _chatHistoryService.GetSumarizer(sessionId);
|
||||||
|
|
||||||
history.AddUserMessage(question);
|
history.AddUserMessage(question);
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
{
|
{
|
||||||
"DomvsDatabase": {
|
"DomvsDatabase": {
|
||||||
"ConnectionString": "mongodb://admin:c4rn31r0@k3sw2:27017,k3ss1:27017/?authSource=admin",
|
"ConnectionString": "mongodb://admin:c4rn31r0@k3sw2:27017,k3ss1:27017/?authSource=admin",
|
||||||
"DatabaseName": "RAGProjects-dev",
|
"DatabaseName": "RAGProjects-dev-en",
|
||||||
"TextCollectionName": "Texts",
|
"TextCollectionName": "Texts",
|
||||||
"ProjectCollectionName": "Projects",
|
"ProjectCollectionName": "Groups",
|
||||||
"UserDataName": "UserData"
|
"UserDataName": "UserData"
|
||||||
},
|
},
|
||||||
"Logging": {
|
"Logging": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user