You've already forked grok
cut @grok prefix before prompting
This commit is contained in:
10
main.go
10
main.go
@@ -71,6 +71,8 @@ func (a *App) handleMessage(ctx context.Context, msg *tgbotapi.Message) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
question := msg.Text[len("@grok"):]
|
||||
|
||||
select {
|
||||
case a.sema <- struct{}{}:
|
||||
default:
|
||||
@@ -79,9 +81,13 @@ func (a *App) handleMessage(ctx context.Context, msg *tgbotapi.Message) error {
|
||||
}
|
||||
defer func() { <-a.sema }()
|
||||
|
||||
a.log.Info("message passed all guards", "text", msg.Text)
|
||||
a.log.Info(
|
||||
"message passed all guards",
|
||||
"og_text", msg.Text,
|
||||
"transformed_text", question,
|
||||
)
|
||||
|
||||
response, err := a.proompter.Prompt(ctx, msg.Text)
|
||||
response, err := a.proompter.Prompt(ctx, question)
|
||||
if err != nil {
|
||||
return fmt.Errorf("prompting: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user