mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 06:17:23 +00:00
feat(agents): make sources optional and drop the synthetic "Default" source
The sources list used to start with a fake "Default" entry that had no id and, at run time, meant "no source, skip retrieval". The agent form pre-selected it, snapped back to it when the last source was deselected, and refused to publish without it, so a new agent always looked like it had a knowledge base when it had none. Backend - /api/sources returns only ingested sources; no placeholder row. - Publishing an agent no longer requires a source on create or update. The legacy "default" value is still accepted and maps to NULL. Frontend - The agent source picker starts empty, can be cleared, and shows a hint that a source-less agent answers from the model and its tools only. - The picker groups sources into "Your sources" and "Shared with team" when any team-shared source exists, shows "N sources selected" for a multi-selection, and gets the same "Go to Sources" / "Upload new" footer as the chat picker. A source uploaded from the form is selected when it lands. - Source selection serialisation and the picker id live in one helper shared with the chat picker; the four copies in the form are gone. - The client no longer seeds a placeholder source in the store, and the dead auto-select of a "default" document is removed.
This commit is contained in:
1 parent
fb15649a3f
commit
79d418f32a
23 files changed
+532
-365
No files matched your search
@@ -647,9 +647,9 @@ class StreamProcessor:
|
||||
def _configure_source(self):
|
||||
"""Configure the source based on agent data.
|
||||
|
||||
The literal string ``"default"`` is a placeholder meaning "no
|
||||
ingested source" and is normalized to an empty source so that no
|
||||
retrieval is attempted.
|
||||
The literal string ``"default"`` is a legacy placeholder (older
|
||||
clients sent it for "no ingested source") and is normalized to an
|
||||
empty source so that no retrieval is attempted.
|
||||
"""
|
||||
if self._agent_data:
|
||||
agent_data = self._agent_data
|
||||
|
||||
Reference in new issue
Block a user