Skip to content

Commit

Permalink
beta106
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoshinonyaruko committed May 4, 2024
1 parent 777aaa0 commit 3ccedea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
3 changes: 2 additions & 1 deletion applogic/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ func getRandomItem(items []string) string {
}

func processSelection(promptStrStat int, promptLength int, promptStr string) string {
senceId := promptLength - promptStrStat + 1
senceId := promptLength - promptStrStat
fmtf.Printf("processSelection senceId:%v", senceId)

envContents := config.GetEnvContents(fmt.Sprintf("%s-env", promptStr))
selectedContent := stripPrefix(getRandomItem(selectBasedOnSenceId(envContents, senceId)))
Expand Down
16 changes: 5 additions & 11 deletions applogic/gensokyo.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,9 @@ func (app *App) GensokyoHandler(w http.ResponseWriter, r *http.Request) {
}
}

// 刷新新的提示词给用户目前的状态
// 获取新的信号长度
PromptMarksLength := config.GetPromptMarksLength(newPromptStr)

app.InsertCustomTableRecord(message.UserID, newPromptStr, PromptMarksLength)
fmt.Printf("流转prompt参数: %s,newPromptStrStat:%d\n", newPromptStr, PromptMarksLength)
// 刷新新的提示词给用户目前的状态 新的场景应该从1开始
app.InsertCustomTableRecord(message.UserID, newPromptStr, 1)
fmt.Printf("流转prompt参数: %s,newPromptStrStat:%d\n", newPromptStr, 1)
promptstr = newPromptStr
}
}
Expand All @@ -156,11 +153,8 @@ func (app *App) GensokyoHandler(w http.ResponseWriter, r *http.Request) {

// MARK: 提示词之间 整体切换Q 当用户没有存档时
app.ProcessPromptMarks(message.UserID, message.Message.(string), &promptstr)

// 在切换分支后,再获取长度
PromptMarksLength := config.GetPromptMarksLength(promptstr)

err = app.InsertCustomTableRecord(message.UserID, promptstr, PromptMarksLength)
// 初始状态就是 1
err = app.InsertCustomTableRecord(message.UserID, promptstr, 1)
if err != nil {
fmt.Printf("app.InsertCustomTableRecord 出错: %s\n", err)
}
Expand Down

0 comments on commit 3ccedea

Please sign in to comment.