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 GitHub
parent 8f1ed7783b
commit b63fd9779a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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