mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-31 19:45:15 +02:00
refactor: remove search_surfsense_docs tool and related references
- Deleted the `search_surfsense_docs` tool and its associated files, streamlining the agent's toolset. - Updated various components and prompts to remove references to the now-removed tool, ensuring consistency across the codebase. - Adjusted documentation to direct users to the SurfSense documentation link for product-related queries instead.
This commit is contained in:
parent
9b9e6828c7
commit
40ca9e6ed2
71 changed files with 232 additions and 1676 deletions
|
|
@ -25,7 +25,6 @@ from __future__ import annotations
|
|||
|
||||
import asyncio
|
||||
import inspect
|
||||
from dataclasses import dataclass
|
||||
from typing import Any
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
|
|
@ -140,45 +139,28 @@ def test_orchestrators_are_async_generator_functions() -> None:
|
|||
# ------------------------------------------------------------ initial thinking
|
||||
|
||||
|
||||
@dataclass
|
||||
class _FakeSurfsenseDoc:
|
||||
"""Stand-in for ``SurfsenseDocsDocument`` with just the field we read."""
|
||||
|
||||
title: str
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"user_query, image_urls, docs, expected_title, expected_action",
|
||||
"user_query, image_urls, expected_title, expected_action",
|
||||
[
|
||||
("hello world", None, [], "Understanding your request", "Processing"),
|
||||
("hello world", None, "Understanding your request", "Processing"),
|
||||
(
|
||||
"",
|
||||
["data:image/png;base64,AAA"],
|
||||
[],
|
||||
"Understanding your request",
|
||||
"Processing",
|
||||
),
|
||||
("", None, [], "Understanding your request", "Processing"),
|
||||
(
|
||||
"doc question",
|
||||
None,
|
||||
[_FakeSurfsenseDoc(title="My Doc")],
|
||||
"Analyzing referenced content",
|
||||
"Analyzing",
|
||||
),
|
||||
("", None, "Understanding your request", "Processing"),
|
||||
],
|
||||
)
|
||||
def test_initial_thinking_step_branches(
|
||||
user_query: str,
|
||||
image_urls: list[str] | None,
|
||||
docs: list[Any],
|
||||
expected_title: str,
|
||||
expected_action: str,
|
||||
) -> None:
|
||||
step = build_initial_thinking_step(
|
||||
user_query=user_query,
|
||||
user_image_data_urls=image_urls,
|
||||
mentioned_surfsense_docs=docs, # type: ignore[arg-type]
|
||||
)
|
||||
assert step.step_id == "thinking-1"
|
||||
assert step.title == expected_title
|
||||
|
|
@ -191,7 +173,6 @@ def test_initial_thinking_step_truncates_long_query() -> None:
|
|||
step = build_initial_thinking_step(
|
||||
user_query=long_query,
|
||||
user_image_data_urls=None,
|
||||
mentioned_surfsense_docs=[],
|
||||
)
|
||||
# 80-char truncation + ellipsis, sandwiched after "Processing: ".
|
||||
assert "..." in step.items[0]
|
||||
|
|
@ -200,16 +181,6 @@ def test_initial_thinking_step_truncates_long_query() -> None:
|
|||
assert payload.startswith("x" * 80) and payload.endswith("...")
|
||||
|
||||
|
||||
def test_initial_thinking_step_collapses_many_doc_names() -> None:
|
||||
docs = [_FakeSurfsenseDoc(title=f"Doc {i}") for i in range(5)]
|
||||
step = build_initial_thinking_step(
|
||||
user_query="q",
|
||||
user_image_data_urls=None,
|
||||
mentioned_surfsense_docs=docs, # type: ignore[arg-type]
|
||||
)
|
||||
assert "[5 docs]" in step.items[0]
|
||||
|
||||
|
||||
# ------------------------------------------------------------ capability gate
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue