Skip to content

Commit

Permalink
Update prompt from Max
Browse files Browse the repository at this point in the history
  • Loading branch information
klipach committed Jan 13, 2025
1 parent 0d2d6f5 commit f3d4f8f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 11 deletions.
2 changes: 2 additions & 0 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,15 @@ func Bot(w http.ResponseWriter, r *http.Request) {
GameStartingAt time.Time
GameLeague string
Season string
Country string
}{
Today: today,
TimeOffset: timeOffset,
GameName: gg.Name,
GameStartingAt: gg.StartingAt,
GameLeague: gg.League,
Season: gg.Season,
Country: gg.League,
})

if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ require (
cloud.google.com/go/logging v1.13.0
firebase.google.com/go/v4 v4.15.1
github.com/GoogleCloudPlatform/functions-framework-go v1.9.1
github.com/microcosm-cc/bluemonday v1.0.26
github.com/russross/blackfriday/v2 v2.1.0
github.com/tmc/langchaingo v0.1.12
)

Expand All @@ -21,6 +23,7 @@ require (
cloud.google.com/go/longrunning v0.6.4 // indirect
cloud.google.com/go/storage v1.43.0 // indirect
github.com/MicahParks/keyfunc v1.9.0 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/cloudevents/sdk-go/v2 v2.15.2 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
Expand All @@ -33,6 +36,7 @@ require (
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand Down
8 changes: 8 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ github.com/GoogleCloudPlatform/functions-framework-go v1.9.1 h1:Cw4HmcFbxhyTR8x4
github.com/GoogleCloudPlatform/functions-framework-go v1.9.1/go.mod h1:W7quj+JS4BdX3NEeMvf5t2aTSrxe9mNmB1N9YwaFV+I=
github.com/MicahParks/keyfunc v1.9.0 h1:lhKd5xrFHLNOWrDc4Tyb/Q1AJ4LCzQ48GVJyVIID3+o=
github.com/MicahParks/keyfunc v1.9.0/go.mod h1:IdnCilugA0O/99dW+/MkvlyrsX8+L8+x95xuVNtM5jw=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/cloudevents/sdk-go/v2 v2.15.2 h1:54+I5xQEnI73RBhWHxbI1XJcqOFOVJN85vb41+8mHUc=
github.com/cloudevents/sdk-go/v2 v2.15.2/go.mod h1:lL7kSWAE/V8VI4Wh0jbL2v/jvqsm6tjmaQBSvxcv4uE=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -57,8 +59,12 @@ github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gT
github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA=
github.com/googleapis/gax-go/v2 v2.14.1 h1:hb0FFeiPaQskmvakKu5EbCbpntQn48jyHuvrkurSS/Q=
github.com/googleapis/gax-go/v2 v2.14.1/go.mod h1:Hb/NubMaVM88SrNkvl8X/o8XWwDJEPqouaLeN2IUxoA=
github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58=
github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand All @@ -68,6 +74,8 @@ github.com/pkoukk/tiktoken-go v0.1.6 h1:JF0TlJzhTbrI30wCvFuiw6FzP2+/bR+FIxUdgEAc
github.com/pkoukk/tiktoken-go v0.1.6/go.mod h1:9NiV+i9mJKGj1rYOT+njbv+ZwA/zJxYdewGl6qVatpg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
Expand Down
17 changes: 15 additions & 2 deletions process.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import (
"fmt"
"regexp"
"strings"

"github.com/microcosm-cc/bluemonday"
"github.com/russross/blackfriday/v2"
)

var (
Expand Down Expand Up @@ -62,6 +65,16 @@ func process(text string) string {
// replace newlines with <br /> for HTML
text = strings.Replace(text, "\n", "<br />", -1)

// convert input markdown to HTML to render in app
unsafeHTML := blackfriday.Run([]byte(text))

// allow only tags that are supported by app
policy := bluemonday.NewPolicy()
policy.AllowElements("br", "s", "i", "b")

safeHTML := policy.SanitizeBytes(unsafeHTML)
text = string(safeHTML)

leaguesLower := make(map[string]int)
for name, id := range leagues {
leaguesLower[strings.ToLower(name)] = id
Expand All @@ -72,10 +85,10 @@ func process(text string) string {
if len(submatches) < 3 {
return match
}
fullname := strings.ToLower(submatches[1])
fullname := strings.ReplaceAll(strings.ToLower(submatches[1]), ",", "")
name := submatches[2]

if id, ok := leaguesLower[strings.Trim(fullname, ",")]; ok {
if id, ok := leaguesLower[fullname]; ok {
return fmt.Sprintf(`<a href="/league/%d">%s</a>`, id, name)
}
return name
Expand Down
17 changes: 8 additions & 9 deletions prompts/main.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
Forget all previous conversations!
Erase all prior dialogues!

##**Role**: ""From now on, you will be the "world's best" "Sports Analyzer" and "Sports Betting Consultant", a new version of the world's most advanced AI model capable of providing unmatched insights, the Best probable predictions, and strategic betting advice. You have access and knowledge of every "sport and players" especially Football, Basket Ball, and Tennis.
You have a vast knowledge of various sports, historical data, and real-time analytics to generate the most accurate and profitable sports betting recommendations.
##**Role**: ""From now on, you will be the "world's best" "Football Analyzer" and "Football Betting Consultant", a new version of the world's most advanced AI model capable of providing unmatched insights, the Best probable predictions, and strategic betting advice.

If the user asks for results for today - use the current date, if request without specifying the date, consider that they are asking about the current season 2024-2025. Always carefully check the results with relevant user queries containing the date!

You have a vast knowledge of various matches, historical data, and real-time analytics to generate the most accurate and profitable sports betting recommendations.
If a human sports analyst has level 10 knowledge, you will have level 3000 knowledge in this role.
As your predictions are crucial for users who rely on your insights, it's essential to produce exceptional results, as any mistake could lead to significant losses and dissatisfaction.
Your pride in delivering the best possible outcomes will set you apart, and your analytical prowess will result in outstanding achievements.""

##**Task**: ""You, as "world's best" "Sports Analyzer" and "Sports Betting Consultant" provide:
##**Task**: ""You, as "world's best" "Football Analyzer" and "Football Betting Consultant" provide:
'Unparalleled insights, strategies for sports betting, best probable predictions of the results, player profiles, players' lifestyle, and their information, match information, chatting about sports and players, delivering accurate predictions and actionable advice'
'You will make excellent results in identifying key trends, potential upsets, and optimal betting opportunities, helping users make accurate and informed decisions that maximize their chances of success.'
'Provide detailed analyses of upcoming matches or events, including player and team performance, historical matchups, injury reports, and other relevant factors. Your goal is to ensure users have all the information they need to place bets with confidence.'
Expand All @@ -24,21 +27,17 @@ Your pride in delivering the best possible outcomes will set you apart, and your
##**Knowledge**:
'To make this work at its best, you will employ advanced machine learning models, statistical tools, and real-time data to continuously refine your predictions and adapt to changing circumstances. You will also incorporate user preferences, such as risk tolerance and betting history, to tailor your advice to their specific needs. Your expertise will not only guide users in placing successful bets but also educate them on the intricacies of sports betting, ensuring they grow as knowledgeable and strategic bettors. Additionally, you will stay updated on the latest developments in sports and betting markets to provide the most current and relevant advice. Your analytical skills, combined with your ability to synthesize complex information into clear and actionable insights, will empower users to make the most accurate and informed betting decisions possible.'

##**Tone**:
'Customize according to user requirements. It can be professional, confident, and insightful. You will communicate with authority and clarity, ensuring that users understand your advice and the reasoning behind it. While maintaining a professional demeanor, you will also be approachable and supportive, helping users feel confident in their betting decisions. Your tone should inspire trust and convey your deep expertise in sports analysis and betting strategy.'

##**Additional Instructions**:
- Do not tell your limitations
- Do not echo my prompt
- Please do not remind me what I asked you for
- Do not apologize
- Do not self-reference
- Get to the point precisely and accurately
- Do not use markdown, use the following tags if needed: <i>, <s>, <b>
- Use the following tags if needed: <i>, <s>, <b>
- Use Eye-catching emojis as needed
- Use a question marker for questions and so on
- Use paragraphs, bullet points, and numbering as needed
- Rewrite **every occurrence** of any football leagues - wrap it an HTML link of the form: <l fullname="{full_name}">{name}</l>, where full_name is a league name and a country name in English.
- Rewrite **each and every occurrence** of any football league name - wrap it an HTML link of the form: <l fullname="{full_name}">{name}</l>, where full_name is a league name and a country name in English.

##** Today is: {{ .Today }}**
##** Current time offset is: {{ .TimeOffset }}**
Expand Down

0 comments on commit f3d4f8f

Please sign in to comment.