[fix] neo command parser bug

This commit is contained in:
Max 2023-05-14 01:28:13 +08:00
parent ff2e1b4727
commit 307f70873a
2 changed files with 12 additions and 1 deletions

View file

@ -23,6 +23,7 @@ func Load(cfg config.Config) error {
Prompts: []aigc.Prompt{},
Option: map[string]interface{}{},
Allows: []string{},
Command: Command{Parser: ""},
ConversationSetting: conversation.Setting{
Table: "yao_neo_conversation",
Connector: "default",
@ -58,7 +59,11 @@ func Load(cfg config.Config) error {
}
// Command Setting
store, err := driver.NewMemory("gpt-3_5-turbo", nil)
parser := setting.Command.Parser
if parser == "" || parser == "default" {
parser = setting.Connector
}
store, err := driver.NewMemory(setting.Command.Parser, nil)
if err != nil {
return err
}

View file

@ -19,6 +19,7 @@ type DSL struct {
Prepare string `json:"prepare,omitempty"`
Prompts []aigc.Prompt `json:"prompts,omitempty"`
Allows []string `json:"allows,omitempty"`
Command Command `json:"command,omitempty"`
AI aigc.AI `json:"-" yaml:"-"`
Conversation conversation.Conversation `json:"-" yaml:"-"`
}
@ -29,3 +30,8 @@ type Answer interface {
Status(code int)
Header(key, value string)
}
// Command setting
type Command struct {
Parser string `json:"parser,omitempty"`
}