feat: add PageIndex SDK with local/cloud dual-mode support (#207)

This commit is contained in:
Kylin 2026-04-06 22:51:04 +08:00 committed by Ray
parent f2dcffc0b7
commit c7fe93bb56
45 changed files with 4225 additions and 274 deletions

14
tests/test_agent.py Normal file
View file

@ -0,0 +1,14 @@
from pageindex.agent import AgentRunner, SYSTEM_PROMPT
from pageindex.backend.protocol import AgentTools
def test_agent_runner_init():
tools = AgentTools(function_tools=["mock_tool"])
runner = AgentRunner(tools=tools, model="gpt-4o")
assert runner._model == "gpt-4o"
def test_system_prompt_has_tool_instructions():
assert "list_documents" in SYSTEM_PROMPT
assert "get_document_structure" in SYSTEM_PROMPT
assert "get_page_content" in SYSTEM_PROMPT