Skip to content

Conversation

@gadenbuie
Copy link
Collaborator

Currently chat_append() returns a promise that resolves when the stream is complete, but it resolves to a value of NULL or an error if one occurs.

This PR updates chat_append_stream_impl() to collect the stream results and return them as the final value of the resolved promise.

@gadenbuie gadenbuie changed the base branch from main to rc-v0.2.0 May 13, 2025 18:00
@gadenbuie gadenbuie marked this pull request as ready for review May 13, 2025 18:30
@gadenbuie gadenbuie requested a review from cpsievert May 13, 2025 18:30
@gadenbuie gadenbuie merged commit 1f62e2d into rc-v0.2.0 May 15, 2025
1 check passed
@gadenbuie gadenbuie deleted the feat/return-results-from-chat-append branch May 15, 2025 02:56
gadenbuie added a commit that referenced this pull request May 16, 2025
* Increment version number to 0.2.0

* chore: Add update js assets to release bullets

* chore: polish news

* chore: revdepcheck::cloud_check()

* chore: update cran comments

* docs: update pkgdown site

* chore: update shinychat.js

* feat: Add shinychat hex logo

* chore: update logo

* feat: Use silent error in `chat_append()` to avoid crashing app (#46)

* feat: Don't crash app with an error in `chat_append_stream()`

* feat: Improve formatting of error message in chat

* chore: Update news item

* chore: remove unused code

* fix: Avoid unhandled promise error, but still throw silent error

* chore: update comment

* tests(chat_append_stream): Handles errors in the stream

* chore: Suggest {later}

* feat(chat_append): Return stream results as promise value (#45)

* feat(chat_append): Return stream results as value of promise

* chore: more robust to future ellmer changes

* docs: Add news item

* chore: Use fastmap

* tests(chat_append_stream): Promise resolves to stream contents

* docs(chat_append): Document resolved promise value

* chore: restore code changes

* avoid warning about fastmap

* rename: test-markdown-stream.R

* chore: organize reference index

* chore: Add Posit ROR id

* ci: Run r-cmd-check on all pull requests

* chore: Update shinychat.js assets

* chore: Use branch with fix

* tests: update snaps

* chore: Garrick as maintainer
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.

3 participants