Mintplex-Labs / anything-llm

The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, and more.
https://anythingllm.com
MIT License
27.62k stars 2.79k forks source link

[FEATURE]: Workspace chat history Dev API improvements #2556

Closed kabaluyot closed 3 weeks ago

kabaluyot commented 3 weeks ago

How are you running AnythingLLM?

Docker (local)

What happened?

Even if chat history limit is set to 20, the workspace chat history endpoint still returns all data making the API call longer when having lots of chat history.

Screen Shot 2024-10-30 at 9 13 05 AM

image

Are there known steps to reproduce?

No response

timothycarambat commented 3 weeks ago

That property is under Chat settings, so it only applies during chats (via UI or API).

The workspace/chats endpoint is exactly for retrieving all chats within the system. What should be done is we should add an optional limit and orderBy to this endpoint so it works like a RESTful endpoint