selectools 0.23.0__tar.gz → 0.25.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {selectools-0.23.0/src/selectools.egg-info → selectools-0.25.0}/PKG-INFO +82 -13
- {selectools-0.23.0 → selectools-0.25.0}/README.md +74 -12
- {selectools-0.23.0 → selectools-0.25.0}/pyproject.toml +10 -1
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/__init__.py +95 -3
- selectools-0.25.0/src/selectools/_json_utils.py +37 -0
- selectools-0.25.0/src/selectools/a2a/__init__.py +56 -0
- selectools-0.25.0/src/selectools/a2a/client.py +176 -0
- selectools-0.25.0/src/selectools/a2a/server.py +407 -0
- selectools-0.25.0/src/selectools/a2a/types.py +171 -0
- selectools-0.25.0/src/selectools/agent/__init__.py +10 -0
- selectools-0.25.0/src/selectools/agent/_planning.py +405 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/agent/_tool_executor.py +689 -102
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/agent/config.py +117 -33
- selectools-0.25.0/src/selectools/agent/config_groups.py +253 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/agent/core.py +114 -32
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/analytics.py +3 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/audit.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/cache.py +8 -2
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/cache_redis.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/cache_semantic.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/cancellation.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/checkpoint_postgres.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/coherence.py +6 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/compose.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/embeddings/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/embeddings/anthropic.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/embeddings/cohere.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/embeddings/gemini.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/embeddings/openai.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/embeddings/provider.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/entity_memory.py +6 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/env.py +6 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/badge.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/dataset.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/evaluators.py +36 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/generator.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/history.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/llm_evaluators.py +22 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/pairwise.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/regression.py +3 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/serve.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/snapshot.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/suite.py +2 -2
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/templates.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/types.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/exceptions.py +15 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/base.py +3 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/format.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/length.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/pii.py +3 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/pipeline.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/topic.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/guardrails/toxicity.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/knowledge.py +267 -6
- selectools-0.25.0/src/selectools/knowledge_backends.py +222 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/knowledge_graph.py +11 -1
- selectools-0.25.0/src/selectools/knowledge_sanitizers.py +215 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/knowledge_store_redis.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/knowledge_store_supabase.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/loop_detection.py +1 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/mcp/__init__.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/mcp/client.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/mcp/config.py +3 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/mcp/multi.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/mcp/server.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/memory.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/models.py +14 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/observe/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/observe/langfuse.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/observe/otel.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/observe/trace_store.py +13 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/observer.py +4 -91
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/orchestration/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/orchestration/checkpoint.py +12 -5
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/orchestration/graph.py +6 -2
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/orchestration/node.py +9 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/orchestration/state.py +14 -6
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/orchestration/supervisor.py +12 -25
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/parser.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/patterns/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/patterns/debate.py +6 -2
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/patterns/plan_and_execute.py +6 -3
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/patterns/reflective.py +6 -2
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/patterns/team_lead.py +7 -3
- selectools-0.25.0/src/selectools/pending.py +1501 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/pipeline.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/policy.py +23 -2
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/pricing.py +7 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/prompt.py +7 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/__init__.py +7 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/anthropic_provider.py +72 -8
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/azure_openai_provider.py +4 -2
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/base.py +9 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/fallback.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/gemini_provider.py +107 -14
- selectools-0.25.0/src/selectools/providers/litellm_provider.py +194 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/ollama_provider.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/openai_provider.py +2 -0
- selectools-0.25.0/src/selectools/providers/router.py +618 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/stubs.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/__init__.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/bm25.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/chunking.py +7 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/hybrid.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/loaders.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/reranker.py +6 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/chroma.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/faiss.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/memory.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/pgvector.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/pinecone.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/qdrant.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/stores/sqlite.py +5 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/tools.py +6 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/rag/vector_store.py +7 -0
- selectools-0.25.0/src/selectools/results.py +226 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/security.py +6 -0
- selectools-0.25.0/src/selectools/serve/__init__.py +56 -0
- selectools-0.25.0/src/selectools/serve/api.py +553 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/app.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/cli.py +34 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/sessions.py +516 -4
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/stability.py +88 -10
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/structured.py +10 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/templates/__init__.py +8 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/token_estimation.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/__init__.py +80 -1
- selectools-0.25.0/src/selectools/toolbox/calculator_tools.py +340 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/code_tools.py +8 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/data_tools.py +12 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/datetime_tools.py +10 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/db_tools.py +8 -0
- selectools-0.25.0/src/selectools/toolbox/email_tools.py +253 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/file_tools.py +11 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/github_tools.py +9 -0
- selectools-0.25.0/src/selectools/toolbox/linear_tools.py +295 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/memory_tools.py +4 -0
- selectools-0.25.0/src/selectools/toolbox/notion_tools.py +268 -0
- selectools-0.25.0/src/selectools/toolbox/pdf_tools.py +163 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/search_tools.py +8 -0
- selectools-0.25.0/src/selectools/toolbox/slack_tools.py +210 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/text_tools.py +13 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/toolbox/web_tools.py +8 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/tools/__init__.py +2 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/tools/base.py +10 -1
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/tools/loader.py +4 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/trace.py +4 -1
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/types.py +11 -0
- selectools-0.25.0/src/selectools/unified_memory.py +931 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/usage.py +10 -0
- {selectools-0.23.0 → selectools-0.25.0/src/selectools.egg-info}/PKG-INFO +82 -13
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools.egg-info/SOURCES.txt +32 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools.egg-info/requires.txt +9 -0
- selectools-0.25.0/tests/test_a2a.py +455 -0
- selectools-0.25.0/tests/test_agent_api.py +430 -0
- selectools-0.25.0/tests/test_agent_hitl.py +688 -0
- selectools-0.25.0/tests/test_architecture.py +742 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_entity_memory.py +9 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals.py +2 -2
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_advanced.py +1 -1
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_v017_features.py +2 -2
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_final_coverage_b.py +1 -1
- selectools-0.25.0/tests/test_knowledge_backend.py +255 -0
- selectools-0.25.0/tests/test_knowledge_backend_redis.py +171 -0
- selectools-0.25.0/tests/test_knowledge_backend_supabase.py +231 -0
- selectools-0.25.0/tests/test_knowledge_sanitizers.py +425 -0
- selectools-0.25.0/tests/test_pending.py +1570 -0
- selectools-0.25.0/tests/test_pending_redis_smoke.py +296 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_remaining_coverage.py +0 -67
- selectools-0.25.0/tests/test_results.py +366 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_serve_cli.py +39 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_sessions.py +334 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_sessions_redis.py +68 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_sessions_supabase.py +114 -4
- selectools-0.25.0/tests/test_tool_result_compression.py +757 -0
- selectools-0.25.0/tests/test_unified_memory.py +427 -0
- selectools-0.23.0/src/selectools/agent/__init__.py +0 -8
- selectools-0.23.0/src/selectools/agent/config_groups.py +0 -149
- selectools-0.23.0/src/selectools/serve/__init__.py +0 -24
- selectools-0.23.0/tests/test_architecture.py +0 -242
- {selectools-0.23.0 → selectools-0.25.0}/LICENSE +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/setup.cfg +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/_async_utils.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/agent/_lifecycle.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/agent/_memory_manager.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/agent/_provider_caller.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/__main__.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/html.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/junit.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/evals/report.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/mcp/_loop.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/mcp/bridge.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/providers/_openai_compat.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/_starlette_app.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/_static/builder.css +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/_static/builder.html +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/_static/builder.js +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/builder.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/models.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/serve/playground.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/templates/code_reviewer.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/templates/customer_support.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/templates/data_analyst.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/templates/rag_chatbot.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/templates/research_assistant.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/tools/decorators.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools/tools/registry.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools.egg-info/dependency_links.txt +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools.egg-info/entry_points.txt +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/src/selectools.egg-info/top_level.txt +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_approval_gate.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_async_observers.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_audit.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_budget.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_bug_hunt_batch1_core.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_bug_hunt_batch1_security.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_bug_hunt_batch1_tools.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_bug_hunt_regression.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_cache.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_cache_redis.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_cancellation.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_checkpoint_postgres.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_coherence.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_concurrency_smoke.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_consolidation_regression.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_conversation_branching.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_coverage_orchestration.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_document_loaders_extended.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_e2e_langfuse_observer.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_e2e_multimodal.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_e2e_otel_observer.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_e2e_v0_21_0_apps.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_e2e_v0_21_0_simulations.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_env.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_cli.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_e2e.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_final.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_hardening.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_html_report.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_new_evaluators.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_ralph_bugs.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_release.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_serve.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_evals_v0191.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_features_in_graph.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_final_coverage_a.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_guardrails.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_hardening.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_knowledge.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_knowledge_graph.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_knowledge_store_redis.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_knowledge_store_supabase.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_knowledge_stores.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_knowledge_stores_error_handling.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_langfuse_observer.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_loop_detection.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_mcp.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_mcp_coverage.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_memory.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_memory_async.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_memory_boundary.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_memory_integration.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_model_switching.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_multi_agent_edge_cases.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_multimodal.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_orchestration_checkpoint.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_orchestration_e2e.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_orchestration_evals.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_orchestration_graph.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_orchestration_integration.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_orchestration_primitives.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_orchestration_supervisor.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_otel_observer.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_parser.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_patterns.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_phase1_design_patterns.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_pipeline.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_pipeline_coverage.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_policy.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_prompt.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_prompt_compression.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_property_based.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_reasoning_strategy.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_routing_mode.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_security.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_semantic_cache.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_serve_app_coverage.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_sessions_edge_cases.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_simple_observer.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_simulation_evals.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_stability.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_starlette_app.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_structured.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_structured_config.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_structured_tool_results.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_summarize_on_trim.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_templates_coverage.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_terminal_actions.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_token_estimation.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_tool_caching.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_trace.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_trace_html.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_trace_store.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_v016_regression.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_v019_features.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_visual_builder.py +0 -0
- {selectools-0.23.0 → selectools-0.25.0}/tests/test_yaml_config.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: selectools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.25.0
|
|
4
4
|
Summary: Production-ready Python framework for AI agents with multi-agent graphs, hybrid RAG, guardrails, audit logging, 50 evaluators, and a visual builder. Supports OpenAI, Anthropic, Gemini, Ollama. By NichevLabs.
|
|
5
5
|
Author-email: John Nichev <johnnichev@gmail.com>
|
|
6
6
|
Maintainer-email: NichevLabs <support@nichevlabs.com>
|
|
@@ -55,10 +55,16 @@ Requires-Dist: beautifulsoup4>=4.12.0; extra == "rag"
|
|
|
55
55
|
Provides-Extra: observe
|
|
56
56
|
Requires-Dist: opentelemetry-api>=1.20.0; extra == "observe"
|
|
57
57
|
Requires-Dist: langfuse>=2.0.0; extra == "observe"
|
|
58
|
+
Provides-Extra: toolbox
|
|
59
|
+
Requires-Dist: requests>=2.28.0; extra == "toolbox"
|
|
60
|
+
Requires-Dist: slack-sdk>=3.27.0; extra == "toolbox"
|
|
61
|
+
Requires-Dist: pdfplumber>=0.11.0; extra == "toolbox"
|
|
58
62
|
Provides-Extra: evals
|
|
59
63
|
Requires-Dist: pyyaml>=6.0.0; extra == "evals"
|
|
60
64
|
Provides-Extra: mcp
|
|
61
65
|
Requires-Dist: mcp<2.0.0,>=1.0.0; extra == "mcp"
|
|
66
|
+
Provides-Extra: litellm
|
|
67
|
+
Requires-Dist: litellm>=1.0.0; extra == "litellm"
|
|
62
68
|
Provides-Extra: postgres
|
|
63
69
|
Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
|
|
64
70
|
Provides-Extra: supabase
|
|
@@ -67,6 +73,7 @@ Provides-Extra: serve
|
|
|
67
73
|
Requires-Dist: pyyaml>=6.0.0; extra == "serve"
|
|
68
74
|
Requires-Dist: starlette>=0.27.0; extra == "serve"
|
|
69
75
|
Requires-Dist: uvicorn[standard]>=0.24.0; extra == "serve"
|
|
76
|
+
Requires-Dist: httpx>=0.24.0; extra == "serve"
|
|
70
77
|
Dynamic: license-file
|
|
71
78
|
|
|
72
79
|
```
|
|
@@ -101,6 +108,51 @@ result = AgentGraph.chain(planner, writer, reviewer).run("Write a blog post")
|
|
|
101
108
|
# selectools serve agent.yaml
|
|
102
109
|
```
|
|
103
110
|
|
|
111
|
+
## What's New in v0.25
|
|
112
|
+
|
|
113
|
+
### v0.25.0 — Hardening & v1.0 Prep
|
|
114
|
+
|
|
115
|
+
Five new features plus the final v1.0 groundwork: the entire 433-symbol public surface is now stability-marked (205 stable, 228 beta) with a CI gate, the long-deprecated `AgentConfig.hooks` is removed, and the security audit is published.
|
|
116
|
+
|
|
117
|
+
- **Planning-as-config** — `AgentConfig(planning=PlanningConfig(...))` adds plan→execute→synthesize to any agent via isolated clones, with a complexity gate, cross-clone budget caps, and a plan approval handler.
|
|
118
|
+
- **Agent-level HITL** — `ToolConfig(require_approval=[...], approval_handler=...)` gates tool execution behind a sync or async approval callback (fail-closed, denials memoized per run).
|
|
119
|
+
- **Tool result compression** — `ToolConfig(compress_results=True)` summarizes oversized tool results via a one-shot LLM call before they enter context, with raw-text retention for stop conditions and loop detection.
|
|
120
|
+
- **Knowledge pre-save sanitization** — `pre_save` hook on `KnowledgeMemory` plus built-in sanitizers: `defang_delimiters` (prompt-injection markers), `strip_surrogates`, `dedupe_against`.
|
|
121
|
+
- **Pending intent hooks** — `pop_if_intent` (structured confirm/cancel from chat buttons, bypasses the text parser) and `tighten_ttl` (id-pinned atomic Lua rewrite on Redis).
|
|
122
|
+
- **Stability marking sweep** — 100% of the public surface marked; 19 beta→stable promotions (AgentGraph + orchestration core, all 5 pattern agents, checkpoint stores, `RedisSessionStore`, `AzureOpenAIProvider`, ...); module-level `__stability__` on all 123 public modules; CI gate enforces markers forever.
|
|
123
|
+
- **Wart removal** — `Agent.clone_for_isolation()` is public (`@beta`); `__all__` reconciled (11 documented symbols now exported, incl. the Pipeline family and `RouterProvider`); **BREAKING**: `AgentConfig(hooks=...)` now raises `TypeError` (deprecated since v0.16) — migrate to `AgentObserver` via `docs/MIGRATION_1.0.md`.
|
|
124
|
+
- **Security audit published** — `docs/SECURITY_AUDIT.md`: bandit clean at medium/high, all 73 `nosec` suppressions justified, pip-audit pass, SBOM regenerated.
|
|
125
|
+
- **Protocol isinstance fix** — stability markers no longer break third-party `isinstance` checks against `Cache`/`KnowledgeStore`/`CheckpointStore` on Python 3.9–3.11.
|
|
126
|
+
|
|
127
|
+
See `CHANGELOG.md` for the full entry (7,268 tests, 111 examples).
|
|
128
|
+
|
|
129
|
+
## What's New in v0.24
|
|
130
|
+
|
|
131
|
+
### v0.24.0 — Production Interop
|
|
132
|
+
|
|
133
|
+
Twelve features focused on running agents in production and connecting them to everything else: serve agents as REST APIs, talk to other agents over A2A, reach 100+ models through LiteLLM, route by cost, and persist memory anywhere.
|
|
134
|
+
|
|
135
|
+
- **Agent-as-API** — `selectools.serve.AgentAPI` turns any Agent (or list of agents) into a production Starlette ASGI app: `POST /v1/chat`, SSE streaming, session CRUD, bearer auth, per-user session isolation. CLI: `selectools serve agent.yaml --api --port 8000`.
|
|
136
|
+
- **A2A protocol** — `A2AServer` + `A2AClient` for agent-to-agent communication: Agent Card discovery (`/.well-known/agent.json`) and JSON-RPC 2.0 `message/send`/`tasks/get`/`tasks/cancel`.
|
|
137
|
+
- **LiteLLMProvider** — instant access to 100+ models (DeepSeek, Groq, Bedrock, ...) via `pip install selectools[litellm]`.
|
|
138
|
+
- **RouterProvider** — cost-optimized routing across model tiers with a deterministic complexity classifier and failure escalation.
|
|
139
|
+
- **Anthropic prompt caching** — opt-in `cache_system=True` / `cache_tools=True` with cache hit-rate fields on `UsageStats`.
|
|
140
|
+
- **UnifiedMemory** — tiered memory orchestrating conversation, knowledge, entity, and the new episodic tier, with token-aware compaction and federated `recall()`.
|
|
141
|
+
- **Cross-session search** — `store.search(query)` on all four SessionStore backends (FTS5-accelerated on SQLite).
|
|
142
|
+
- **KnowledgeBackend** — Supabase/Redis blob persistence for `KnowledgeMemory` on ephemeral infrastructure (Railway, Lambda, Cloud Run).
|
|
143
|
+
- **ToolResult + Artifact** — typed tool results with a `kind` discriminator, plus an `emit_artifact()` side-channel surfaced on `AgentResult.artifacts`.
|
|
144
|
+
- **Deferred confirmation flow** — `selectools.pending` for chat-channel destructive tools where the user's "yes" arrives as a separate webhook turn.
|
|
145
|
+
- **Toolbox expansion** — 15 new tools (33 → 48): safe calculator, email, PDF extraction, Slack, Notion, Linear.
|
|
146
|
+
- **Gemini schema sanitization** — bare `list` and `Dict[K, V]` tool parameters no longer 400 on the Gemini API; loud warnings for flash-lite's silent-empty-response failure mode.
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from selectools.serve import AgentAPI
|
|
150
|
+
|
|
151
|
+
api = AgentAPI(agent, auth_key="secret") # ASGI app: uvicorn main:api
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
See `CHANGELOG.md` for the full entry (6,187 tests, 111 examples).
|
|
155
|
+
|
|
104
156
|
## What's New in v0.23
|
|
105
157
|
|
|
106
158
|
### v0.23.0 — Supabase Sessions + Builder RAG
|
|
@@ -570,7 +622,15 @@ report.to_html("report.html")
|
|
|
570
622
|
| **Audit Logging** | JSONL audit trail with privacy controls (redact, hash, omit) and daily rotation. |
|
|
571
623
|
| **Tool Output Screening** | Prompt injection detection with 15 built-in patterns. Per-tool or global. |
|
|
572
624
|
| **Coherence Checking** | LLM-based verification that tool calls match user intent — catches injection-driven tool misuse. |
|
|
573
|
-
| **Persistent Sessions** | `SessionStore` with JSON file, SQLite, and
|
|
625
|
+
| **Persistent Sessions** | `SessionStore` with JSON file, SQLite, Redis, and Supabase backends. Auto-save/load with TTL expiry, cross-session `search()`. |
|
|
626
|
+
| **Agent-as-API** | `AgentAPI` serves any agent as a Starlette REST API — chat, SSE streaming, session CRUD, bearer auth, per-user session isolation. |
|
|
627
|
+
| **A2A Protocol** | `A2AServer` + `A2AClient`: Agent Card discovery and JSON-RPC 2.0 messaging between agents. |
|
|
628
|
+
| **LiteLLM Bridge** | `LiteLLMProvider` unlocks 100+ models (DeepSeek, Groq, Bedrock, ...) through one provider class. |
|
|
629
|
+
| **Cost-Based Routing** | `RouterProvider` classifies request complexity and routes to model tiers with automatic failure escalation. |
|
|
630
|
+
| **Unified Memory** | `UnifiedMemory` orchestrates conversation, knowledge, entity, and episodic tiers with token-aware compaction and federated `recall()`. |
|
|
631
|
+
| **Typed Tool Results** | `ToolResult` base with `kind` discriminator; `emit_artifact()` side-channel surfaces files/URLs on `AgentResult.artifacts`. |
|
|
632
|
+
| **Deferred Confirmation** | `selectools.pending` — confirm destructive chat-channel tools across webhook turns with TTL, scope, and args-digest matching. |
|
|
633
|
+
| **Prompt Caching** | Anthropic `cache_system`/`cache_tools` markers with cache hit-rate fields on `UsageStats`. |
|
|
574
634
|
| **Entity Memory** | LLM-based entity extraction with deduplication, LRU pruning, and system prompt injection. |
|
|
575
635
|
| **Knowledge Graph** | Relationship triple extraction with in-memory and SQLite storage and keyword-based querying. |
|
|
576
636
|
| **Cross-Session Knowledge** | Daily logs + persistent facts with auto-registered `remember` tool. |
|
|
@@ -578,14 +638,16 @@ report.to_html("report.html")
|
|
|
578
638
|
| **Eval Framework** | 50 built-in evaluators (30 deterministic + 21 LLM-as-judge). A/B testing, regression detection, snapshot testing, HTML reports, JUnit XML, CI integration. |
|
|
579
639
|
| **Multi-Agent Orchestration** | `AgentGraph` for directed agent graphs, `SupervisorAgent` with 4 strategies, HITL via generator nodes, parallel execution, checkpointing, subgraph composition. |
|
|
580
640
|
| **Composable Pipelines** | `Pipeline` + `@step` + `|` operator + `parallel()` + `branch()` — chain agents, tools, and transforms with plain Python. |
|
|
581
|
-
| **AgentObserver Protocol** |
|
|
641
|
+
| **AgentObserver Protocol** | 46-event lifecycle observer with `run_id`/`call_id` correlation. Built-in `LoggingObserver` + `SimpleStepObserver`. |
|
|
582
642
|
| **Runtime Controls** | Token/cost budget limits, cooperative cancellation, per-tool approval gates, model switching per iteration. |
|
|
583
643
|
| **Production Hardened** | Retries with backoff, per-tool timeouts, iteration caps, cost warnings, observability hooks + observers. |
|
|
584
644
|
| **Library-First** | Not a framework. No magic globals, no hidden state. Use as much or as little as you need. |
|
|
585
645
|
|
|
586
646
|
## What's Included
|
|
587
647
|
|
|
588
|
-
- **
|
|
648
|
+
- **6 LLM Providers**: OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama, LiteLLM (100+ models) + FallbackProvider (auto-failover) + RouterProvider (cost-based routing)
|
|
649
|
+
- **Agent-as-API**: `AgentAPI` — production REST endpoints (chat, SSE streaming, sessions) from any agent
|
|
650
|
+
- **A2A Protocol**: Agent Card discovery + JSON-RPC 2.0 agent-to-agent messaging
|
|
589
651
|
- **Structured Output**: Pydantic / JSON Schema `response_format` with auto-retry
|
|
590
652
|
- **Execution Traces**: `result.trace` with typed timeline of every agent step
|
|
591
653
|
- **Reasoning Visibility**: `result.reasoning` explains *why* the agent chose a tool
|
|
@@ -598,9 +660,14 @@ report.to_html("report.html")
|
|
|
598
660
|
- **Dynamic Tool Loading**: Plugin system with hot-reload support
|
|
599
661
|
- **Response Caching**: InMemoryCache and RedisCache with stats tracking
|
|
600
662
|
- **152 Model Registry**: Type-safe constants with pricing and metadata
|
|
601
|
-
- **Pre-built Toolbox**:
|
|
602
|
-
- **Persistent Sessions**:
|
|
663
|
+
- **Pre-built Toolbox**: 48 tools for files, data, text, datetime, web, code, search, GitHub, DB, calculator, email, PDF, Slack, Notion, Linear
|
|
664
|
+
- **Persistent Sessions**: 4 backends (JSON file, SQLite, Redis, Supabase) with TTL and cross-session search
|
|
603
665
|
- **Entity Memory**: LLM-based named entity extraction and tracking
|
|
666
|
+
- **Unified Memory**: tiered conversation/knowledge/entity/episodic memory with token-aware compaction
|
|
667
|
+
- **Knowledge Backends**: Supabase/Redis blob persistence for KnowledgeMemory on ephemeral infra
|
|
668
|
+
- **Typed Tool Results**: `ToolResult` base class + `Artifact` side-channel via `emit_artifact()`
|
|
669
|
+
- **Deferred Confirmation**: `selectools.pending` for chat-channel destructive-tool confirmation
|
|
670
|
+
- **Anthropic Prompt Caching**: `cache_system`/`cache_tools` with hit-rate visibility on `UsageStats`
|
|
604
671
|
- **Knowledge Graph**: Triple extraction with in-memory and SQLite storage
|
|
605
672
|
- **Cross-Session Knowledge**: Daily logs + persistent memory with `remember` tool, pluggable stores (File, SQLite), importance scoring, TTL
|
|
606
673
|
- **Token Budget & Cancellation**: `max_total_tokens`, `max_cost_usd` hard limits; `CancellationToken` for cooperative stopping
|
|
@@ -611,10 +678,10 @@ report.to_html("report.html")
|
|
|
611
678
|
- **Conversation Branching**: `ConversationMemory.branch()` and `SessionStore.branch()` for A/B exploration and checkpointing
|
|
612
679
|
- **Multi-Agent Orchestration**: `AgentGraph` with routing, parallel execution, HITL, checkpointing; `SupervisorAgent` with 4 strategies (plan_and_execute, round_robin, dynamic, magentic)
|
|
613
680
|
- **Composable Pipelines**: `Pipeline` + `@step` + `|` operator + `parallel()` + `branch()` — chain agents, tools, and transforms
|
|
614
|
-
- **
|
|
681
|
+
- **111 Examples**: Multi-agent graphs, RAG, hybrid search, streaming, structured output, traces, batch, policy, observer, guardrails, audit, sessions (incl. Supabase), entity memory, knowledge graph, eval framework, advanced agent patterns, stability markers, HTML trace viewer, agent-as-API, A2A, routing, unified memory, and more
|
|
615
682
|
- **Built-in Eval Framework**: 50 evaluators (30 deterministic + 21 LLM-as-judge), A/B testing, regression detection, HTML reports, JUnit XML, snapshot testing
|
|
616
|
-
- **AgentObserver Protocol**:
|
|
617
|
-
- **
|
|
683
|
+
- **AgentObserver Protocol**: 46 lifecycle events with `run_id` correlation, `LoggingObserver`, `SimpleStepObserver`, OTel export
|
|
684
|
+
- **7268 Tests**: Unit, integration, regression, and E2E with real API calls
|
|
618
685
|
|
|
619
686
|
## Install
|
|
620
687
|
|
|
@@ -940,7 +1007,7 @@ agent = Agent(
|
|
|
940
1007
|
)
|
|
941
1008
|
```
|
|
942
1009
|
|
|
943
|
-
|
|
1010
|
+
46 lifecycle events: run, LLM, tool, iteration, batch, policy, structured output, fallback, retry, memory trim, guardrail, coherence, screening, session, entity, KG, budget exceeded, cancelled, prompt compressed, plus 13 graph events (graph start/end, node start/end, routing, interrupt, resume, parallel, stall, loop, supervisor replan). See `observer.py` for full reference.
|
|
944
1011
|
|
|
945
1012
|
### E2E Streaming & Parallel Execution
|
|
946
1013
|
|
|
@@ -960,6 +1027,8 @@ See [docs/modules/STREAMING.md](https://github.com/johnnichev/selectools/blob/ma
|
|
|
960
1027
|
| **Anthropic** | Yes | Yes | Yes | Paid |
|
|
961
1028
|
| **Gemini** | Yes | Yes | Yes | Free tier |
|
|
962
1029
|
| **Ollama** | Yes | No | No | Free (local) |
|
|
1030
|
+
| **LiteLLM** | Yes | Yes | Yes | Varies (100+ models) |
|
|
1031
|
+
| **Router** | Yes | Yes | Yes | Varies (cost-routes tiers) |
|
|
963
1032
|
| **Fallback** | Yes | Yes | Yes | Varies (wraps others) |
|
|
964
1033
|
| **Local** | No | No | No | Free (testing) |
|
|
965
1034
|
|
|
@@ -1114,7 +1183,7 @@ Examples are numbered by difficulty. Start from 01 and work your way up.
|
|
|
1114
1183
|
|---|---|---|---|
|
|
1115
1184
|
| 01 | `01_hello_world.py` | First agent, `@tool`, `ask()` | No |
|
|
1116
1185
|
| 02 | `02_search_weather.py` | ToolRegistry, multiple tools | No |
|
|
1117
|
-
| 03 | `03_toolbox.py` |
|
|
1186
|
+
| 03 | `03_toolbox.py` | 48 pre-built tools (file, data, text, datetime, web, code, search, and more) | No |
|
|
1118
1187
|
| 04 | `04_conversation_memory.py` | Multi-turn memory | Yes |
|
|
1119
1188
|
| 05 | `05_cost_tracking.py` | Token counting, cost warnings | Yes |
|
|
1120
1189
|
| 06 | `06_async_agent.py` | `arun()`, concurrent agents, FastAPI | Yes |
|
|
@@ -1123,7 +1192,7 @@ Examples are numbered by difficulty. Start from 01 and work your way up.
|
|
|
1123
1192
|
| 09 | `09_caching.py` | InMemoryCache, RedisCache, cache stats | Yes |
|
|
1124
1193
|
| 10 | `10_routing_mode.py` | Routing mode, intent classification | Yes |
|
|
1125
1194
|
| 11 | `11_tool_analytics.py` | Call counts, success rates, timing | Yes |
|
|
1126
|
-
| 12 | `12_observability_hooks.py` | Lifecycle
|
|
1195
|
+
| 12 | `12_observability_hooks.py` | Lifecycle observers, tool validation | Yes |
|
|
1127
1196
|
| 13 | `13_dynamic_tools.py` | ToolLoader, plugins, hot-reload | Yes |
|
|
1128
1197
|
| 14 | `14_rag_basic.py` | RAG pipeline, document loading, vector search | Yes + `[rag]` |
|
|
1129
1198
|
| 15 | `15_semantic_search.py` | Pure semantic search, metadata filtering | Yes + `[rag]` |
|
|
@@ -1238,7 +1307,7 @@ pytest tests/ -x -q # All tests
|
|
|
1238
1307
|
pytest tests/ -k "not e2e" # Skip E2E (no API keys needed)
|
|
1239
1308
|
```
|
|
1240
1309
|
|
|
1241
|
-
|
|
1310
|
+
7268 tests covering parsing, agent loop, providers, RAG pipeline, hybrid search, advanced chunking, dynamic tools, caching, streaming, guardrails, sessions, memory, eval framework, budget/cancellation, knowledge stores, orchestration, pipelines, agent patterns, stability markers, trace viewer, serve API, A2A, routing, and E2E integration with real API calls.
|
|
1242
1311
|
|
|
1243
1312
|
## License
|
|
1244
1313
|
|
|
@@ -30,6 +30,51 @@ result = AgentGraph.chain(planner, writer, reviewer).run("Write a blog post")
|
|
|
30
30
|
# selectools serve agent.yaml
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
## What's New in v0.25
|
|
34
|
+
|
|
35
|
+
### v0.25.0 — Hardening & v1.0 Prep
|
|
36
|
+
|
|
37
|
+
Five new features plus the final v1.0 groundwork: the entire 433-symbol public surface is now stability-marked (205 stable, 228 beta) with a CI gate, the long-deprecated `AgentConfig.hooks` is removed, and the security audit is published.
|
|
38
|
+
|
|
39
|
+
- **Planning-as-config** — `AgentConfig(planning=PlanningConfig(...))` adds plan→execute→synthesize to any agent via isolated clones, with a complexity gate, cross-clone budget caps, and a plan approval handler.
|
|
40
|
+
- **Agent-level HITL** — `ToolConfig(require_approval=[...], approval_handler=...)` gates tool execution behind a sync or async approval callback (fail-closed, denials memoized per run).
|
|
41
|
+
- **Tool result compression** — `ToolConfig(compress_results=True)` summarizes oversized tool results via a one-shot LLM call before they enter context, with raw-text retention for stop conditions and loop detection.
|
|
42
|
+
- **Knowledge pre-save sanitization** — `pre_save` hook on `KnowledgeMemory` plus built-in sanitizers: `defang_delimiters` (prompt-injection markers), `strip_surrogates`, `dedupe_against`.
|
|
43
|
+
- **Pending intent hooks** — `pop_if_intent` (structured confirm/cancel from chat buttons, bypasses the text parser) and `tighten_ttl` (id-pinned atomic Lua rewrite on Redis).
|
|
44
|
+
- **Stability marking sweep** — 100% of the public surface marked; 19 beta→stable promotions (AgentGraph + orchestration core, all 5 pattern agents, checkpoint stores, `RedisSessionStore`, `AzureOpenAIProvider`, ...); module-level `__stability__` on all 123 public modules; CI gate enforces markers forever.
|
|
45
|
+
- **Wart removal** — `Agent.clone_for_isolation()` is public (`@beta`); `__all__` reconciled (11 documented symbols now exported, incl. the Pipeline family and `RouterProvider`); **BREAKING**: `AgentConfig(hooks=...)` now raises `TypeError` (deprecated since v0.16) — migrate to `AgentObserver` via `docs/MIGRATION_1.0.md`.
|
|
46
|
+
- **Security audit published** — `docs/SECURITY_AUDIT.md`: bandit clean at medium/high, all 73 `nosec` suppressions justified, pip-audit pass, SBOM regenerated.
|
|
47
|
+
- **Protocol isinstance fix** — stability markers no longer break third-party `isinstance` checks against `Cache`/`KnowledgeStore`/`CheckpointStore` on Python 3.9–3.11.
|
|
48
|
+
|
|
49
|
+
See `CHANGELOG.md` for the full entry (7,268 tests, 111 examples).
|
|
50
|
+
|
|
51
|
+
## What's New in v0.24
|
|
52
|
+
|
|
53
|
+
### v0.24.0 — Production Interop
|
|
54
|
+
|
|
55
|
+
Twelve features focused on running agents in production and connecting them to everything else: serve agents as REST APIs, talk to other agents over A2A, reach 100+ models through LiteLLM, route by cost, and persist memory anywhere.
|
|
56
|
+
|
|
57
|
+
- **Agent-as-API** — `selectools.serve.AgentAPI` turns any Agent (or list of agents) into a production Starlette ASGI app: `POST /v1/chat`, SSE streaming, session CRUD, bearer auth, per-user session isolation. CLI: `selectools serve agent.yaml --api --port 8000`.
|
|
58
|
+
- **A2A protocol** — `A2AServer` + `A2AClient` for agent-to-agent communication: Agent Card discovery (`/.well-known/agent.json`) and JSON-RPC 2.0 `message/send`/`tasks/get`/`tasks/cancel`.
|
|
59
|
+
- **LiteLLMProvider** — instant access to 100+ models (DeepSeek, Groq, Bedrock, ...) via `pip install selectools[litellm]`.
|
|
60
|
+
- **RouterProvider** — cost-optimized routing across model tiers with a deterministic complexity classifier and failure escalation.
|
|
61
|
+
- **Anthropic prompt caching** — opt-in `cache_system=True` / `cache_tools=True` with cache hit-rate fields on `UsageStats`.
|
|
62
|
+
- **UnifiedMemory** — tiered memory orchestrating conversation, knowledge, entity, and the new episodic tier, with token-aware compaction and federated `recall()`.
|
|
63
|
+
- **Cross-session search** — `store.search(query)` on all four SessionStore backends (FTS5-accelerated on SQLite).
|
|
64
|
+
- **KnowledgeBackend** — Supabase/Redis blob persistence for `KnowledgeMemory` on ephemeral infrastructure (Railway, Lambda, Cloud Run).
|
|
65
|
+
- **ToolResult + Artifact** — typed tool results with a `kind` discriminator, plus an `emit_artifact()` side-channel surfaced on `AgentResult.artifacts`.
|
|
66
|
+
- **Deferred confirmation flow** — `selectools.pending` for chat-channel destructive tools where the user's "yes" arrives as a separate webhook turn.
|
|
67
|
+
- **Toolbox expansion** — 15 new tools (33 → 48): safe calculator, email, PDF extraction, Slack, Notion, Linear.
|
|
68
|
+
- **Gemini schema sanitization** — bare `list` and `Dict[K, V]` tool parameters no longer 400 on the Gemini API; loud warnings for flash-lite's silent-empty-response failure mode.
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from selectools.serve import AgentAPI
|
|
72
|
+
|
|
73
|
+
api = AgentAPI(agent, auth_key="secret") # ASGI app: uvicorn main:api
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
See `CHANGELOG.md` for the full entry (6,187 tests, 111 examples).
|
|
77
|
+
|
|
33
78
|
## What's New in v0.23
|
|
34
79
|
|
|
35
80
|
### v0.23.0 — Supabase Sessions + Builder RAG
|
|
@@ -499,7 +544,15 @@ report.to_html("report.html")
|
|
|
499
544
|
| **Audit Logging** | JSONL audit trail with privacy controls (redact, hash, omit) and daily rotation. |
|
|
500
545
|
| **Tool Output Screening** | Prompt injection detection with 15 built-in patterns. Per-tool or global. |
|
|
501
546
|
| **Coherence Checking** | LLM-based verification that tool calls match user intent — catches injection-driven tool misuse. |
|
|
502
|
-
| **Persistent Sessions** | `SessionStore` with JSON file, SQLite, and
|
|
547
|
+
| **Persistent Sessions** | `SessionStore` with JSON file, SQLite, Redis, and Supabase backends. Auto-save/load with TTL expiry, cross-session `search()`. |
|
|
548
|
+
| **Agent-as-API** | `AgentAPI` serves any agent as a Starlette REST API — chat, SSE streaming, session CRUD, bearer auth, per-user session isolation. |
|
|
549
|
+
| **A2A Protocol** | `A2AServer` + `A2AClient`: Agent Card discovery and JSON-RPC 2.0 messaging between agents. |
|
|
550
|
+
| **LiteLLM Bridge** | `LiteLLMProvider` unlocks 100+ models (DeepSeek, Groq, Bedrock, ...) through one provider class. |
|
|
551
|
+
| **Cost-Based Routing** | `RouterProvider` classifies request complexity and routes to model tiers with automatic failure escalation. |
|
|
552
|
+
| **Unified Memory** | `UnifiedMemory` orchestrates conversation, knowledge, entity, and episodic tiers with token-aware compaction and federated `recall()`. |
|
|
553
|
+
| **Typed Tool Results** | `ToolResult` base with `kind` discriminator; `emit_artifact()` side-channel surfaces files/URLs on `AgentResult.artifacts`. |
|
|
554
|
+
| **Deferred Confirmation** | `selectools.pending` — confirm destructive chat-channel tools across webhook turns with TTL, scope, and args-digest matching. |
|
|
555
|
+
| **Prompt Caching** | Anthropic `cache_system`/`cache_tools` markers with cache hit-rate fields on `UsageStats`. |
|
|
503
556
|
| **Entity Memory** | LLM-based entity extraction with deduplication, LRU pruning, and system prompt injection. |
|
|
504
557
|
| **Knowledge Graph** | Relationship triple extraction with in-memory and SQLite storage and keyword-based querying. |
|
|
505
558
|
| **Cross-Session Knowledge** | Daily logs + persistent facts with auto-registered `remember` tool. |
|
|
@@ -507,14 +560,16 @@ report.to_html("report.html")
|
|
|
507
560
|
| **Eval Framework** | 50 built-in evaluators (30 deterministic + 21 LLM-as-judge). A/B testing, regression detection, snapshot testing, HTML reports, JUnit XML, CI integration. |
|
|
508
561
|
| **Multi-Agent Orchestration** | `AgentGraph` for directed agent graphs, `SupervisorAgent` with 4 strategies, HITL via generator nodes, parallel execution, checkpointing, subgraph composition. |
|
|
509
562
|
| **Composable Pipelines** | `Pipeline` + `@step` + `|` operator + `parallel()` + `branch()` — chain agents, tools, and transforms with plain Python. |
|
|
510
|
-
| **AgentObserver Protocol** |
|
|
563
|
+
| **AgentObserver Protocol** | 46-event lifecycle observer with `run_id`/`call_id` correlation. Built-in `LoggingObserver` + `SimpleStepObserver`. |
|
|
511
564
|
| **Runtime Controls** | Token/cost budget limits, cooperative cancellation, per-tool approval gates, model switching per iteration. |
|
|
512
565
|
| **Production Hardened** | Retries with backoff, per-tool timeouts, iteration caps, cost warnings, observability hooks + observers. |
|
|
513
566
|
| **Library-First** | Not a framework. No magic globals, no hidden state. Use as much or as little as you need. |
|
|
514
567
|
|
|
515
568
|
## What's Included
|
|
516
569
|
|
|
517
|
-
- **
|
|
570
|
+
- **6 LLM Providers**: OpenAI, Azure OpenAI, Anthropic, Gemini, Ollama, LiteLLM (100+ models) + FallbackProvider (auto-failover) + RouterProvider (cost-based routing)
|
|
571
|
+
- **Agent-as-API**: `AgentAPI` — production REST endpoints (chat, SSE streaming, sessions) from any agent
|
|
572
|
+
- **A2A Protocol**: Agent Card discovery + JSON-RPC 2.0 agent-to-agent messaging
|
|
518
573
|
- **Structured Output**: Pydantic / JSON Schema `response_format` with auto-retry
|
|
519
574
|
- **Execution Traces**: `result.trace` with typed timeline of every agent step
|
|
520
575
|
- **Reasoning Visibility**: `result.reasoning` explains *why* the agent chose a tool
|
|
@@ -527,9 +582,14 @@ report.to_html("report.html")
|
|
|
527
582
|
- **Dynamic Tool Loading**: Plugin system with hot-reload support
|
|
528
583
|
- **Response Caching**: InMemoryCache and RedisCache with stats tracking
|
|
529
584
|
- **152 Model Registry**: Type-safe constants with pricing and metadata
|
|
530
|
-
- **Pre-built Toolbox**:
|
|
531
|
-
- **Persistent Sessions**:
|
|
585
|
+
- **Pre-built Toolbox**: 48 tools for files, data, text, datetime, web, code, search, GitHub, DB, calculator, email, PDF, Slack, Notion, Linear
|
|
586
|
+
- **Persistent Sessions**: 4 backends (JSON file, SQLite, Redis, Supabase) with TTL and cross-session search
|
|
532
587
|
- **Entity Memory**: LLM-based named entity extraction and tracking
|
|
588
|
+
- **Unified Memory**: tiered conversation/knowledge/entity/episodic memory with token-aware compaction
|
|
589
|
+
- **Knowledge Backends**: Supabase/Redis blob persistence for KnowledgeMemory on ephemeral infra
|
|
590
|
+
- **Typed Tool Results**: `ToolResult` base class + `Artifact` side-channel via `emit_artifact()`
|
|
591
|
+
- **Deferred Confirmation**: `selectools.pending` for chat-channel destructive-tool confirmation
|
|
592
|
+
- **Anthropic Prompt Caching**: `cache_system`/`cache_tools` with hit-rate visibility on `UsageStats`
|
|
533
593
|
- **Knowledge Graph**: Triple extraction with in-memory and SQLite storage
|
|
534
594
|
- **Cross-Session Knowledge**: Daily logs + persistent memory with `remember` tool, pluggable stores (File, SQLite), importance scoring, TTL
|
|
535
595
|
- **Token Budget & Cancellation**: `max_total_tokens`, `max_cost_usd` hard limits; `CancellationToken` for cooperative stopping
|
|
@@ -540,10 +600,10 @@ report.to_html("report.html")
|
|
|
540
600
|
- **Conversation Branching**: `ConversationMemory.branch()` and `SessionStore.branch()` for A/B exploration and checkpointing
|
|
541
601
|
- **Multi-Agent Orchestration**: `AgentGraph` with routing, parallel execution, HITL, checkpointing; `SupervisorAgent` with 4 strategies (plan_and_execute, round_robin, dynamic, magentic)
|
|
542
602
|
- **Composable Pipelines**: `Pipeline` + `@step` + `|` operator + `parallel()` + `branch()` — chain agents, tools, and transforms
|
|
543
|
-
- **
|
|
603
|
+
- **111 Examples**: Multi-agent graphs, RAG, hybrid search, streaming, structured output, traces, batch, policy, observer, guardrails, audit, sessions (incl. Supabase), entity memory, knowledge graph, eval framework, advanced agent patterns, stability markers, HTML trace viewer, agent-as-API, A2A, routing, unified memory, and more
|
|
544
604
|
- **Built-in Eval Framework**: 50 evaluators (30 deterministic + 21 LLM-as-judge), A/B testing, regression detection, HTML reports, JUnit XML, snapshot testing
|
|
545
|
-
- **AgentObserver Protocol**:
|
|
546
|
-
- **
|
|
605
|
+
- **AgentObserver Protocol**: 46 lifecycle events with `run_id` correlation, `LoggingObserver`, `SimpleStepObserver`, OTel export
|
|
606
|
+
- **7268 Tests**: Unit, integration, regression, and E2E with real API calls
|
|
547
607
|
|
|
548
608
|
## Install
|
|
549
609
|
|
|
@@ -869,7 +929,7 @@ agent = Agent(
|
|
|
869
929
|
)
|
|
870
930
|
```
|
|
871
931
|
|
|
872
|
-
|
|
932
|
+
46 lifecycle events: run, LLM, tool, iteration, batch, policy, structured output, fallback, retry, memory trim, guardrail, coherence, screening, session, entity, KG, budget exceeded, cancelled, prompt compressed, plus 13 graph events (graph start/end, node start/end, routing, interrupt, resume, parallel, stall, loop, supervisor replan). See `observer.py` for full reference.
|
|
873
933
|
|
|
874
934
|
### E2E Streaming & Parallel Execution
|
|
875
935
|
|
|
@@ -889,6 +949,8 @@ See [docs/modules/STREAMING.md](https://github.com/johnnichev/selectools/blob/ma
|
|
|
889
949
|
| **Anthropic** | Yes | Yes | Yes | Paid |
|
|
890
950
|
| **Gemini** | Yes | Yes | Yes | Free tier |
|
|
891
951
|
| **Ollama** | Yes | No | No | Free (local) |
|
|
952
|
+
| **LiteLLM** | Yes | Yes | Yes | Varies (100+ models) |
|
|
953
|
+
| **Router** | Yes | Yes | Yes | Varies (cost-routes tiers) |
|
|
892
954
|
| **Fallback** | Yes | Yes | Yes | Varies (wraps others) |
|
|
893
955
|
| **Local** | No | No | No | Free (testing) |
|
|
894
956
|
|
|
@@ -1043,7 +1105,7 @@ Examples are numbered by difficulty. Start from 01 and work your way up.
|
|
|
1043
1105
|
|---|---|---|---|
|
|
1044
1106
|
| 01 | `01_hello_world.py` | First agent, `@tool`, `ask()` | No |
|
|
1045
1107
|
| 02 | `02_search_weather.py` | ToolRegistry, multiple tools | No |
|
|
1046
|
-
| 03 | `03_toolbox.py` |
|
|
1108
|
+
| 03 | `03_toolbox.py` | 48 pre-built tools (file, data, text, datetime, web, code, search, and more) | No |
|
|
1047
1109
|
| 04 | `04_conversation_memory.py` | Multi-turn memory | Yes |
|
|
1048
1110
|
| 05 | `05_cost_tracking.py` | Token counting, cost warnings | Yes |
|
|
1049
1111
|
| 06 | `06_async_agent.py` | `arun()`, concurrent agents, FastAPI | Yes |
|
|
@@ -1052,7 +1114,7 @@ Examples are numbered by difficulty. Start from 01 and work your way up.
|
|
|
1052
1114
|
| 09 | `09_caching.py` | InMemoryCache, RedisCache, cache stats | Yes |
|
|
1053
1115
|
| 10 | `10_routing_mode.py` | Routing mode, intent classification | Yes |
|
|
1054
1116
|
| 11 | `11_tool_analytics.py` | Call counts, success rates, timing | Yes |
|
|
1055
|
-
| 12 | `12_observability_hooks.py` | Lifecycle
|
|
1117
|
+
| 12 | `12_observability_hooks.py` | Lifecycle observers, tool validation | Yes |
|
|
1056
1118
|
| 13 | `13_dynamic_tools.py` | ToolLoader, plugins, hot-reload | Yes |
|
|
1057
1119
|
| 14 | `14_rag_basic.py` | RAG pipeline, document loading, vector search | Yes + `[rag]` |
|
|
1058
1120
|
| 15 | `15_semantic_search.py` | Pure semantic search, metadata filtering | Yes + `[rag]` |
|
|
@@ -1167,7 +1229,7 @@ pytest tests/ -x -q # All tests
|
|
|
1167
1229
|
pytest tests/ -k "not e2e" # Skip E2E (no API keys needed)
|
|
1168
1230
|
```
|
|
1169
1231
|
|
|
1170
|
-
|
|
1232
|
+
7268 tests covering parsing, agent loop, providers, RAG pipeline, hybrid search, advanced chunking, dynamic tools, caching, streaming, guardrails, sessions, memory, eval framework, budget/cancellation, knowledge stores, orchestration, pipelines, agent patterns, stability markers, trace viewer, serve API, A2A, routing, and E2E integration with real API calls.
|
|
1171
1233
|
|
|
1172
1234
|
## License
|
|
1173
1235
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "selectools"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.25.0"
|
|
8
8
|
description = "Production-ready Python framework for AI agents with multi-agent graphs, hybrid RAG, guardrails, audit logging, 50 evaluators, and a visual builder. Supports OpenAI, Anthropic, Gemini, Ollama. By NichevLabs."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
|
@@ -75,12 +75,20 @@ observe = [
|
|
|
75
75
|
"opentelemetry-api>=1.20.0",
|
|
76
76
|
"langfuse>=2.0.0",
|
|
77
77
|
]
|
|
78
|
+
toolbox = [
|
|
79
|
+
"requests>=2.28.0",
|
|
80
|
+
"slack-sdk>=3.27.0",
|
|
81
|
+
"pdfplumber>=0.11.0",
|
|
82
|
+
]
|
|
78
83
|
evals = [
|
|
79
84
|
"pyyaml>=6.0.0",
|
|
80
85
|
]
|
|
81
86
|
mcp = [
|
|
82
87
|
"mcp>=1.0.0,<2.0.0",
|
|
83
88
|
]
|
|
89
|
+
litellm = [
|
|
90
|
+
"litellm>=1.0.0",
|
|
91
|
+
]
|
|
84
92
|
postgres = [
|
|
85
93
|
"psycopg2-binary>=2.9.0",
|
|
86
94
|
]
|
|
@@ -91,6 +99,7 @@ serve = [
|
|
|
91
99
|
"pyyaml>=6.0.0",
|
|
92
100
|
"starlette>=0.27.0",
|
|
93
101
|
"uvicorn[standard]>=0.24.0",
|
|
102
|
+
"httpx>=0.24.0",
|
|
94
103
|
]
|
|
95
104
|
|
|
96
105
|
[project.scripts]
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""Public exports for the selectools package."""
|
|
2
2
|
|
|
3
|
-
__version__ = "0.
|
|
3
|
+
__version__ = "0.25.0"
|
|
4
4
|
|
|
5
5
|
# Import submodules (lazy loading for optional dependencies)
|
|
6
6
|
from . import embeddings, evals, guardrails, models, observe, patterns, rag, toolbox
|
|
7
|
-
from .agent import Agent, AgentConfig
|
|
7
|
+
from .agent import Agent, AgentConfig, PlanningConfig
|
|
8
8
|
from .agent.config_groups import (
|
|
9
9
|
BudgetConfig,
|
|
10
10
|
CoherenceConfig,
|
|
@@ -50,11 +50,17 @@ from .guardrails import (
|
|
|
50
50
|
)
|
|
51
51
|
from .knowledge import (
|
|
52
52
|
FileKnowledgeStore,
|
|
53
|
+
KnowledgeBackend,
|
|
53
54
|
KnowledgeEntry,
|
|
54
55
|
KnowledgeMemory,
|
|
55
56
|
KnowledgeStore,
|
|
57
|
+
PreSaveHook,
|
|
56
58
|
SQLiteKnowledgeStore,
|
|
57
59
|
)
|
|
60
|
+
from .knowledge_backends import (
|
|
61
|
+
RedisKnowledgeBackend,
|
|
62
|
+
SupabaseKnowledgeBackend,
|
|
63
|
+
)
|
|
58
64
|
from .knowledge_graph import (
|
|
59
65
|
InMemoryTripleStore,
|
|
60
66
|
KnowledgeGraphMemory,
|
|
@@ -62,6 +68,11 @@ from .knowledge_graph import (
|
|
|
62
68
|
Triple,
|
|
63
69
|
TripleStore,
|
|
64
70
|
)
|
|
71
|
+
from .knowledge_sanitizers import (
|
|
72
|
+
dedupe_against,
|
|
73
|
+
defang_delimiters,
|
|
74
|
+
strip_surrogates,
|
|
75
|
+
)
|
|
65
76
|
from .loop_detection import (
|
|
66
77
|
BaseDetector,
|
|
67
78
|
LoopDetectedError,
|
|
@@ -122,21 +133,39 @@ from .patterns import (
|
|
|
122
133
|
TeamLeadAgent,
|
|
123
134
|
TeamLeadResult,
|
|
124
135
|
)
|
|
136
|
+
from .pending import (
|
|
137
|
+
ChannelAgent,
|
|
138
|
+
ConfirmOutcome,
|
|
139
|
+
ConfirmParser,
|
|
140
|
+
InMemoryPendingStore,
|
|
141
|
+
PendingAction,
|
|
142
|
+
PendingActionExistsError,
|
|
143
|
+
PendingActionStore,
|
|
144
|
+
PendingConfirmation,
|
|
145
|
+
RedisPendingStore,
|
|
146
|
+
RegexConfirmParser,
|
|
147
|
+
compute_args_digest,
|
|
148
|
+
stash_pending,
|
|
149
|
+
)
|
|
125
150
|
from .pipeline import Pipeline, Step, StepResult, branch, cache_step, parallel, retry, step
|
|
126
|
-
from .policy import PolicyDecision, PolicyResult, ToolPolicy
|
|
151
|
+
from .policy import ApprovalRequest, PolicyDecision, PolicyResult, ToolPolicy
|
|
127
152
|
from .pricing import PRICING, calculate_cost, calculate_embedding_cost, get_model_pricing
|
|
128
153
|
from .prompt import REASONING_STRATEGIES, PromptBuilder
|
|
129
154
|
from .providers.anthropic_provider import AnthropicProvider
|
|
130
155
|
from .providers.azure_openai_provider import AzureOpenAIProvider
|
|
131
156
|
from .providers.fallback import FallbackProvider
|
|
132
157
|
from .providers.gemini_provider import GeminiProvider
|
|
158
|
+
from .providers.litellm_provider import LiteLLMProvider
|
|
133
159
|
from .providers.ollama_provider import OllamaProvider
|
|
134
160
|
from .providers.openai_provider import OpenAIProvider
|
|
161
|
+
from .providers.router import RouterConfig, RouterProvider
|
|
135
162
|
from .providers.stubs import LocalProvider
|
|
163
|
+
from .results import Ambiguous, Artifact, NotFound, ToolResult, emit_artifact
|
|
136
164
|
from .sessions import (
|
|
137
165
|
JsonFileSessionStore,
|
|
138
166
|
RedisSessionStore,
|
|
139
167
|
SessionMetadata,
|
|
168
|
+
SessionSearchResult,
|
|
140
169
|
SessionStore,
|
|
141
170
|
SQLiteSessionStore,
|
|
142
171
|
SupabaseSessionStore,
|
|
@@ -147,11 +176,22 @@ from .token_estimation import TokenEstimate, estimate_run_tokens, estimate_token
|
|
|
147
176
|
from .tools import Tool, ToolParameter, ToolRegistry, tool
|
|
148
177
|
from .trace import AgentTrace, StepType, TraceStep, trace_to_html, trace_to_json
|
|
149
178
|
from .types import AgentResult, ContentPart, Message, Role, ToolCall, image_message, text_content
|
|
179
|
+
from .unified_memory import (
|
|
180
|
+
DEFAULT_IMPORTANCE_RULES,
|
|
181
|
+
Episode,
|
|
182
|
+
EpisodicMemory,
|
|
183
|
+
ImportanceRule,
|
|
184
|
+
InMemoryKnowledgeStore,
|
|
185
|
+
RecallResult,
|
|
186
|
+
UnifiedMemory,
|
|
187
|
+
score_importance,
|
|
188
|
+
)
|
|
150
189
|
from .usage import AgentUsage, UsageStats
|
|
151
190
|
|
|
152
191
|
__all__ = [
|
|
153
192
|
"Agent",
|
|
154
193
|
"AgentConfig",
|
|
194
|
+
"PlanningConfig",
|
|
155
195
|
"AgentResult",
|
|
156
196
|
"AgentAnalytics",
|
|
157
197
|
"ToolMetrics",
|
|
@@ -172,10 +212,23 @@ __all__ = [
|
|
|
172
212
|
"AnthropicProvider",
|
|
173
213
|
"GeminiProvider",
|
|
174
214
|
"OllamaProvider",
|
|
215
|
+
"LiteLLMProvider",
|
|
216
|
+
"RouterProvider",
|
|
217
|
+
"RouterConfig",
|
|
175
218
|
"LocalProvider",
|
|
176
219
|
"FallbackProvider",
|
|
177
220
|
"ToolRegistry",
|
|
178
221
|
"tool",
|
|
222
|
+
# Pipeline composition (public since 0.19.3, @beta)
|
|
223
|
+
"Pipeline",
|
|
224
|
+
"Step",
|
|
225
|
+
"StepResult",
|
|
226
|
+
"compose",
|
|
227
|
+
"step",
|
|
228
|
+
"parallel",
|
|
229
|
+
"branch",
|
|
230
|
+
"retry",
|
|
231
|
+
"cache_step",
|
|
179
232
|
# Cancellation
|
|
180
233
|
"CancellationToken",
|
|
181
234
|
# Exceptions
|
|
@@ -214,10 +267,30 @@ __all__ = [
|
|
|
214
267
|
"SemanticCache",
|
|
215
268
|
# Tool policy
|
|
216
269
|
"ToolPolicy",
|
|
270
|
+
"ApprovalRequest",
|
|
217
271
|
"PolicyDecision",
|
|
218
272
|
"PolicyResult",
|
|
219
273
|
# Structured output
|
|
220
274
|
"ResponseFormat",
|
|
275
|
+
# Typed tool results + artifact side-channel (issue #59)
|
|
276
|
+
"ToolResult",
|
|
277
|
+
"Ambiguous",
|
|
278
|
+
"NotFound",
|
|
279
|
+
"Artifact",
|
|
280
|
+
"emit_artifact",
|
|
281
|
+
# Deferred confirmation flow (issue #58)
|
|
282
|
+
"PendingAction",
|
|
283
|
+
"PendingActionStore",
|
|
284
|
+
"PendingActionExistsError",
|
|
285
|
+
"InMemoryPendingStore",
|
|
286
|
+
"RedisPendingStore",
|
|
287
|
+
"ConfirmOutcome",
|
|
288
|
+
"ConfirmParser",
|
|
289
|
+
"RegexConfirmParser",
|
|
290
|
+
"PendingConfirmation",
|
|
291
|
+
"ChannelAgent",
|
|
292
|
+
"stash_pending",
|
|
293
|
+
"compute_args_digest",
|
|
221
294
|
# Stability markers
|
|
222
295
|
"stable",
|
|
223
296
|
"beta",
|
|
@@ -261,6 +334,7 @@ __all__ = [
|
|
|
261
334
|
# Sessions
|
|
262
335
|
"SessionStore",
|
|
263
336
|
"SessionMetadata",
|
|
337
|
+
"SessionSearchResult",
|
|
264
338
|
"JsonFileSessionStore",
|
|
265
339
|
"SQLiteSessionStore",
|
|
266
340
|
"RedisSessionStore",
|
|
@@ -277,6 +351,15 @@ __all__ = [
|
|
|
277
351
|
# Knowledge stores (optional deps: redis, supabase)
|
|
278
352
|
# from selectools.knowledge_store_redis import RedisKnowledgeStore
|
|
279
353
|
# from selectools.knowledge_store_supabase import SupabaseKnowledgeStore
|
|
354
|
+
# Knowledge backends (blob persistence between deploys; lazy optional deps)
|
|
355
|
+
"KnowledgeBackend",
|
|
356
|
+
"SupabaseKnowledgeBackend",
|
|
357
|
+
"RedisKnowledgeBackend",
|
|
358
|
+
# Knowledge pre-save sanitizers (beta)
|
|
359
|
+
"PreSaveHook",
|
|
360
|
+
"defang_delimiters",
|
|
361
|
+
"strip_surrogates",
|
|
362
|
+
"dedupe_against",
|
|
280
363
|
# Token estimation
|
|
281
364
|
"TokenEstimate",
|
|
282
365
|
"estimate_tokens",
|
|
@@ -287,6 +370,15 @@ __all__ = [
|
|
|
287
370
|
"InMemoryTripleStore",
|
|
288
371
|
"SQLiteTripleStore",
|
|
289
372
|
"KnowledgeGraphMemory",
|
|
373
|
+
# Unified Memory (tiered memory with auto-promotion)
|
|
374
|
+
"UnifiedMemory",
|
|
375
|
+
"EpisodicMemory",
|
|
376
|
+
"Episode",
|
|
377
|
+
"ImportanceRule",
|
|
378
|
+
"InMemoryKnowledgeStore",
|
|
379
|
+
"RecallResult",
|
|
380
|
+
"DEFAULT_IMPORTANCE_RULES",
|
|
381
|
+
"score_importance",
|
|
290
382
|
# Submodules (for lazy loading)
|
|
291
383
|
"embeddings",
|
|
292
384
|
"observe",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Internal JSON helpers shared across modules.
|
|
2
|
+
|
|
3
|
+
Home for JSON-parsing utilities that multiple subsystems need (orchestration
|
|
4
|
+
supervisor, team-lead and plan-and-execute patterns). Internal — not part of
|
|
5
|
+
the public API.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import json
|
|
11
|
+
import re
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
_JSON_BLOCK_RE = re.compile(r"(\[.*\]|\{.*\})", re.DOTALL)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def safe_json_parse(text: str, default: Any = None) -> Any:
|
|
18
|
+
"""Try to extract and parse JSON from an LLM response.
|
|
19
|
+
|
|
20
|
+
Strips markdown code fences, then attempts a direct parse; falls back to
|
|
21
|
+
extracting the first JSON array or object embedded in surrounding prose.
|
|
22
|
+
Returns *default* when nothing parses.
|
|
23
|
+
"""
|
|
24
|
+
text = text.strip()
|
|
25
|
+
if text.startswith("```"):
|
|
26
|
+
lines = text.splitlines()
|
|
27
|
+
text = "\n".join(lines[1:-1] if lines[-1].strip() == "```" else lines[1:])
|
|
28
|
+
try:
|
|
29
|
+
return json.loads(text)
|
|
30
|
+
except json.JSONDecodeError:
|
|
31
|
+
m = _JSON_BLOCK_RE.search(text)
|
|
32
|
+
if m:
|
|
33
|
+
try:
|
|
34
|
+
return json.loads(m.group(1))
|
|
35
|
+
except json.JSONDecodeError:
|
|
36
|
+
pass
|
|
37
|
+
return default
|