Skip to content

fix: remove 'over-reaching' python Chat features #62

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

cpsievert
Copy link
Collaborator

@cpsievert cpsievert commented May 30, 2025

This PR removes the python Chat features that were deprecated in #91

Removing these features will bring the chat feature-set of the R and Python packages closer together, and significantly simplifies the Python implementation.

For context, this Chat class predates ellmer, chatlas, and shinychat. Since then, it's become more clear that these features "over-reach" into responsibilities of the AI framework (i.e., chatlas, LangChain, etc), and too tightly coupled UI with LLM state.

For reference, here is the list:

  • Chat(messages=...) was removed. Use chat.ui(messages=...) instead.
  • Chat(tokenizer=...) was removed. This was only relevant for .messages(token_limits=...) which was also removed.
  • All parameters to .messages() were removed. This reflects an overall change philosophy for maintaining the conversation history sent to the LLM -- Chat should no longer be responsible for maintaining it -- another stateful object (perhaps the one provided by chatlas, LangChain, etc.) should be used instead. That said, .messages() is still useful if you want to access UI message state.
  • The transform_user_input and transform_assistant_response decorators were removed. Instead, transformation of input/responses should be done manually and independently of Chat.
  • As a result of the previous removals, .user_input(transform=...) was also removed.
  • The already deprecated .set_user_message() method was officially removed (in favor of .update_user_input())

TODO

@cpsievert cpsievert mentioned this pull request May 30, 2025
3 tasks
@cpsievert cpsievert requested a review from Copilot May 30, 2025 16:42
Copilot

This comment was marked as outdated.

@cpsievert cpsievert changed the title Pare down python Chat features fix: remove 'over-reaching' python Chat features Aug 5, 2025
@cpsievert cpsievert force-pushed the gut-py-chat branch 3 times, most recently from 6cb91e4 to 0ffbada Compare August 5, 2025 21:42
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.

1 participant