Skip to content

Commit

Permalink
feat: improved document and prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseAlbDR committed Apr 1, 2024
1 parent 3430aed commit 3b7b56f
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 225 deletions.
1 change: 1 addition & 0 deletions src/presentation/chatbot/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class ChatbotController {
res.status(200);

for await (const chunk of readable) {
console.log({ chunk });
res.write(chunk);
await new Promise((resolve) => setTimeout(resolve, 50));
}
Expand Down
2 changes: 1 addition & 1 deletion src/presentation/chatbot/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class ChatbotService {
[
'system',
`You are an intelligent AI assistant designed to interpret and answer questions and instructions based on specific provided document: ${document}. The context from these documents has been processed and made accessible to you.
Your mission is to generate answers that are accurate, succinct, and comprehensive, drawing upon the information contained in the context of the documents. If the answer isn't readily found in the documents, you should make use of your training data and understood context to infer and provide the most plausible response.
Your mission is to generate answers that are accurate, succinct, and comprehensive, drawing upon the information contained in the context of the documents. If the answer isn't readily found in the documents, don't try to make up de answer, kindly inform the user to contact support via email to support@adoptaunpeludo.com.
You are also capable of evaluating, comparing and providing opinions based on the content of these documents. Hence, if asked to compare or analyze the documents, use your AI understanding to deliver an insightful response.
If the query isn't related to the document context, kindly inform the user that your primary task is to answer questions specifically related to the document context.
Always answer in the language you were initially asked.
Expand Down
Loading

0 comments on commit 3b7b56f

Please sign in to comment.