[PR #116] [MERGED] refactor: use annotations instead of data #265

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

📋 Pull Request Information

Original PR: https://github.com/run-llama/create-llama/pull/116
Author: @marcusschiesser
Created: 6/6/2024
Status: Merged
Merged: 6/7/2024
Merged by: @marcusschiesser

Base: mainHead: ms/use-annotations-as-state


📝 Commits (10+)

  • d1d870d refactor: use annotations instead of data
  • 8477260 clean up frontend - do not show available csv files anymore
  • 7e77ae0 use annotations for express
  • 941664d add message annotation for fastapi
  • be8803f refactor: change export of use csv
  • 641db3e Merge branch 'ms/use-annotations-as-state' of github.com:run-llama/create-llama into ms/use-annotations-as-state
  • 8892750 move reset to outside custom submit function
  • 62d192c rename attachments to annotations
  • 160ed04 Update templates/types/streaming/fastapi/app/api/routers/models.py
  • 7aa2f0d Update templates/types/streaming/fastapi/app/api/routers/models.py

📊 Changes

8 files changed (+222 additions, -229 deletions)

View changed files

📝 templates/types/streaming/express/src/controllers/chat.controller.ts (+20 -16)
📝 templates/types/streaming/express/src/controllers/llamaindex-stream.ts (+56 -32)
📝 templates/types/streaming/fastapi/app/api/routers/models.py (+28 -14)
📝 templates/types/streaming/nextjs/app/api/chat/llamaindex-stream.ts (+56 -32)
📝 templates/types/streaming/nextjs/app/api/chat/route.ts (+20 -16)
📝 templates/types/streaming/nextjs/app/components/ui/chat/chat-input.tsx (+30 -49)
📝 templates/types/streaming/nextjs/app/components/ui/chat/use-csv.ts (+11 -63)
📝 templates/types/streaming/nextjs/app/components/ui/upload-csv-preview.tsx (+1 -7)

📄 Description

  • remove sending images and CSVs as data (avoids sending content twice)
  • use annotations to generate MessageContentDetail[]
  • as GPT4 ignores MessageContentDetail from previous messages (only pure string messages seem to be used), fallback to use annotation from last user message

Summary by CodeRabbit

  • Refactor

    • Simplified the ChatInput component by grouping related properties into a single object.
    • Updated the useCsv hook to streamline state management and file handling.
  • New Features

    • Improved file upload functionality in the chat input, making it more intuitive and efficient.

🔄 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/create-llama/pull/116 **Author:** [@marcusschiesser](https://github.com/marcusschiesser) **Created:** 6/6/2024 **Status:** ✅ Merged **Merged:** 6/7/2024 **Merged by:** [@marcusschiesser](https://github.com/marcusschiesser) **Base:** `main` ← **Head:** `ms/use-annotations-as-state` --- ### 📝 Commits (10+) - [`d1d870d`](https://github.com/run-llama/create-llama/commit/d1d870d6e393be17c5b89f53f2b19b7f79f93326) refactor: use annotations instead of data - [`8477260`](https://github.com/run-llama/create-llama/commit/8477260f84df4e3559542f7a3343eef243c468a1) clean up frontend - do not show available csv files anymore - [`7e77ae0`](https://github.com/run-llama/create-llama/commit/7e77ae092be3e04f76da05147bdcbffc02bd4156) use annotations for express - [`941664d`](https://github.com/run-llama/create-llama/commit/941664db3aacc8ba14a31538bf59dfb8ce4c4fe6) add message annotation for fastapi - [`be8803f`](https://github.com/run-llama/create-llama/commit/be8803f1d275ca459b3d8cee1faa092c9af462ba) refactor: change export of use csv - [`641db3e`](https://github.com/run-llama/create-llama/commit/641db3e050e8c674dd70fea885e76b6d47f1b982) Merge branch 'ms/use-annotations-as-state' of github.com:run-llama/create-llama into ms/use-annotations-as-state - [`8892750`](https://github.com/run-llama/create-llama/commit/8892750853fb0ea1e96dbcdfa75db9dda65e8427) move reset to outside custom submit function - [`62d192c`](https://github.com/run-llama/create-llama/commit/62d192c414f06a64c1e862f0d4ac3e1c2203c4a3) rename attachments to annotations - [`160ed04`](https://github.com/run-llama/create-llama/commit/160ed046ba8f0f85a90caf61d0229ec8010eca88) Update templates/types/streaming/fastapi/app/api/routers/models.py - [`7aa2f0d`](https://github.com/run-llama/create-llama/commit/7aa2f0dfff35144abb1ff8081242409cb58c475a) Update templates/types/streaming/fastapi/app/api/routers/models.py ### 📊 Changes **8 files changed** (+222 additions, -229 deletions) <details> <summary>View changed files</summary> 📝 `templates/types/streaming/express/src/controllers/chat.controller.ts` (+20 -16) 📝 `templates/types/streaming/express/src/controllers/llamaindex-stream.ts` (+56 -32) 📝 `templates/types/streaming/fastapi/app/api/routers/models.py` (+28 -14) 📝 `templates/types/streaming/nextjs/app/api/chat/llamaindex-stream.ts` (+56 -32) 📝 `templates/types/streaming/nextjs/app/api/chat/route.ts` (+20 -16) 📝 `templates/types/streaming/nextjs/app/components/ui/chat/chat-input.tsx` (+30 -49) 📝 `templates/types/streaming/nextjs/app/components/ui/chat/use-csv.ts` (+11 -63) 📝 `templates/types/streaming/nextjs/app/components/ui/upload-csv-preview.tsx` (+1 -7) </details> ### 📄 Description - remove sending images and CSVs as `data` (avoids sending content twice) - use annotations to generate `MessageContentDetail[]` - as GPT4 ignores `MessageContentDetail` from previous messages (only pure string messages seem to be used), fallback to use annotation from last user message <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Simplified the `ChatInput` component by grouping related properties into a single object. - Updated the `useCsv` hook to streamline state management and file handling. - **New Features** - Improved file upload functionality in the chat input, making it more intuitive and efficient. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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-15 19:16:58 -05:00
yindo closed this issue 2026-02-15 19:16:58 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/create-llama#265