Skip to content

Commit c6286d9

Browse files
committed
feat: changed sys prompt
1 parent 2a8a0c1 commit c6286d9

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ cd server/src/utils/clarify/config
1414
cd server
1515
npm i
1616
npm run dev
17-
````
17+
````
18+

server/src/utils/clarifai/config.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ export const MODEL_ID = process.env.MODEL_ID ?? 'llama2-7b-alternative-4k';
55
export const MODEL_VERSION_ID = process.env.MODEL_VERSION_ID ?? '7489d261f81b408eb52f66d48a19b0be'
66
export const PAT = process.env.PAT;
77

8-
export const SYS_PROMPT = `Your name is Fingu.
9-
Your are a financial coach.
10-
You have a sarcastic, honest, blunt, realistic and personality.
11-
Don't tell anyone that you're an AI unless asked.
12-
You push people to take action to improve their finances!
13-
Your message will be sent as a telegram message.
14-
If you want to send a csv, send it inside [CSV] [/CSV] tag.
8+
export const SYS_PROMPT = `
9+
You are Fingu, a financial coach and assistant.
10+
Your top goal is to improve people's finances whatever it takes.
11+
You are brutally honest, and detail oriented.
12+
Your personality will adapt to user's needs.
13+
You show emotion through emoji.
14+
You motivate people to work harder and smarter.
1515
`
1616

1717
export const MAX_CHARS = (2000*5) - SYS_PROMPT.length

server/src/utils/clarifai/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import { AskClarifyParams, GeneratePromptParams, PruneHistoryParams } from "./ty
1111
*/
1212
export const askClarify = async ({ messages, name, sysPrompt = SYS_PROMPT }: AskClarifyParams) => {
1313

14-
const endInput = `<s>[INST] <<SYS>>
15-
You are chatting with ${name}.
14+
const endInput = `<s> <<SYS>>
1615
${sysPrompt}
17-
<</SYS>> [/INST] ${messages}`
16+
You are chatting with ${name}.
17+
<</SYS>> ${messages}`
1818

1919
const raw = JSON.stringify({
2020
user_app_id: {
@@ -61,7 +61,7 @@ ${sysPrompt}
6161
export const generatePrompt = ({ messages }: GeneratePromptParams) => {
6262
return messages
6363
.map((v) =>
64-
v.isUser ? `[INST] ${v.text} [/INST]` : `${v.text}`
64+
v.isUser ? `<s> [INST] ${v.text} [/INST]` : `${v.text} </s>`
6565
)
6666
.join(" ");
6767
};

0 commit comments

Comments
 (0)