ai-agent-book 精选快照(<2MB 代码与文档,来自 github.com/bojieli/ai-agent-book)
Build latest book artifacts / build (push) Canceled after 0s
dependency resolution / resolve (3.11) (push) Canceled after 0s
dependency resolution / resolve (3.13) (push) Canceled after 0s
deploy-pages / build (push) Canceled after 0s
deploy-pages / deploy (push) Canceled after 0s
i18n consistency check / check (push) Canceled after 0s
provider adoption tests / test (chapter2/context-compression) (push) Canceled after 0s
provider adoption tests / test (chapter2/prompt-injection) (push) Canceled after 0s
provider adoption tests / test (chapter2/system-hint) (push) Canceled after 0s
provider adoption tests / test (chapter3/log-sanitization) (push) Canceled after 0s
web-search-agent tests / test (push) Canceled after 0s
web-search-agent tests / agentbook (push) Canceled after 0s

This commit is contained in:
2026-08-20 13:12:50 +00:00
commit b119135836
10275 changed files with 3284984 additions and 0 deletions
+75
View File
@@ -0,0 +1,75 @@
"""
Test script to verify all imports and basic module loading.
"""
import sys
from pathlib import Path
# Add src to path
sys.path.insert(0, str(Path(__file__).parent / "src"))
print("Testing imports...")
try:
print("\n✓ Importing base module...")
from base import ActionResponse, DocumentMetadata, is_url, validate_file_path
print("✓ Importing search_tools module...")
from search_tools import search_web, download_file, search_knowledge_base
print("✓ Importing multimodal_tools module...")
from multimodal_tools import read_webpage, read_document, parse_image, parse_video
print("✓ Importing filesystem_tools module...")
from filesystem_tools import read_file, grep_search, summarize_text
print("✓ Importing public_data_tools module...")
from public_data_tools import (
get_weather, get_stock_price, convert_currency,
search_wikipedia, search_arxiv, search_wayback
)
print("✓ Importing private_data_tools module...")
from private_data_tools import get_calendar_events, search_notion
print("✓ Importing main module...")
from main import mcp
print("\n" + "="*80)
print("✅ All imports successful!")
print("="*80)
# Test basic functionality
print("\nTesting basic functionality...")
# Test ActionResponse
response = ActionResponse(
success=True,
message="Test message",
metadata={"test": "value"}
)
assert response.success == True
print("✓ ActionResponse working")
# Test is_url
assert is_url("https://example.com") == True
assert is_url("/path/to/file") == False
print("✓ is_url working")
print("\n" + "="*80)
print("✅ All tests passed!")
print("="*80)
print("\n️ The MCP server is ready to use.")
print(" Run 'python src/main.py' to start the server.")
print(" Run 'python quickstart.py' to test various tools.")
except ImportError as e:
print(f"\n❌ Import error: {e}")
print("\n️ You may need to install dependencies:")
print(" pip install -r requirements.txt")
sys.exit(1)
except Exception as e:
print(f"\n❌ Error: {e}")
import traceback
traceback.print_exc()
sys.exit(1)