LibreChat/api/server/middleware
Danny Avila f427ad792a
🚀 feat: Assistants Streaming (#2159)
* chore: bump openai to 4.29.0 and npm audit fix

* chore: remove unnecessary stream field from ContentData

* feat: new enum and types for AssistantStreamEvent

* refactor(AssistantService): remove stream field and add conversationId to text ContentData
> - return `finalMessage` and `text` on run completion
> - move `processMessages` to services/Threads to avoid circular dependencies with new stream handling
> - refactor(processMessages/retrieveAndProcessFile): add new `client` field to differentiate new RunClient type

* WIP: new assistants stream handling

* chore: stores messages to StreamRunManager

* chore: add additional typedefs

* fix: pass req and openai to StreamRunManager

* fix(AssistantService): pass openai as client to `retrieveAndProcessFile`

* WIP: streaming tool i/o, handle in_progress and completed run steps

* feat(assistants): process required actions with streaming enabled

* chore: condense early return check for useSSE useEffect

* chore: remove unnecessary comments and only handle completed tool calls when not function

* feat: add TTL for assistants run abort cacheKey

* feat: abort stream runs

* fix(assistants): render streaming cursor

* fix(assistants): hide edit icon as functionality is not supported

* fix(textArea): handle pasting edge cases; first, when onChange events wouldn't fire; second, when textarea wouldn't resize

* chore: memoize Conversations

* chore(useTextarea): reverse args order

* fix: load default capabilities when an azure is configured to support assistants, but `assistants` endpoint is not configured

* fix(AssistantSelect): update form assistant model on assistant form select

* fix(actions): handle azure strict validation for function names to fix crud for actions

* chore: remove content data debug log as it fires in rapid succession

* feat: improve UX for assistant errors mid-request

* feat: add tool call localizations and replace any domain separators from azure action names

* refactor(chat): error out tool calls without outputs during handleError

* fix(ToolService): handle domain separators allowing Azure use of actions

* refactor(StreamRunManager): types and throw Error if tool submission fails
2024-03-21 22:42:25 -04:00
..
abortControllers.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
abortMiddleware.js 👥 fix(assistants): Improve Error handling (#2012) 2024-03-07 10:50:01 -05:00
abortRun.js 🚀 feat: Assistants Streaming (#2159) 2024-03-21 22:42:25 -04:00
buildEndpointOption.js 🅰️ feat: Azure OpenAI Assistants API Support (#1992) 2024-03-14 17:21:42 -04:00
checkBan.js fix(config/scripts): Enhance User Creation and Ban Handling, Standardize Imports (#1144) 2023-11-06 09:19:43 -05:00
concurrentLimiter.js feat(api): initial Redis support; fix(SearchBar): proper debounce (#1039) 2023-10-11 17:05:47 -04:00
denyRequest.js feat: Assistants API, General File Support, Side Panel, File Explorer (#1696) 2024-02-13 20:42:27 -05:00
index.js 🛡️ feat: Model Validation Middleware (#1841) 2024-02-19 22:47:39 -05:00
loginLimiter.js feat: Message Rate Limiters, Violation Logging, & Ban System 🔨 (#903) 2023-09-13 10:57:07 -04:00
messageLimiters.js feat: Message Rate Limiters, Violation Logging, & Ban System 🔨 (#903) 2023-09-13 10:57:07 -04:00
moderateText.js 👮feat: moderation text (#1388) 2024-01-01 15:08:02 -05:00
noIndex.js 🚫🔍 feat: disallow search indexing (#1409) 2023-12-29 20:42:04 -05:00
registerLimiter.js feat: Message Rate Limiters, Violation Logging, & Ban System 🔨 (#903) 2023-09-13 10:57:07 -04:00
requireJwtAuth.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
requireLocalAuth.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
setHeaders.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00
uaParser.js feat: Message Rate Limiters, Violation Logging, & Ban System 🔨 (#903) 2023-09-13 10:57:07 -04:00
uploadLimiters.js 🛡️ feat: Model Validation Middleware (#1841) 2024-02-19 22:47:39 -05:00
validateEndpoint.js 💫 feat: Config File & Custom Endpoints (#1474) 2024-01-03 09:22:48 -05:00
validateMessageReq.js feat: Edit AI Messages, Edit Messages in Place (#825) 2023-08-22 18:44:59 -04:00
validateModel.js 🤖 feat(Anthropic): Claude 3 & Vision Support (#1984) 2024-03-06 00:04:52 -05:00
validateRegistration.js feat(GPT/Anthropic): Continue Regenerating & Generation Buttons (#808) 2023-08-17 12:50:05 -04:00