[PR #2158] [MERGED] Api session id support #3907

Closed
opened 2026-02-22 18:34:44 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/2158
Author: @timothycarambat
Created: 8/21/2024
Status: Merged
Merged: 8/21/2024
Merged by: @timothycarambat

Base: masterHead: api-session-id


📝 Commits (3)

  • 0c08900 Refactor api endpoint chat handler to its own function
  • 3909e9d Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into api-session-id
  • e7b1084 Add sessionId in dev API to partition chats logically statelessly

📊 Changes

12 files changed (+54 additions, -20 deletions)

View changed files

📝 server/endpoints/api/workspace/index.js (+8 -4)
📝 server/endpoints/api/workspaceThread/index.js (+1 -0)
📝 server/endpoints/workspaceThreads.js (+1 -0)
📝 server/endpoints/workspaces.js (+1 -0)
📝 server/models/workspaceChats.js (+5 -1)
server/prisma/migrations/20240821215625_init/migration.sql (+2 -0)
📝 server/prisma/schema.prisma (+12 -11)
📝 server/swagger/openapi.json (+4 -2)
📝 server/utils/agents/index.js (+1 -0)
📝 server/utils/chats/apiChatHandler.js (+12 -1)
📝 server/utils/chats/index.js (+2 -0)
📝 server/utils/helpers/chat/convertTo.js (+5 -1)

📄 Description

Enable the developer API to use sessionId in the body to logically partition chats without needing to create a user or pass in the entire chat history like you would for the OpenAi compatible API endpoints.

If not provided, the API chats can appear in the window in single-user mode. In multi-user mode these chats will not appear in the UI. When a sessionId is provided it is basically a pseudo-user ID we can limit search history by when doing API calls.


🔄 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/Mintplex-Labs/anything-llm/pull/2158 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 8/21/2024 **Status:** ✅ Merged **Merged:** 8/21/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `api-session-id` --- ### 📝 Commits (3) - [`0c08900`](https://github.com/Mintplex-Labs/anything-llm/commit/0c08900f74a5bd1924ee24276ae8bbba728ab0f1) Refactor api endpoint chat handler to its own function - [`3909e9d`](https://github.com/Mintplex-Labs/anything-llm/commit/3909e9d020152974a616cbc29355bc7ed7475e87) Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into api-session-id - [`e7b1084`](https://github.com/Mintplex-Labs/anything-llm/commit/e7b108409d5cf6e4e55d73147c992cd61e21e34b) Add `sessionId` in dev API to partition chats logically statelessly ### 📊 Changes **12 files changed** (+54 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `server/endpoints/api/workspace/index.js` (+8 -4) 📝 `server/endpoints/api/workspaceThread/index.js` (+1 -0) 📝 `server/endpoints/workspaceThreads.js` (+1 -0) 📝 `server/endpoints/workspaces.js` (+1 -0) 📝 `server/models/workspaceChats.js` (+5 -1) ➕ `server/prisma/migrations/20240821215625_init/migration.sql` (+2 -0) 📝 `server/prisma/schema.prisma` (+12 -11) 📝 `server/swagger/openapi.json` (+4 -2) 📝 `server/utils/agents/index.js` (+1 -0) 📝 `server/utils/chats/apiChatHandler.js` (+12 -1) 📝 `server/utils/chats/index.js` (+2 -0) 📝 `server/utils/helpers/chat/convertTo.js` (+5 -1) </details> ### 📄 Description Enable the developer API to use `sessionId` in the body to logically partition chats without needing to create a user or pass in the entire chat history like you would for the OpenAi compatible API endpoints. If not provided, the API chats can appear in the window in single-user mode. In multi-user mode these chats will not appear in the UI. When a sessionId is provided it is basically a pseudo-user ID we can limit search history by when doing API calls. --- <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-22 18:34:44 -05:00
yindo closed this issue 2026-02-22 18:34:44 -05:00
yindo changed title from [PR #2158] Api session id support to [PR #2158] [MERGED] Api session id support 2026-06-05 15:15:50 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#3907