Skip to content

Insert newlines after streaming tool results #770

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jdormit
Copy link
Contributor

@jdormit jdormit commented Apr 7, 2025

This is a fix for #769. It ensures that we insert a gptel-response-separator after a tool result comes in in streaming mode. This prevents weird formatting when gptel-include-tool-results is nil and the tool result came in between two chat responses (see the linked issue for details).

@karthink
Copy link
Owner

Thanks for the PR.

This is trickier than it appears. I need to test some edge cases when I can before merging.

@jdormit jdormit force-pushed the jdormit/streaming-tool-result-newline branch from d6b4335 to f55fe33 Compare April 22, 2025 15:58
@jdormit
Copy link
Contributor Author

jdormit commented Apr 24, 2025

Think I've run into one of those edge cases you were talking about @karthink: we should really be inserting the separator before a chat response, rather than after a tool response - otherwise multiple tool calls in a row leads to a bunch of newlines. Not sure if I'll have time to tackle that today but should be able to soon-ish.

@jdormit jdormit force-pushed the jdormit/streaming-tool-result-newline branch from f55fe33 to f36fb33 Compare April 24, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants