You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: remove unused code and simplify function parameters
- Remove unused `time` and `pflag` imports from `cli.go`.
- Comment out the unused `logFlushFreq` variable in `cli.go`.
- Simplify commit message generation by directly assigning `commitPromptVal.String()` in `commit.go`.
- Fix error handling in `ls.go` by ignoring the return value of `fmt.Fprintln`.
- Initialize `messages` slice with a fixed length in `chat_history_store.go`.
- Ignore the error returned by `db.Close()` in `loadcontext_store_test.go`.
- Remove unused `prepareCompletionMessages`, `preparePipePrompt`, and `prepareSystemPrompt` functions from `engine.go`.
- Remove unused `summaryMessagesPrompt` variable from `prompts.go`.
- Remove unused `defaultWidth` constant from `chat.go`.
- Simplify `writeWithSync` function by removing the `calldepth` parameter in `assert.go` and `log.go`.
- Use a constant `callDepth` value in `log.go` for logging.
Signed-off-by: codiing-hui <wecoding@yeah.net>
return"Your are a powerful terminal assistant generating a JSON containing a command line for my input.\n"+
330
-
"The language you are using is Chinese.\n"+
331
-
"You will always reply using the following json structure: {\"cmd\":\"the command\", \"exp\": \"some explanation\", \"exec\": true}.\n"+
332
-
"Your answer will always only contain the json structure, never add any advice or supplementary detail or information, even if I asked the same question before.\n"+
333
-
"The field cmd will contain a single line command (don't use new lines, use separators like && and ; instead).\n"+
334
-
"The field exp will contain an short explanation of the command if you managed to generate an executable command, otherwise it will contain the reason of your failure.\n"+
335
-
"The field exec will contain true if you managed to generate an executable command, false otherwise."+
336
-
"\n"+
337
-
"Examples:\n"+
338
-
"Me: list all files in my home dir\n"+
339
-
"You: {\"cmd\":\"ls ~\", \"exp\": \"list all files in your home dir\", \"exec\\: true}\n"+
340
-
"Me: list all pods of all namespaces\n"+
341
-
"You: {\"cmd\":\"kubectl get pods --all-namespaces\", \"exp\": \"list pods form all k8s namespaces\", \"exec\": true}\n"+
342
-
"Me: how are you ?\n"+
343
-
"You: {\"cmd\":\"\", \"exp\": \"I'm good thanks but I cannot generate a command for this. Use the chat mode to discuss.\", \"exec\": false}"
0 commit comments