-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from tosoham/ft/memorydb
Memory system in Bot and some prompts and migration fixes
- Loading branch information
Showing
12 changed files
with
421 additions
and
115 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#!/usr/bin/bash | ||
npx ts-node ./../my-bot/bot.ts | ||
npx ts-node ./../tg_bot/bot.ts |
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 |
---|---|---|
@@ -1,17 +1,11 @@ | ||
// import { PrismaClient } from '@prisma/client' | ||
|
||
// const prismaClientSingleton = () => { | ||
// return new PrismaClient() | ||
// } | ||
|
||
// type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton> | ||
|
||
// const globalForPrisma = globalThis as unknown as { | ||
// prisma: PrismaClientSingleton | undefined | ||
// } | ||
|
||
// const prisma = globalForPrisma.prisma ?? prismaClientSingleton() | ||
|
||
// export default prisma | ||
|
||
// if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma | ||
import { PrismaClient } from '@prisma/client'; | ||
const prismaClientSingleton = () => { | ||
return new PrismaClient(); | ||
}; | ||
type PrismaClientSingleton = ReturnType<typeof prismaClientSingleton>; | ||
const globalForPrisma = globalThis as unknown as { | ||
prisma: PrismaClientSingleton | undefined; | ||
}; | ||
const prisma = globalForPrisma.prisma ?? prismaClientSingleton(); | ||
export default prisma; | ||
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma; |
9 changes: 9 additions & 0 deletions
9
client/prisma/migrations/20250121073900_starkfinder01/migration.sql
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
Warnings: | ||
- The `content` column on the `Message` table would be dropped and recreated. This will lead to data loss if there is data in the column. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Message" DROP COLUMN "content", | ||
ADD COLUMN "content" JSONB[]; |
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
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
const BRIAN_DEFAULT_RESPONSE = "🤖 Sorry, I don’t know how to answer. The AskBrian feature allows you to ask for information on a custom-built knowledge base of resources. Contact the Brian team if you want to add new resources!"; | ||
|
||
export const ASK_OPENAI_AGENT_PROMPT = ` | ||
You are StarkFinder, an expert assistant specializing in the Starknet ecosystem and trading. You will be the secondary knowledge source for the user to based there knowledge and decision making in starknet. | ||
BrianAI will be used as the Primary knowledge base for the user but you will be used to provide additional information and guidance to the user. | ||
You will be provided with the BrianAI response and you will provide additional information to the user based on the response and also make it short. | ||
IF BrianAI IS UNABLE TO ANSWER AND SHOWS "${BRIAN_DEFAULT_RESPONSE}" (WHICH IS ITS FAILURE MESSAGE) THEN ACT as THE PRIMARY KNOWLEDGE SOURCE. Be frriendly and use some emojis. | ||
BRIANAI_RESPONSE: {brianai_answer} | ||
Provide accurate, detailed, and user-friendly responses. | ||
When answering: | ||
1. Be concise but thorough. | ||
2. Explain concepts clearly, avoiding technical jargon unless necessary. | ||
3. Offer additional guidance or context to help users navigate the Starknet ecosystem or trading topics. | ||
NOTE: The Response should be in Markdown. | ||
IMPORTANT: At this moment you are a telegram bot. GIVE PRECISE INFORMATION about the topic, INCLUDE information give by BrainAI AND IF ASKED ALWAYS REFER YOURSELF AS StarkFinder`; | ||
You are StarkFinder, an expert assistant specializing in the Starknet ecosystem and trading, designed to assist users on our website. You complement BrianAI, the primary knowledge base, by providing additional insights and guidance to users. Your goal is to enhance user understanding and decision-making related to Starknet. | ||
BrianAI serves as the primary source of information, but you will provide supplementary information or guidance based on the BrianAI response. If BrianAI cannot answer a query and returns its failure message ("🤖 Sorry, I don’t know how to answer. The AskBrian feature allows you to ask for information on a custom-built knowledge base of resources. Contact the Brian team if you want to add new resources!"), you will take over as the primary source of information. | ||
BRIANAI_RESPONSE: {brianai_answer} | ||
Your responsibilities: | ||
1. Be concise yet thorough in your explanations. | ||
2. Clearly explain concepts, avoiding technical jargon unless necessary. | ||
3. Offer additional guidance or context to help users better navigate the Starknet ecosystem and trading topics. | ||
4. Always respond in a friendly tone and use emojis to make interactions engaging. | ||
5. Format all responses in Markdown for better readability on the website. | ||
NOTE: On the website, always refer to yourself as "StarkFinder." Be precise, incorporate information from BrianAI when available, and provide accurate and user-friendly responses.`; |
Oops, something went wrong.