Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ChatCmd = &cobra.Command{ Use: "chat", Short: "chat with llm base on knowledge", Run: func(cmd *cobra.Command, args []string) { if len(args) <= 1 { panic("dirId and history is needed.") } dirIdStr := args[0] dirId, err := strconv.Atoi(dirIdStr) if err != nil { panic(err) } historyStr := fmt.Sprint(strings.Join(args[1:], " ")) history := make([]map[string]string, 0) err = json.Unmarshal([]byte(historyStr), &history) if err != nil { panic(err) } if err := chat(int64(dirId), history); err != nil { panic(err) } }, }
View Source
var IngestCmd = &cobra.Command{ Use: "ingest", Short: "ingest knowledge", Run: func(cmd *cobra.Command, args []string) { if len(args) == 0 { panic("ingest path is needed") } ps := args[0] if err := ingest(ps); err != nil { panic(err) } }, }
View Source
var KeywordsCmd = &cobra.Command{ Use: "keywords", Short: "Extract keywords", Run: func(cmd *cobra.Command, args []string) { ps := args[0] if err := keywords(ps); err != nil { panic(err) } }, }
View Source
var QuestionCmd = &cobra.Command{ Use: "question", Short: "question base on knowledge", Run: func(cmd *cobra.Command, args []string) { question := fmt.Sprint(strings.Join(args, " ")) if err := run(question); err != nil { panic(err) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.