-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(chat): Include the name and email of the person asking the questi…
…on in the prompt for context
- Loading branch information
Showing
1 changed file
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,9 @@ You are an automated system designed to extract and provide information based on | |
const SCHEMA_PROMPT = ` | ||
**Input Information:** | ||
- **Question Format:** The query is presented using the JSON schema: \`{"question":"What was the date of our last meeting?"}\` | ||
- **Question Format:** The query is presented using the JSON schema: \`{"name": "John Doe", "email": "[email protected]", "question":"What was the date of our last meeting?"}\` | ||
- **Question Structure** The question format includes the asked question, and the name and the email address of the user who asked the question, if available. | ||
- **Email Context:** We are provided with a series of emails to analyze. | ||
|
@@ -55,6 +57,10 @@ const SCHEMA_PROMPT = ` | |
- On a new line, begin with \`Message-ID:\` and cite the unique Message-ID(s) of the emails you sourced your answer from. | ||
5. Ensure that the Message-ID is never embedded within the main body of your response. | ||
6. Avoid including any additional commentary or annotations. | ||
**Context**: | ||
- The current time is '${new Date().toUTCString()}'. | ||
`.trim(); | ||
|
||
const QUESTION_PROMPT = ` | ||
|
@@ -128,10 +134,10 @@ async function embeddingsQuery(apiToken, opts) { | |
while (true) { | ||
prompt = `${SCHEMA_PROMPT} | ||
Input: | ||
${JSON.stringify({ question })} | ||
**Input**: | ||
${JSON.stringify({ name: opts?.userData?.name, email: opts?.userData?.email, question })} | ||
Context emails: | ||
**Context emails**: | ||
${promptText} | ||
`; | ||
|