Skip to content

Tool calling UI #52

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

Merged
merged 136 commits into from
Aug 7, 2025
Merged

Tool calling UI #52

merged 136 commits into from
Aug 7, 2025

Conversation

gadenbuie
Copy link
Collaborator

@gadenbuie gadenbuie commented May 19, 2025

TODO

  • Update toggle indicator to be a + or - depending on state (with a neat animation)
  • Add article about tool-calling plus shinychat to R package
  • Implement Python interface to tool calling UI
  • Playwright tests
  • R package testthat tests

simonpcouch added a commit to simonpcouch/predictive that referenced this pull request Jun 27, 2025
@cpsievert cpsievert mentioned this pull request Jul 21, 2025
4 tasks
`title` is a reserved attribute in HTML and lit elements,
so we need to avoid using it. I considered also changing
`tool-icon` (and maybe also `tool-intent`), but decided that
the minimal change to have tool name and title is enough.
If we only change `tool-title`, though, then it's odd that
`name` is not `tool-name` as well.
@gadenbuie gadenbuie changed the title WIP: Tool calling UI Tool calling UI Aug 5, 2025
This is required when the tool result display is completely customized by the user, i.e they don't use our `<shiny-tool-result>` component.
Without the custom message, we can't hide the tool result.

Interestingly we need to remember the message because the tool
request and result are being re-rendered frequently while the LLM is
streaming output. For now, we store a set of seen tool request IDs
and we short-circuit tool request rendering if we've already seen
that ID. In the future, if we start new markdown-stream components
when we have a switch in content type, we won't need to remember
between renders.
…contents_shinychat()`

* We now store the data used to create the tool request/result cards
   but avoid rendering them to tags until required.
* This lets someone use `super(content, ContentToolRequest)` to get
   our default data structure that the can modify before it's rendered
   to tags.
* This let users move some computation from tool result time to tool
   request time, which can improve perceived performance and
   reduce storage requirements.

I also updated the `contents_shinychat()` docs to explain how to work with this new feature.
It's just simpler and more consistent
@gadenbuie gadenbuie merged commit 3f087cd into main Aug 7, 2025
11 checks passed
@gadenbuie gadenbuie deleted the feat/tool-call-ui branch August 7, 2025 19:09
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.

2 participants