mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-26 21:39:43 +02:00
feat: antropic model added fix & kb tooling fixes
- Updated main-agent middleware to clarify that both filesystem reads/writes and knowledge-base retrieval are handled by the `knowledge_base` subagent. - Introduced `_forward_mention_pins` function to carry `@`-mention pins into subagent state. - Revised system prompts to reflect the new retrieval method and ensure proper citation handling. - Removed the `search_knowledge_base` tool and its related tests, consolidating functionality under the `task` tool. - Enhanced documentation to guide usage of the new retrieval approach and citation practices.
This commit is contained in:
parent
b4af67f77d
commit
9642d7ced0
36 changed files with 581 additions and 168 deletions
|
|
@ -1,5 +1,49 @@
|
|||
from app.services.global_model_catalog import materialize_global_model_catalog
|
||||
from app.services.model_resolver import ensure_v1, to_litellm
|
||||
from app.services.model_resolver import ensure_v1, strip_version_suffix, to_litellm
|
||||
|
||||
|
||||
def test_anthropic_resolver_strips_trailing_v1_from_api_base() -> None:
|
||||
# LiteLLM's Anthropic handler appends ``/v1/messages``; a base URL ending in
|
||||
# ``/v1`` (the frontend default) would otherwise yield ``/v1/v1/messages``.
|
||||
model, kwargs = to_litellm(
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"base_url": "https://api.anthropic.com/v1",
|
||||
"api_key": "sk-ant-test",
|
||||
"extra": {},
|
||||
},
|
||||
"claude-opus-4-8",
|
||||
)
|
||||
|
||||
assert model == "anthropic/claude-opus-4-8"
|
||||
assert kwargs["api_base"] == "https://api.anthropic.com"
|
||||
|
||||
|
||||
def test_anthropic_resolver_keeps_root_api_base() -> None:
|
||||
_model, kwargs = to_litellm(
|
||||
{
|
||||
"provider": "anthropic",
|
||||
"base_url": "https://api.anthropic.com",
|
||||
"api_key": "sk-ant-test",
|
||||
"extra": {},
|
||||
},
|
||||
"claude-opus-4-8",
|
||||
)
|
||||
|
||||
assert kwargs["api_base"] == "https://api.anthropic.com"
|
||||
|
||||
|
||||
def test_strip_version_suffix() -> None:
|
||||
assert strip_version_suffix("https://api.anthropic.com/v1") == (
|
||||
"https://api.anthropic.com"
|
||||
)
|
||||
assert strip_version_suffix("https://api.anthropic.com/v1/") == (
|
||||
"https://api.anthropic.com"
|
||||
)
|
||||
assert strip_version_suffix("https://api.anthropic.com") == (
|
||||
"https://api.anthropic.com"
|
||||
)
|
||||
assert strip_version_suffix(None) is None
|
||||
|
||||
|
||||
def test_openai_compatible_resolver_uses_explicit_api_base() -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue