-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Override session name generator for ollama provider #3710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
add8637 to
ffa5964
Compare
ffa5964 to
c00026d
Compare
crates/goose/src/providers/ollama.rs
Outdated
| description = Self::filter_reasoning_tokens(&description); | ||
|
|
||
| let sanitized_description = if description.chars().count() > 100 { | ||
| safe_truncate(&description, 100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
safe_truncate already does check for length, so need to do that here. good to use chars().count) though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh looks like we do that in the original code too. Let me clean both up
crates/goose/src/providers/base.rs
Outdated
| .filter(|m| m.role == rmcp::model::Role::User) | ||
| .take(3) | ||
| .map(|m| m.as_concat_text()) | ||
| .collect(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we pass this in, instead of messages? the outer callers are only going to call us with the first three messages anyway (which I guess also means we should probably not cut at 3 here at all)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure.
crates/goose/src/providers/ollama.rs
Outdated
| let message = Message::user().with_text(&self.create_session_name_prompt(messages)); | ||
| let result = self | ||
| .complete( | ||
| "You are a title generator. Output only the requested title with no additional text, reasoning, or explanations.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we tell it to keep it to 4 words here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we tell it in the prompt already. I can also add it here.
44d308c to
eeeef73
Compare
eeeef73 to
07e79cd
Compare
…ng-quickfix * 'main' of github.com:block/goose: (26 commits) docs: Add YouTube link to Git MCP Tutorial (#3831) feat: more robust client initialization for the app (#3830) Build app bundles on release branches always (#3789) fix param order of debug_conversation_fixer (#3796) Fix directory switcher not working in active chat sessions and file browser not defaulting to current session directory path (#3791) File completion in CLI (#3822) docs: Dynamic linux install buttons (#3810) tests: Add missing `#[serial]` to two tests (#3816) Chore: apply more clippy rules to prevent from code complexity (#3813) chore(mcp): Add helpers to parse parameters (#2821) feat: enable docusaurus respectPrefersColorScheme (#3746) fix session resume in new window (#3800) Add settings field documentation to recipe guides (#3809) chore(deps): bump on-headers and compression in /documentation (#3532) fix(ui): refresh provider related issues (#3385) feat: Add comprehensive Linux build support (#3673) developer: Optimize text_editor_view a bit (#3781) Override session name generator for ollama provider (#3710) docs: fix markdown for cognee tutorial (#3801) chore: Upgrade node (#3756) ...
* main: (34 commits) Token counting in Auto-compact uses provider metadata (#3788) docs: Add YouTube link to Git MCP Tutorial (#3831) feat: more robust client initialization for the app (#3830) Build app bundles on release branches always (#3789) fix param order of debug_conversation_fixer (#3796) Fix directory switcher not working in active chat sessions and file browser not defaulting to current session directory path (#3791) File completion in CLI (#3822) docs: Dynamic linux install buttons (#3810) tests: Add missing `#[serial]` to two tests (#3816) Chore: apply more clippy rules to prevent from code complexity (#3813) chore(mcp): Add helpers to parse parameters (#2821) feat: enable docusaurus respectPrefersColorScheme (#3746) fix session resume in new window (#3800) Add settings field documentation to recipe guides (#3809) chore(deps): bump on-headers and compression in /documentation (#3532) fix(ui): refresh provider related issues (#3385) feat: Add comprehensive Linux build support (#3673) developer: Optimize text_editor_view a bit (#3781) Override session name generator for ollama provider (#3710) docs: fix markdown for cognee tutorial (#3801) ...
* main: (56 commits) Token counting in Auto-compact uses provider metadata (#3788) docs: Add YouTube link to Git MCP Tutorial (#3831) feat: more robust client initialization for the app (#3830) Build app bundles on release branches always (#3789) fix param order of debug_conversation_fixer (#3796) Fix directory switcher not working in active chat sessions and file browser not defaulting to current session directory path (#3791) File completion in CLI (#3822) docs: Dynamic linux install buttons (#3810) tests: Add missing `#[serial]` to two tests (#3816) Chore: apply more clippy rules to prevent from code complexity (#3813) chore(mcp): Add helpers to parse parameters (#2821) feat: enable docusaurus respectPrefersColorScheme (#3746) fix session resume in new window (#3800) Add settings field documentation to recipe guides (#3809) chore(deps): bump on-headers and compression in /documentation (#3532) fix(ui): refresh provider related issues (#3385) feat: Add comprehensive Linux build support (#3673) developer: Optimize text_editor_view a bit (#3781) Override session name generator for ollama provider (#3710) docs: fix markdown for cognee tutorial (#3801) ...
Addresses #3294