Skip to content

Feat/tool call UI v2 #80

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 5 commits into
base: feat/tool-call-ui
Choose a base branch
from
Draft

Conversation

cpsievert
Copy link
Collaborator

This PR expands upon #52 to do the following:

  1. Moves a good chunk tool display logic to TypeScript.
    • This allows the R/Python to be simpler in their markup generation and also eliminates the need to pass messages in order to hide tool requests.
    • The Python package doesn't yet make use of it, but puts us in a better place to adopt it eventually.
  2. Gets bookmarking (with tool displays) working.
  3. Fixes various edge cases.
  4. Adopts some of the styling approaches chatlas recently added to better scale to very long input parameters.
    • Admittedly, the current approach doesn't look awesome for simple input parameters -- I'm open to other ideas, but I think this strikes a decent balance of scalable & readable.
Screenshot 2025-07-21 at 11 25 00 AM

This PR also drops a couple more advanced things from #52 since they don't seem necessarily for a v1, and it's also not obvious to me if/how best to support these features

  1. The ability to specify extras = list(display = list(html = , md = , text = )).
    • Given that users can already customize these contents through creating their own subclass of ContentToolRequest , it's not obvious to me that this is worth also supporting.
    • As a side note, I like that we have extras and can teach it as a place for passing information from your tool call to the content extractor(s), but I'm not loving this "special extras" concept.
  2. The ability to specify extras = list(display_tool_request = FALSE)
    • It wasn't clear to me what this was doing or how it's useful.
  3. The ability to specify a tool intent.
    • I can definitely see the value in this, but it feels weird to support it through a tool argument? Also, given that we're going to support annotation.title, it would be that hard to do something similar through that?

TODO

Before reviewing/merging, I would still like to:

  • Finish some minor stylistic details
  • Figure out why export isn't working in the TS
  • Take a pass at documentation
  • Do some more testing

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