Consider removing `commons_server()` from API
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44
- Forks
- 1
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 142
Description
And using shinychat::chat_server() instead.
Currently, commons_server() does 3 things:
- Creates a
commons_server_startspan.- Could be removed considering that Shiny already has instrumentation for the session's lifecycle?
- Creates a conversation id.
- This is a hack (that I added) and can go away when we have https://github.com/posit-dev/shinychat/pull/343
- "Pre-warms" the client (i.e., builds the index, etc).
- We might want to revisit how this works, but regardless, it might be better if this was explicit rather than implicit. Essentially the (recommended) API would change from:
client <- ...
commons_server("chat", client)
to
client <- ...
client$prewarm()
chat_server("chat", client)
I'm not sure if it's possible today, but at least at some point it should be possible to prewarm/cache the index independently of the shiny runtime. In that case, you might not want the pre-warming at all?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the commons_server() entry point and its three responsibilities: the commons_server_start span, conversation ID creation, and client pre-warming. Compare these with shinychat::chat_server() and the proposed client$prewarm() flow. Done means the API direction and treatment of each responsibility are decided, including whether pre-warming remains implicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100