Skip to content

Conversation

@PiotrCzapla
Copy link
Contributor

Streaming allows users to start reading the response as soon as the first fragment is generated by the API, significantly improving perceived speed.

litellm is now imported lazily so that a spinner can be shown while it loads and sends the first response. This makes the ssage command feel faster and more responsive.

Added support for Ctrl+C, letting users interrupt ssage mid-sentence — perfect for recalling an exact command and skipping the rest of the explanation.
Example:

ssage gh mk pr
I can see you're trying to create a pull request with GitHub CLI, but the command syntax isn't quite right.

The correct command is:

gh pr create

This will interactively prompt you
Interrupted.

Here is how this pr looks like in action:

output.mp4

PS. how do you clean the diffs of Jupyter notebooks (apart of nbdev_clean)? The vscode gets very confused with the diffs so I end up working on raw json file. :(

@gitnotebooks
Copy link

gitnotebooks bot commented Nov 7, 2025

Found 1 changed notebook. Review the changes at https://app.gitnotebooks.com/AnswerDotAI/shell_sage/pull/63

Streaming allows users to start reading the response as soon as the first fragment is generated by the API, significantly improving perceived speed.

litellm is now imported lazily so that a spinner can be shown while it loads and sends the first response. This makes the ssage command feel faster and more responsive.

Added support for Ctrl+C, letting users interrupt ssage mid-sentence — perfect for recalling an exact command and skipping the rest of the explanation.
Example:
```py
ssage gh mk pr
I can see you're trying to create a pull request with GitHub CLI, but the command syntax isn't quite right.

The correct command is:
```
 gh pr create
```
This will interactively prompt you
Interrupted.
```
for o in sage(q, max_steps=10, stream=True, api_base=opts.api_base, api_key=opts.api_key): ...
return o.choices[0].message.content
gen = sage(q, max_steps=10, stream=True, api_base=opts.api_base, api_key=opts.api_key)
yield from accumulate(o.choices[0].delta.content or "" for o in gen if isinstance(o, ModelResponseStream))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clever!

Copy link
Contributor

@ncoop57 ncoop57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks amazing, ty so much!! I especially like how you fixed the stream printing in Jupyter!!

@ncoop57 ncoop57 merged commit 96389c0 into AnswerDotAI:main Nov 24, 2025
@ncoop57 ncoop57 added the enhancement New feature or request label Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants