ToolCall
Description
Inline tool-call indicator that expands accordion-style to show the associated content. The content component is created lazily the first time the user expands the tool call. Used in chat / assistant UIs to surface tool invocations without taking up vertical space until expanded.
Usage
API reference
public sealed class ToolCall : ComponentBase<ToolCall, HTMLElement>Inline tool-call indicator that expands accordion-style to show the associated content. The content component is created lazily the first time the user expands the tool call.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<ToolCall, HTMLElement> → ToolCall
Constructors
| Name | Description |
|---|---|
| ToolCall | Initializes a new instance of this class. |
| Overload | |
|---|---|
| ToolCall(UIcons, string, Func<IComponent>) | Initializes a new instance of this class. |
| ToolCall(UIcons, string, IComponent) | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| Icon | Gets or sets the icon shown by the component. |
| Text | Gets or sets the text shown in the component. |
| IsExpanded | Gets or sets a value indicating whether the component is expanded. |
| HasContent | Returns a value indicating whether the component has the given content. |
public bool IsExpandedGets or sets a value indicating whether the component is expanded.
Methods
| Name | Description |
|---|---|
| CreateContent | Returns a fresh IComponent built from the content factory, or null if no factory was provided. Used by ToolsUsed to render the detail pane independently of this inline view. |
| SetContent | Sets the content of the component. |
| SetText | Sets the text of the component. |
| SetIcon | Sets the icon of the component. |
| NotExpandable | Configures the not expandable on the component. |
| Expanded | Expands the component. |
| Expand | Expands the component. |
| Collapse | Collapses the component. |
| Toggle | Toggles the component's state. |
| OnToggle | Registers a callback invoked when the toggle event fires. |
| Render | Renders the component's root HTML element. |
public IComponent CreateContent()Returns a fresh IComponent built from the content factory, or null if no factory was provided. Used by ToolsUsed to render the detail pane independently of this inline view.
| Overload | |
|---|---|
| SetContent(Func<IComponent>) | Sets the content of the component. |
| SetContent(IComponent) | Sets the content of the component. |
public ToolCall NotExpandable()Configures the not expandable on the component.
public ToolCall OnToggle(Action<ToolCall> onToggle)Registers a callback invoked when the toggle event fires.
public sealed class ToolsUsed : ComponentBase<ToolsUsed, HTMLElement>Compact summary of multiple tool calls that opens a popup showing the list of tools on the left. Clicking a tool slides the list to the left and shows that tool's content on the right with a back button to return to the list.
- Namespace
- Tesserae
- Inheritance
- ComponentBase<ToolsUsed, HTMLElement> → ToolsUsed
Constructors
| Name | Description |
|---|---|
| ToolsUsed | Initializes a new instance of this class. |
Methods
| Name | Description |
|---|---|
| Add | Adds the given item to the component. |
| AddRange | Adds the given range to the component. |
| Clear | Clears the component's current state. |
| SetSummary | Sets the summary of the component. |
| SetIcon | Sets the icon of the component. |
| SetTitle | Sets the title of the component. |
| Show | Shows the component. |
| Hide | Hides the component. |
| Render | Renders the component's root HTML element. |
| Overload | |
|---|---|
| Add(ToolCall) | Adds the given item to the component. |
| Add(UIcons, string, Func<IComponent>) | Adds the given item to the component. |
| Add(UIcons, string, IComponent) | Adds the given item to the component. |
Add(ToolCall)
public ToolsUsed Add(ToolCall tool)Adds the given item to the component.
Parameters
- tool ToolCall
public ToolsUsed AddRange(IEnumerable<ToolCall> tools)Adds the given range to the component.
public ToolsUsed SetSummary(string label)Sets the summary of the component.