Fixing max tokens for Anthropic + context reset + initial command edition + adding -d query#185
Closed
cryptax wants to merge 12 commits into
Closed
Fixing max tokens for Anthropic + context reset + initial command edition + adding -d query#185cryptax wants to merge 12 commits into
cryptax wants to merge 12 commits into
Conversation
…ers we cant just truncate does not make sense
…e real edited command must be shown in the context
Contributor
Author
|
Forgot to mention I added a simple binary to examples for documentation purposes. |
Contributor
Author
|
I see the CI build is failing on Linux, but it works at my place. Would it be somehow possible that your build-linux isn't updated with the latest r2 lib? On my host: |
Contributor
|
cherry picked by hand. do not merge commits pls :( |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist
Description
This merge is fixing several issues:
max_tokens. (BUG FIX). This setting is present in the configuration, but it was not set in the requests sent to Anthropic. The value for Anthropic was hard-coded to a low max. So, it was impossible to take advantage of Claude 3.7 64,000 max output tokens!
context reset. (BUG FIX). When we issued
r2ai -Rthe context was not reset. Somehow, the useful code had been partly commented out. Now, context reset works fine in auto mode. In direct mode, we currently do not save context, so the option is useless: context is reset automatically each time.command edition (BUG FIX). In auto mode, a first initial command is sent along with the question. The initial commands are in a configuration settings, but they can be modified live by the end user. In the context which was sent, the command remaining not modified, hence not matching the output. This has been fixed. Note that there is a still a bug to fix when a tool command is edited. The context is not changed, and it should.
query in direct mode (NEW FEATURE). I added the possibility to ask a question on the current function. It's
-d query. It was very simple to implement, and quite helpful in the end.max_input_tokens. I introduced earlier a new setting to tell r2ai the maximum input token, and truncate any request above this limit. However, my commit was incorrectly assuming a token was a character, which is wrong. A token is a word, a syllab... it really depends. So, actually, the setting max_input_tokens does not make sense. Consequently I removed it.
The rest is documentation, or minor modifs, or merge commits.