You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/accept-rich-user-input.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -182,6 +182,8 @@ To enable entity tagging as @-mentions in the composer, configure [`entities.onT
182
182
183
183
It should return a list of [Entity](https://openai.github.io/chatkit-js/api/openai/chatkit/type-aliases/entity/) objects that match the query string.
184
184
185
+
If you want to hint that @-mentions are available, enable the composer `@` button by setting [`entities.showComposerMenu`](https://openai.github.io/chatkit-js/api/openai/chatkit/type-aliases/entitiesoption/#showcomposermenu). When clicked, it inserts `@` into the composer and opens the tag search menu automatically.
186
+
185
187
```ts
186
188
const chatkit =useChatKit({
187
189
// ...
@@ -204,6 +206,8 @@ const chatkit = useChatKit({
204
206
},
205
207
]
206
208
},
209
+
// Optional: show the "@" button in the composer for added discoverability.
Copy file name to clipboardExpand all lines: docs/guides/add-annotations.md
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,53 @@ Provide the model with citable evidence via tools to receive citation annotation
13
13
14
14
No additional server-side wiring is required beyond calling `stream_agent_response`. If the model emits citation annotations from tool usage, ChatKit will forward them automatically as `Annotation` objects on the corresponding content parts.
15
15
16
+
### Customize how citations are converted
17
+
18
+
Sometimes the default rendering for model-emitted citations is not very helpful. For example, file citations may not include enough metadata for ChatKit to show a meaningful default title or description. You can pass a custom [`ResponseStreamConverter`](../../api/chatkit/agents/#chatkit.agents.ResponseStreamConverter) and override:
19
+
20
+
-`file_citation_to_annotation`
21
+
-`container_file_citation_to_annotation`
22
+
-`url_citation_to_annotation`
23
+
24
+
Here is a minimal example that enriches file citations with a more helpful title/description using an internal mapping:
25
+
26
+
```python
27
+
from chatkit.agents import ResponseStreamConverter, stream_agent_response
You can also return an `EntitySource` instead of a `FileSource` to control the inline label, handle clicks, and customize the popover preview. For more on entity annotations (including `interactive` click/preview hooks), see [Annotating with custom entities](#annotating-with-custom-entities) below.
0 commit comments