mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-04-27 09:06:21 +02:00
feat: add PageIndex SDK with local/cloud dual-mode support (#207)
This commit is contained in:
parent
f2dcffc0b7
commit
c7fe93bb56
45 changed files with 4225 additions and 274 deletions
26
tests/test_events.py
Normal file
26
tests/test_events.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
from pageindex.events import QueryEvent
|
||||
from pageindex.backend.protocol import AgentTools
|
||||
|
||||
|
||||
def test_query_event():
|
||||
event = QueryEvent(type="answer_delta", data="hello")
|
||||
assert event.type == "answer_delta"
|
||||
assert event.data == "hello"
|
||||
|
||||
|
||||
def test_query_event_types():
|
||||
for t in ["reasoning", "tool_call", "tool_result", "answer_delta", "answer_done"]:
|
||||
event = QueryEvent(type=t, data="test")
|
||||
assert event.type == t
|
||||
|
||||
|
||||
def test_agent_tools_default_empty():
|
||||
tools = AgentTools()
|
||||
assert tools.function_tools == []
|
||||
assert tools.mcp_servers == []
|
||||
|
||||
|
||||
def test_agent_tools_with_values():
|
||||
tools = AgentTools(function_tools=["tool1"], mcp_servers=["server1"])
|
||||
assert len(tools.function_tools) == 1
|
||||
assert len(tools.mcp_servers) == 1
|
||||
Loading…
Add table
Add a link
Reference in a new issue