[PR #101] [MERGED] feat: render annotation inline #121

Closed
opened 2026-02-16 03:15:16 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/run-llama/chat-ui/pull/101
Author: @thucpn
Created: 5/29/2025
Status: Merged
Merged: 6/3/2025
Merged by: @thucpn

Base: mainHead: tp/annotation-custom-render


📝 Commits (10+)

📊 Changes

25 files changed (+896 additions, -219 deletions)

View changed files

.changeset/grumpy-geckos-drive.md (+5 -0)
📝 apps/web/app/demo/canvas/page.tsx (+28 -26)
📝 docs/chat-ui/artifacts.mdx (+5 -3)
📝 docs/chat-ui/core-components.mdx (+0 -2)
📝 examples/fastapi/frontend/app/page.tsx (+0 -1)
examples/nextjs/app/api/chat/advanced/route.ts (+234 -0)
📝 examples/nextjs/app/api/chat/route.ts (+21 -20)
📝 examples/nextjs/app/page.tsx (+15 -5)
📝 examples/nextjs/components/custom-weather.tsx (+17 -19)
examples/nextjs/components/custom-wiki.tsx (+62 -0)
📝 packages/chat-ui/package.json (+3 -1)
📝 packages/chat-ui/src/chat/annotations/annotations.ts (+16 -25)
packages/chat-ui/src/chat/annotations/data.ts (+0 -9)
📝 packages/chat-ui/src/chat/annotations/index.ts (+2 -1)
packages/chat-ui/src/chat/annotations/inline.ts (+84 -0)
packages/chat-ui/src/chat/annotations/types.ts (+26 -0)
packages/chat-ui/src/chat/annotations/vercel.ts (+11 -0)
📝 packages/chat-ui/src/chat/canvas/artifacts.ts (+5 -3)
📝 packages/chat-ui/src/chat/canvas/context.tsx (+3 -9)
📝 packages/chat-ui/src/chat/canvas/index.tsx (+2 -0)

...and 5 more files

📄 Description

How stream look likes:

0:"User query: \"Hello\".\n"
0:"\nWelcome "
0:"to "
0:"a "
0:"+ "
0:"b\nconsole.log(c)\n```\n\n "
8:[{"type":"sources","data":{"nodes":[{"id":"1","url":"/sample.pdf"},{"id":"2","url":"/sample.pdf"}]}}]
8:[{"type":"weather","data":{"location":"San Francisco, CA","temperature":22,"condition":"sunny","humidity":65,"windSpeed":12}}]
0:"\n ### Demo inline annotations \n"
0:"To set up the project, follow these steps: \n"
0:"1. Create a package.json file"
0:"\n```annotation\n{\"type\":\"artifact\",\"data\":{\"type\":\"code\",\"data\":{\"file_name\":\"package.json\",\"language\":\"json\",\"code\":\"{\\n  \\\"name\\\": \\\"my-project\\\",\\n  \\\"version\\\": \\\"1.0.0\\\",\\n  \\\"description\\\": \\\"My project\\\",\\n  \\\"main\\\": \\\"index.js\\\"\\n}\"}}}\n```\n"
0:"2. Create a sample.js file"
0:"\n```annotation\n{\"type\":\"artifact\",\"data\":{\"type\":\"code\",\"data\":{\"file_name\":\"sample.js\",\"language\":\"javascript\",\"code\":\"console.log(\\\"Hello, world!\\\");\"}}}\n```\n"

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/run-llama/chat-ui/pull/101 **Author:** [@thucpn](https://github.com/thucpn) **Created:** 5/29/2025 **Status:** ✅ Merged **Merged:** 6/3/2025 **Merged by:** [@thucpn](https://github.com/thucpn) **Base:** `main` ← **Head:** `tp/annotation-custom-render` --- ### 📝 Commits (10+) - [`64f7642`](https://github.com/run-llama/chat-ui/commit/64f7642ad71abe86f8aa8b95db174ae77d1a8357) feat: render annotation inline - [`8b34147`](https://github.com/run-llama/chat-ui/commit/8b341470b3b324cb4627bfbeb6298d900d211a3e) clean up - [`a3b545a`](https://github.com/run-llama/chat-ui/commit/a3b545a0e013a3a6b3cc7f4a7f5a83634a793942) demo inline - [`b9b598d`](https://github.com/run-llama/chat-ui/commit/b9b598d3468756c0661880095f029067e97d3afd) update comment - [`62f8a68`](https://github.com/run-llama/chat-ui/commit/62f8a68a498467750246b5eb95ce538df2941141) wait longer for annotaton - [`218d4eb`](https://github.com/run-llama/chat-ui/commit/218d4eb7da23b8b5ac5914c0194ed2b8220edb2d) add doc - [`f4dedf2`](https://github.com/run-llama/chat-ui/commit/f4dedf259fd5de5db09fcfeb8d591deecaf44605) refactor: add annotationsRenderer - [`cb42cb6`](https://github.com/run-llama/chat-ui/commit/cb42cb69a8a3ce2cad76db9badd70646e6711c61) fix: format - [`8c060fa`](https://github.com/run-llama/chat-ui/commit/8c060fa3dfbf08cb53ba37fe453e1c4372e0dbaf) Merge branch 'main' into tp/annotation-custom-render - [`4408630`](https://github.com/run-llama/chat-ui/commit/440863023d27912e653079709def09e01e8ad0d1) change contract ### 📊 Changes **25 files changed** (+896 additions, -219 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/grumpy-geckos-drive.md` (+5 -0) 📝 `apps/web/app/demo/canvas/page.tsx` (+28 -26) 📝 `docs/chat-ui/artifacts.mdx` (+5 -3) 📝 `docs/chat-ui/core-components.mdx` (+0 -2) 📝 `examples/fastapi/frontend/app/page.tsx` (+0 -1) ➕ `examples/nextjs/app/api/chat/advanced/route.ts` (+234 -0) 📝 `examples/nextjs/app/api/chat/route.ts` (+21 -20) 📝 `examples/nextjs/app/page.tsx` (+15 -5) 📝 `examples/nextjs/components/custom-weather.tsx` (+17 -19) ➕ `examples/nextjs/components/custom-wiki.tsx` (+62 -0) 📝 `packages/chat-ui/package.json` (+3 -1) 📝 `packages/chat-ui/src/chat/annotations/annotations.ts` (+16 -25) ➖ `packages/chat-ui/src/chat/annotations/data.ts` (+0 -9) 📝 `packages/chat-ui/src/chat/annotations/index.ts` (+2 -1) ➕ `packages/chat-ui/src/chat/annotations/inline.ts` (+84 -0) ➕ `packages/chat-ui/src/chat/annotations/types.ts` (+26 -0) ➕ `packages/chat-ui/src/chat/annotations/vercel.ts` (+11 -0) 📝 `packages/chat-ui/src/chat/canvas/artifacts.ts` (+5 -3) 📝 `packages/chat-ui/src/chat/canvas/context.tsx` (+3 -9) 📝 `packages/chat-ui/src/chat/canvas/index.tsx` (+2 -0) _...and 5 more files_ </details> ### 📄 Description How stream look likes: ``` 0:"User query: \"Hello\".\n" 0:"\nWelcome " 0:"to " 0:"a " 0:"+ " 0:"b\nconsole.log(c)\n```\n\n " 8:[{"type":"sources","data":{"nodes":[{"id":"1","url":"/sample.pdf"},{"id":"2","url":"/sample.pdf"}]}}] 8:[{"type":"weather","data":{"location":"San Francisco, CA","temperature":22,"condition":"sunny","humidity":65,"windSpeed":12}}] 0:"\n ### Demo inline annotations \n" 0:"To set up the project, follow these steps: \n" 0:"1. Create a package.json file" 0:"\n```annotation\n{\"type\":\"artifact\",\"data\":{\"type\":\"code\",\"data\":{\"file_name\":\"package.json\",\"language\":\"json\",\"code\":\"{\\n \\\"name\\\": \\\"my-project\\\",\\n \\\"version\\\": \\\"1.0.0\\\",\\n \\\"description\\\": \\\"My project\\\",\\n \\\"main\\\": \\\"index.js\\\"\\n}\"}}}\n```\n" 0:"2. Create a sample.js file" 0:"\n```annotation\n{\"type\":\"artifact\",\"data\":{\"type\":\"code\",\"data\":{\"file_name\":\"sample.js\",\"language\":\"javascript\",\"code\":\"console.log(\\\"Hello, world!\\\");\"}}}\n```\n" ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 03:15:16 -05:00
yindo closed this issue 2026-02-16 03:15:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/chat-ui#121