-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v3.0.12: add chat -e (edit) flag, don't remove chat file backup
Add edit parameter to Chat, pass to continueChat method summary of diff --git a/v3/core/api.go b/v3/core/api.go - Add 'edit' boolean parameter to `Chat` function signature - Pass 'edit' parameter to `history.continueChat` method call within `Chat` function Refactor chat functionality, enhance edit feature, improve logging summary of diff --git a/v3/core/chat.go b/v3/core/chat.go - Add `time` package to imports - Rename parameter `level` to `contextLevel` in `continueChat` function signature and usage - Introduce `edit` boolean parameter in `continueChat` function to allow editing behavior - Implement prompt retrieval from most recent message if `edit` is true - Append the user's prompt to messages conditionally based on `edit` status - Include error checking and debug logging for `continueChat` execution - Adjust role attribution from "AI" to "USER" in `parseChat` for preamble content - Trim and uppercase `role` in `fixRole` before switching on its value - Adapt backup file naming in `Save` to include a timestamp - Optionally preserve backup file based on a condition check (commented out with XXX marker) Add false parameter to grok.Chat and continueChat calls summary of diff --git a/v3/core/chat_test.go b/v3/core/chat_test.go - Append an additional false parameter to the grok.Chat function call in the test for starting a chat and checking the color of the widget's center - Add a false argument to the continueChat method call in multiple instances to specify a new behavior or flag - Ensure all grok.Chat and history.continueChat function calls within TestChatSummarization consistently include this new false parameter Import go-shlex, add edit flag, implement file editing. summary of diff --git a/v3/core/cli.go b/v3/core/cli.go - Import `github.com/anmitsu/go-shlex` in `v3/core/cli.go` - Add `Edit` boolean field with a short flag `-e` and help text to `cmdChat` struct - Implement feature to open the chat file in `GROKKER_EDITOR` for editing if the `-e` flag is set - Pass `edit` flag to `grok.Chat` function call to possibly incorporate editing logic - Define `EditFile` function to facilitate opening and editing the chat file in the specified editor - Ensure `EditFile` appends a `### USER` heading to the chat file if it's not present at the end before opening in editor - Use `shlex.Split` to correctly split the editor command allowing for commands with spaces Add print statement for temp directory path in TestCliChat summary of diff --git a/v3/core/cli_test.go b/v3/core/cli_test.go - Add print statement to output temporary directory path in TestCliChat function Update version in grokker.go to 3.0.12 summary of diff --git a/v3/core/grokker.go b/v3/core/grokker.go - Update version from 3.0.11 to 3.0.12 in grokker.go Uncomment debug line to print messages with Debug, Spprint summary of diff --git a/v3/core/openai.go b/v3/core/openai.go - Uncomment the debug line to print message contents using `Debug` function and `Spprint` for formatting Add go-shlex, assert/v2, and repr as dependencies summary of diff --git a/v3/go.mod b/v3/go.mod - Add `github.com/anmitsu/go-shlex` dependency with version `v0.0.0-20200514113438-38f4b401e2be` - Include `github.com/alecthomas/assert/v2` as an indirect dependency with version `v2.3.0` - Include `github.com/alecthomas/repr` as an indirect dependency with version `v0.2.0` Update assert and repr, add go-shlex with go.mod files summary of diff --git a/v3/go.sum b/v3/go.sum - Update github.com/alecthomas/assert from v2.1.0 to v2.3.0 - Add go.mod for github.com/alecthomas/assert v2.3.0 - Update github.com/alecthomas/repr from v0.1.0 to v0.2.0 - Add go.mod for github.com/alecthomas/repr v0.2.0 - Add github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be - Add go.mod for github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be
- Loading branch information
Showing
9 changed files
with
131 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.