mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-06 20:15:17 +02:00
refactor(agents): promote anonymous_agent to its own anonymous_chat/ package (slice 8)
The anonymous / free-chat agent is a distinct live agent (not part of the single-agent stack and not shared infrastructure), so it gets its own top-level package app/agents/anonymous_chat/ (sibling to multi_agent_chat). Moved new_chat/anonymous_agent.py -> anonymous_chat/agent.py with a package __init__ re-exporting create_anonymous_chat_agent + build_anonymous_system_prompt. Repointed its only new_chat import (the context shim) to app.agents.shared.context and updated the single importer (anonymous_chat_routes). The test_import_all guard auto-discovers the new package via pkgutil.walk_packages, so it is covered.
This commit is contained in:
parent
a019f18d1c
commit
64d2ad6451
3 changed files with 16 additions and 2 deletions
14
surfsense_backend/app/agents/anonymous_chat/__init__.py
Normal file
14
surfsense_backend/app/agents/anonymous_chat/__init__.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
"""Anonymous / free-chat agent.
|
||||
|
||||
The no-login chat experience: a deliberately minimal agent that bypasses the
|
||||
full SurfSense deep-agent stack (filesystem, knowledge-base persistence,
|
||||
subagents, skills, memory) and answers with an optional ``web_search`` tool and
|
||||
an optional read-only uploaded document. See :mod:`.agent` for details.
|
||||
"""
|
||||
|
||||
from app.agents.anonymous_chat.agent import (
|
||||
build_anonymous_system_prompt,
|
||||
create_anonymous_chat_agent,
|
||||
)
|
||||
|
||||
__all__ = ["build_anonymous_system_prompt", "create_anonymous_chat_agent"]
|
||||
|
|
@ -27,7 +27,7 @@ from langchain.agents.middleware import (
|
|||
from langchain_core.language_models import BaseChatModel
|
||||
from langgraph.types import Checkpointer
|
||||
|
||||
from app.agents.new_chat.context import SurfSenseContextSchema
|
||||
from app.agents.shared.context import SurfSenseContextSchema
|
||||
from app.agents.shared.middleware import (
|
||||
RetryAfterMiddleware,
|
||||
create_surfsense_compaction_middleware,
|
||||
|
|
@ -351,7 +351,7 @@ async def stream_anonymous_chat(
|
|||
async def _generate():
|
||||
from langchain_core.messages import AIMessage, HumanMessage
|
||||
|
||||
from app.agents.new_chat.anonymous_agent import create_anonymous_chat_agent
|
||||
from app.agents.anonymous_chat import create_anonymous_chat_agent
|
||||
from app.agents.shared.checkpointer import get_checkpointer
|
||||
from app.db import shielded_async_session
|
||||
from app.services.new_streaming_service import VercelStreamingService
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue