deepintshield 2.7.2__tar.gz → 2.8.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.
- {deepintshield-2.7.2/src/deepintshield.egg-info → deepintshield-2.8.0}/PKG-INFO +257 -83
- {deepintshield-2.7.2 → deepintshield-2.8.0}/README.md +243 -71
- {deepintshield-2.7.2 → deepintshield-2.8.0}/pyproject.toml +11 -11
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/_prompt_cache.py +32 -2
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/strands.py +80 -10
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/registry.py +4 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/client.py +35 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/frameworks/__init__.py +3 -1
- deepintshield-2.8.0/src/deepintshield/frameworks/autogen.py +57 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/frameworks/crewai.py +15 -6
- deepintshield-2.8.0/src/deepintshield/frameworks/google_adk.py +34 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/frameworks/langgraph.py +6 -3
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/frameworks/llamaindex.py +16 -11
- deepintshield-2.8.0/src/deepintshield/frameworks/openai_agents.py +70 -0
- deepintshield-2.8.0/src/deepintshield/frameworks/pydanticai.py +54 -0
- deepintshield-2.8.0/src/deepintshield/frameworks/strands.py +29 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/providers/__init__.py +4 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/providers/bedrock.py +2 -1
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/providers/langchain.py +2 -1
- deepintshield-2.8.0/src/deepintshield/providers/litellm.py +72 -0
- deepintshield-2.8.0/src/deepintshield/providers/openai.py +71 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/providers/pydanticai.py +11 -9
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/transport.py +28 -3
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/types.py +6 -2
- deepintshield-2.8.0/src/deepintshield/version.py +1 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0/src/deepintshield.egg-info}/PKG-INFO +257 -83
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield.egg-info/SOURCES.txt +10 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield.egg-info/requires.txt +13 -11
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_error_contract.py +1 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_new_discovery.py +3 -3
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_workload_headers.py +6 -3
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_genai_contracts.py +31 -6
- deepintshield-2.8.0/tests/test_langchain_model_compatibility.py +131 -0
- deepintshield-2.8.0/tests/test_litellm_model_compatibility.py +102 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_model_compatibility.py +16 -10
- deepintshield-2.8.0/tests/test_multimodal_examples.py +811 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_native_provider_headers.py +73 -1
- deepintshield-2.8.0/tests/test_native_responses_stream_fixtures.py +137 -0
- deepintshield-2.8.0/tests/test_openai_primary.py +179 -0
- deepintshield-2.8.0/tests/test_openai_primary_frameworks.py +212 -0
- deepintshield-2.8.0/tests/test_openai_primary_orchestrators.py +106 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_prompt_cache.py +56 -0
- deepintshield-2.8.0/tests/test_strands_current_terminal.py +90 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_types.py +6 -3
- deepintshield-2.7.2/src/deepintshield/frameworks/autogen.py +0 -37
- deepintshield-2.7.2/src/deepintshield/frameworks/openai_agents.py +0 -51
- deepintshield-2.7.2/src/deepintshield/frameworks/pydanticai.py +0 -54
- deepintshield-2.7.2/src/deepintshield/providers/litellm.py +0 -40
- deepintshield-2.7.2/src/deepintshield/providers/openai.py +0 -47
- deepintshield-2.7.2/src/deepintshield/version.py +0 -1
- {deepintshield-2.7.2 → deepintshield-2.8.0}/LICENSE +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/NOTICE +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/setup.cfg +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/__init__.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/_gemini_cache.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agent.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/__init__.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/actions.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/credentials/__init__.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/credentials/base.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/credentials/entra.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/credentials/oidc.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/credentials/zeroid.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/decorators.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/dpop.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/enforcement.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/engine.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/errors.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/execution.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/gate.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/identity.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/__init__.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/_common.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/autogen.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/crewai.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/google_adk.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/hermes.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/langchain.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/langgraph.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/litellm.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/llamaindex.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/openai_agents.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/openclaw.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/pydanticai.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/integrations/temporal.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/manifest.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/obligations.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/surface.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/agentic/types.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/config.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/errors.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/__init__.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/_errors.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/_native.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/adapters/__init__.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/adapters/_security.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/adapters/anthropic.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/adapters/langchain.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/adapters/openai.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/client.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/mcp/tool.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/providers/anthropic.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/providers/genai.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/providers/langgraph.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/rag.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield/streaming.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield.egg-info/dependency_links.txt +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/src/deepintshield.egg-info/top_level.txt +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agent.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_blueprint_contract.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_callback_inventory.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_credentials.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_execution_lifecycle.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_fail_closed_integrations.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_framework_parity.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_import_lifecycle.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_langchain.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_new_decide.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_agentic_new_enforcement.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_anthropic_transport_compat.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_chat_streaming.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_client.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_config.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_error_catalog.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_error_surfaces.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_errors.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_gemini_cache.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_mcp_native_errors.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_mcp_native_session.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_mcp_preferred_api.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_obligation_contract.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_platform_agentic_workflows.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_platform_rag_workflows.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_providers.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_rag.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_rag_guard.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_rag_redaction.py +0 -0
- {deepintshield-2.7.2 → deepintshield-2.8.0}/tests/test_transport.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepintshield
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.8.0
|
|
4
4
|
Summary: Unified Python SDK for routing chat, RAG, agentic tool-gating, identity, and MCP traffic through DeepintShield - drop-in across the top agentic frameworks.
|
|
5
5
|
Author: DeepintShield
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -15,8 +15,9 @@ License-File: LICENSE
|
|
|
15
15
|
License-File: NOTICE
|
|
16
16
|
Requires-Dist: httpx>=0.28.1
|
|
17
17
|
Requires-Dist: pydantic>=2.0
|
|
18
|
+
Requires-Dist: openai<4,>=2.32.0
|
|
18
19
|
Provides-Extra: openai
|
|
19
|
-
Requires-Dist: openai
|
|
20
|
+
Requires-Dist: openai<4,>=2.32.0; extra == "openai"
|
|
20
21
|
Provides-Extra: anthropic
|
|
21
22
|
Requires-Dist: anthropic>=0.51.0; extra == "anthropic"
|
|
22
23
|
Provides-Extra: bedrock
|
|
@@ -33,24 +34,25 @@ Requires-Dist: langchain-core>=0.3.55; extra == "langgraph"
|
|
|
33
34
|
Requires-Dist: langchain-openai>=0.3.14; extra == "langgraph"
|
|
34
35
|
Requires-Dist: langgraph>=0.4.2; extra == "langgraph"
|
|
35
36
|
Provides-Extra: pydanticai
|
|
36
|
-
Requires-Dist: pydantic-ai
|
|
37
|
+
Requires-Dist: pydantic-ai-slim[openai]<3,>=2.41.0; extra == "pydanticai"
|
|
37
38
|
Provides-Extra: crewai
|
|
38
|
-
Requires-Dist: crewai
|
|
39
|
+
Requires-Dist: crewai[openai]<2,>=1.15.20; extra == "crewai"
|
|
39
40
|
Provides-Extra: openai-agents
|
|
40
|
-
Requires-Dist: openai-agents<1,>=0.
|
|
41
|
-
Requires-Dist: openai>=1.75.0; extra == "openai-agents"
|
|
41
|
+
Requires-Dist: openai-agents<1,>=0.22.1; extra == "openai-agents"
|
|
42
42
|
Requires-Dist: mcp<2,>=1.29; extra == "openai-agents"
|
|
43
43
|
Provides-Extra: llamaindex
|
|
44
|
-
Requires-Dist: llama-index
|
|
44
|
+
Requires-Dist: llama-index-llms-openai-like<1,>=0.8.0; extra == "llamaindex"
|
|
45
|
+
Requires-Dist: llama-index-embeddings-openai-like<1,>=0.4.0; extra == "llamaindex"
|
|
45
46
|
Provides-Extra: autogen
|
|
46
|
-
Requires-Dist: autogen-agentchat
|
|
47
|
-
Requires-Dist: autogen-ext[openai]
|
|
47
|
+
Requires-Dist: autogen-agentchat<1,>=0.7.5; extra == "autogen"
|
|
48
|
+
Requires-Dist: autogen-ext[openai]<1,>=0.7.5; extra == "autogen"
|
|
48
49
|
Provides-Extra: temporal
|
|
49
|
-
Requires-Dist: temporalio
|
|
50
|
+
Requires-Dist: temporalio<2,>=1.32.0; extra == "temporal"
|
|
50
51
|
Provides-Extra: strands
|
|
51
|
-
Requires-Dist: strands-agents
|
|
52
|
+
Requires-Dist: strands-agents[openai]<2,>=1.55.0; extra == "strands"
|
|
52
53
|
Provides-Extra: google-adk
|
|
53
|
-
Requires-Dist: google-adk
|
|
54
|
+
Requires-Dist: google-adk<2,>=1.39.1; extra == "google-adk"
|
|
55
|
+
Requires-Dist: litellm<2,>=1.100.0; extra == "google-adk"
|
|
54
56
|
Provides-Extra: azure
|
|
55
57
|
Requires-Dist: azure-identity>=1.16.0; extra == "azure"
|
|
56
58
|
Provides-Extra: dpop
|
|
@@ -98,14 +100,15 @@ Dynamic: license-file
|
|
|
98
100
|
|
|
99
101
|
Unified Python SDK for DeepIntShield - one import, any provider, any agent framework.
|
|
100
102
|
|
|
101
|
-
Current release: **2.
|
|
103
|
+
Current release: **2.8.0**, aligned with DeepIntShield Server **2.8.0**.
|
|
102
104
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
+
The primary inference client is the native **OpenAI Python SDK**, configured
|
|
106
|
+
for the gateway. One connection serves its 29 provider identities using
|
|
107
|
+
provider-qualified model IDs and each model's supported operations. Native
|
|
108
|
+
agent-framework code remains native (LangGraph, CrewAI,
|
|
105
109
|
OpenAI Agents SDK, LlamaIndex, AutoGen, PydanticAI, Temporal, AWS Strands,
|
|
106
|
-
Google ADK, Hermes Agent, OpenClaw)
|
|
107
|
-
|
|
108
|
-
and agent identity.
|
|
110
|
+
Google ADK, Hermes Agent, OpenClaw). Optional Anthropic, Bedrock and Google GenAI
|
|
111
|
+
facades remain available for applications already using those protocols.
|
|
109
112
|
|
|
110
113
|
You pass a virtual key and base URL, plus a stable `agent_name` — **required**
|
|
111
114
|
for agentic governance, with no default, because the name is the workload's
|
|
@@ -136,12 +139,12 @@ and you're done.
|
|
|
136
139
|
|
|
137
140
|
## Install
|
|
138
141
|
|
|
139
|
-
For a reproducible installation of this release, use `pip install "deepintshield==2.
|
|
142
|
+
For a reproducible installation of this release, use `pip install "deepintshield==2.8.0"`.
|
|
140
143
|
Add the provider and framework extras your application needs:
|
|
141
144
|
|
|
142
145
|
```bash
|
|
143
|
-
pip install deepintshield
|
|
144
|
-
pip install 'deepintshield[openai]'
|
|
146
|
+
pip install deepintshield # includes native OpenAI SDK
|
|
147
|
+
pip install 'deepintshield[openai]' # retained compatibility extra
|
|
145
148
|
pip install 'deepintshield[anthropic]'
|
|
146
149
|
pip install 'deepintshield[anthropic-mcp]' # Anthropic's maintained MCP helpers
|
|
147
150
|
pip install 'deepintshield[bedrock]'
|
|
@@ -161,9 +164,26 @@ pip install 'deepintshield[google-adk]' # Google ADK integration
|
|
|
161
164
|
pip install 'deepintshield[azure]' # azure-identity for Entra agent identity
|
|
162
165
|
pip install 'deepintshield[mcp]' # official MCP Python client
|
|
163
166
|
pip install 'deepintshield[dpop]' # DPoP proof-of-possession for agent tokens
|
|
164
|
-
pip install 'deepintshield[all]' #
|
|
167
|
+
pip install 'deepintshield[all]' # legacy aggregate; see version sets below
|
|
165
168
|
```
|
|
166
169
|
|
|
170
|
+
Install only the framework extras your application uses. Current upstream
|
|
171
|
+
libraries require separate dependency combinations; `[all]` is retained for
|
|
172
|
+
compatibility and does not guarantee that every framework's latest release can
|
|
173
|
+
coexist. These Python 3.13 combinations resolved with `pip check` passing:
|
|
174
|
+
|
|
175
|
+
| Extras installed together | Tested native SDK/framework versions |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| `crewai,llamaindex,langchain,langgraph` | OpenAI 2.54.0; CrewAI 1.15.20; LlamaIndex OpenAI-like LLM 0.8.0 / embeddings 0.4.0; LangChain OpenAI 1.6.1; LangGraph 1.2.11 |
|
|
178
|
+
| `pydanticai,openai-agents,autogen,langchain,langgraph` | OpenAI 3.10.0; PydanticAI slim 2.41.0; OpenAI Agents 0.22.1; AutoGen 0.7.5; LangChain OpenAI 1.6.1; LangGraph 1.2.11 |
|
|
179
|
+
| `strands,google-adk,temporal` | OpenAI 2.54.0; Strands 1.55.0; Google ADK 1.39.1; LiteLLM 1.100.0; Temporal 1.32.0 |
|
|
180
|
+
|
|
181
|
+
CrewAI and the current LlamaIndex OpenAI adapter constrain OpenAI below 3;
|
|
182
|
+
the current PydanticAI and OpenAI Agents versions require OpenAI 3. See the
|
|
183
|
+
[validation report](../validation_reports/2026-09-09/openai-primary/) for exact
|
|
184
|
+
installed distributions, tests and skips. Mocked gateway tests verify native
|
|
185
|
+
serialization and routing; they do not establish live access to every model.
|
|
186
|
+
|
|
167
187
|
## Configure
|
|
168
188
|
|
|
169
189
|
```bash
|
|
@@ -195,9 +215,7 @@ shield = DeepintShield(
|
|
|
195
215
|
|
|
196
216
|
### Gateway provider breadth
|
|
197
217
|
|
|
198
|
-
|
|
199
|
-
Google GenAI. They do not grow one method per gateway provider. OpenAI-compatible
|
|
200
|
-
clients can instead select any of the gateway's **29 built-in provider
|
|
218
|
+
OpenAI-compatible clients select the gateway's **29 built-in provider
|
|
201
219
|
identities** with a provider-qualified model. DeepSeek, Amazon Bedrock Mantle,
|
|
202
220
|
Sarvam AI, and Wafer are now available through that routing surface; operation
|
|
203
221
|
support differs by provider and model.
|
|
@@ -208,8 +226,65 @@ Configuration and capability matrices live in the canonical gateway guides:
|
|
|
208
226
|
[Sarvam AI](../deepintshield_server/docs/providers/supported-providers/sarvam.mdx),
|
|
209
227
|
and [Wafer](../deepintshield_server/docs/providers/supported-providers/wafer.mdx).
|
|
210
228
|
|
|
229
|
+
### Primary native OpenAI client
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
from deepintshield import DeepintShield
|
|
233
|
+
|
|
234
|
+
with DeepintShield.from_env() as shield:
|
|
235
|
+
with shield.openai() as client:
|
|
236
|
+
response = client.chat.completions.create(
|
|
237
|
+
model="anthropic/claude-sonnet-4-5",
|
|
238
|
+
messages=[{"role": "user", "content": "Hello"}],
|
|
239
|
+
)
|
|
240
|
+
print(response.choices[0].message.content)
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
`shield.async_openai()` returns native `AsyncOpenAI` for `async with` and
|
|
244
|
+
`await client.chat.completions.create(...)`. Both clients retain native request
|
|
245
|
+
arguments, response objects, errors, streaming, retries and lifecycle. The
|
|
246
|
+
installed SDK selects its default HTTP implementation. Caller-supplied native
|
|
247
|
+
transports remain supported; existing HTTP event hooks apply where that
|
|
248
|
+
transport exposes them.
|
|
249
|
+
|
|
250
|
+
For applications that construct their own clients, the same connection is
|
|
251
|
+
available as fresh public constructor options:
|
|
252
|
+
|
|
253
|
+
```python
|
|
254
|
+
from openai import OpenAI, AsyncOpenAI
|
|
255
|
+
|
|
256
|
+
client = OpenAI(**shield.openai_config(max_retries=2))
|
|
257
|
+
async_client = AsyncOpenAI(**shield.openai_config())
|
|
258
|
+
# Close each client using its native lifecycle after use.
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Connection preparation reads the existing virtual key and gateway base URL,
|
|
262
|
+
without model discovery or inference requests. The model string is preserved,
|
|
263
|
+
including provider prefixes, deployment names and fine-tuned IDs. Use a model
|
|
264
|
+
enabled by your gateway's credentials and virtual-key policy. Omit optional
|
|
265
|
+
sampling/reasoning settings unless supported by that model; the SDK does not
|
|
266
|
+
invent a universal parameter set.
|
|
267
|
+
|
|
268
|
+
Choose the native operation the model supports: `chat.completions.create`,
|
|
269
|
+
`responses.create`, `embeddings.create`, `audio.speech.create`,
|
|
270
|
+
`audio.transcriptions.create`, `images.generate/edit`, or `videos.create`.
|
|
271
|
+
For example ElevenLabs speech needs an enabled model and an actual voice ID;
|
|
272
|
+
Runway models use image/video operations. A registered provider does not imply
|
|
273
|
+
support for every operation. The gateway provider/model capability metadata
|
|
274
|
+
describes the available operations; SDK construction performs no discovery.
|
|
275
|
+
|
|
276
|
+
The [multimodal examples](examples/multimodal/README.md) provide one native
|
|
277
|
+
OpenAI runner covering all 29 provider identities through supported text or
|
|
278
|
+
media operations. Choose an explicit model, inspect a request with `--dry-run`,
|
|
279
|
+
and see the documented limits for PDF, image, audio, video and uploaded-file
|
|
280
|
+
inspection before using your own files.
|
|
281
|
+
|
|
211
282
|
### Core client (including streaming)
|
|
212
283
|
|
|
284
|
+
`shield.chat()` calls Chat Completions. For GPT-6 Astra, use the
|
|
285
|
+
[OpenAI Responses example below](#openai): Astra tool calling requires Responses,
|
|
286
|
+
including when the gateway adds authorized MCP tools to a request.
|
|
287
|
+
|
|
213
288
|
```python
|
|
214
289
|
from deepintshield import DeepintShield
|
|
215
290
|
|
|
@@ -273,78 +348,55 @@ response = openai.chat.completions.create(
|
|
|
273
348
|
)
|
|
274
349
|
```
|
|
275
350
|
|
|
276
|
-
|
|
351
|
+
For **GPT-6 Astra**, use the same client's native **Responses API**. The gateway
|
|
352
|
+
can inject authorized MCP tools even when your Python call has no `tools`
|
|
353
|
+
argument; Astra requires Responses for tool calling. Changing
|
|
354
|
+
`reasoning_effort` to `none` does not fix a Chat Completions tools error because
|
|
355
|
+
Astra does not support `none`. See the
|
|
356
|
+
[official OpenAI model guidance](https://developers.openai.com/api/docs/guides/latest-model).
|
|
277
357
|
|
|
278
358
|
```python
|
|
279
359
|
response = openai.responses.create(
|
|
280
|
-
model="gpt-
|
|
360
|
+
model="gpt-6-astra",
|
|
281
361
|
input="Explain this design in one sentence.",
|
|
362
|
+
reasoning={"effort": "low"},
|
|
282
363
|
store=False,
|
|
283
364
|
)
|
|
284
365
|
print(response.output_text)
|
|
285
366
|
```
|
|
286
367
|
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
`
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
preserves compatible response state in saved sessions.
|
|
293
|
-
|
|
294
|
-
### Anthropic
|
|
295
|
-
|
|
296
|
-
```python
|
|
297
|
-
anthropic = shield.anthropic()
|
|
298
|
-
response = anthropic.messages.create(
|
|
299
|
-
model="claude-sonnet-5",
|
|
300
|
-
max_tokens=256,
|
|
301
|
-
messages=[{"role": "user", "content": "hello"}],
|
|
302
|
-
)
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
`shield.anthropic()` uses the installed Anthropic SDK's default transport class,
|
|
306
|
-
including SDK releases backed by `httpx2`, and retains automatic prompt-cache
|
|
307
|
-
hooks. A caller-supplied `http_client` must be compatible with that installed SDK
|
|
308
|
-
and remains responsible for its own prompt-cache hooks.
|
|
309
|
-
|
|
310
|
-
### Bedrock
|
|
311
|
-
|
|
312
|
-
```python
|
|
313
|
-
bedrock = shield.bedrock()
|
|
314
|
-
response = bedrock.converse(
|
|
315
|
-
modelId="anthropic.claude-3-sonnet-20240229",
|
|
316
|
-
messages=[{"role": "user", "content": [{"text": "hello"}]}],
|
|
317
|
-
)
|
|
318
|
-
```
|
|
368
|
+
Use `input` for the prompt and `response.output_text` for the generated text.
|
|
369
|
+
Astra accepts reasoning efforts `low`, `medium`, `high`, `xhigh`, and `max`;
|
|
370
|
+
omit `temperature` and `top_p`. If setting a token budget, use
|
|
371
|
+
`max_output_tokens`, which includes reasoning and visible output. Model access
|
|
372
|
+
still depends on your gateway's provider key and virtual-key policy.
|
|
319
373
|
|
|
320
|
-
|
|
374
|
+
Responses streaming yields typed events, rather than Chat Completions chunks:
|
|
321
375
|
|
|
322
376
|
```python
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
377
|
+
with openai.responses.create(
|
|
378
|
+
model="gpt-6-astra",
|
|
379
|
+
input="Explain this design in one sentence.",
|
|
380
|
+
reasoning={"effort": "low"},
|
|
381
|
+
store=False,
|
|
382
|
+
stream=True,
|
|
383
|
+
) as stream:
|
|
384
|
+
for event in stream:
|
|
385
|
+
if event.type == "response.output_text.delta":
|
|
386
|
+
print(event.delta, end="", flush=True)
|
|
387
|
+
print()
|
|
330
388
|
```
|
|
331
389
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
Python callable tools, Google recommends the chat interface. Multi-turn tool
|
|
336
|
-
workflows also depend on the gateway preserving tool roles and thought signatures;
|
|
337
|
-
a successful text-only request does not verify those conversions.
|
|
338
|
-
|
|
339
|
-
The gateway's native Gemini conversion preserves model/user tool roles, per-call
|
|
340
|
-
thought signatures, and distinct IDs for parallel calls to the same function.
|
|
341
|
-
SDK regression tests cover direct and chat calls, sync/async streaming, and
|
|
342
|
-
callable-tool continuations. A timeout-only `http_options` override retains the
|
|
343
|
-
gateway destination in SDK 2.7.2 (fixed in 2.7.1); SDK 2.7.0 does not merge that override correctly.
|
|
390
|
+
Run [examples/openai/responses.py](examples/openai/responses.py) for a complete
|
|
391
|
+
example with optional streaming. Keep the Chat Completions examples for models
|
|
392
|
+
and tool combinations supported on that API.
|
|
344
393
|
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
394
|
+
Responses uses `max_output_tokens` and a `reasoning` object where supported;
|
|
395
|
+
Chat Completions uses its model's supported token-limit field and
|
|
396
|
+
`reasoning_effort`. For manual Responses continuations, retain the full output
|
|
397
|
+
items, including tool calls and opaque reasoning state, and replay them only
|
|
398
|
+
with the same provider and model. The Playground performs this mapping and
|
|
399
|
+
preserves compatible response state in saved sessions.
|
|
348
400
|
|
|
349
401
|
### LangChain
|
|
350
402
|
|
|
@@ -451,12 +503,42 @@ shield = DeepintShield.from_env()
|
|
|
451
503
|
shield.bind("langgraph").model("gpt-4o-mini")
|
|
452
504
|
shield.bind("langgraph").embedder("text-embedding-3-large")
|
|
453
505
|
shield.bind("crewai").llm("gpt-4o-mini")
|
|
454
|
-
shield.bind("openai_agents").
|
|
506
|
+
shield.bind("openai_agents").model("openai/gpt-4o-mini")
|
|
455
507
|
shield.bind("llamaindex").llm("gpt-4o-mini")
|
|
456
508
|
shield.bind("autogen").model_client("gpt-4o-mini")
|
|
457
509
|
shield.bind("pydanticai").model("gpt-4o-mini")
|
|
510
|
+
shield.bind("strands").model("openai/gpt-4o-mini")
|
|
511
|
+
shield.bind("google_adk").model("openai/gpt-4o-mini")
|
|
458
512
|
```
|
|
459
513
|
|
|
514
|
+
| Framework | Public binder | Native behavior/settings |
|
|
515
|
+
| --- | --- | --- |
|
|
516
|
+
| LangChain / LangGraph | `bind("langchain").model(id)` / `.embedder(id)` | `ChatOpenAI` / `OpenAIEmbeddings`; `use_responses_api=True` selects Responses; graph nodes and tools stay native |
|
|
517
|
+
| CrewAI | `bind("crewai").llm(id)` | Native OpenAI implementation with `custom_openai=True` when available; `api="responses"` selects Responses |
|
|
518
|
+
| PydanticAI | `bind("pydanticai").model(id)` | `OpenAIChatModel`; `api="responses"` selects `OpenAIResponsesModel`; caller profile/settings preserved |
|
|
519
|
+
| OpenAI Agents | `bind("openai_agents").model(id)` | `OpenAIChatCompletionsModel`; `api="responses"` selects `OpenAIResponsesModel`; native Agent/Runner |
|
|
520
|
+
| LlamaIndex | `bind("llamaindex").llm(id)` / `.embedder(id)` | `OpenAILike` / `OpenAILikeEmbedding`; supply `context_window` and `is_function_calling_model` from the selected model's capabilities |
|
|
521
|
+
| AutoGen | `bind("autogen").model_client(id)` | `OpenAIChatCompletionClient`; supply `model_info` for tools/vision/structured output; unknown-model default permits text only |
|
|
522
|
+
| Strands | `bind("strands").model(id)` | Native `OpenAIModel`; `client_args` accepts native OpenAI constructor options |
|
|
523
|
+
| Google ADK | `bind("google_adk").model(id)` | ADK's native optional `LiteLlm` connector; ADK owns sessions, agents and tools |
|
|
524
|
+
| Temporal | `shield.async_openai()` inside an activity | Native Workflow/Worker/Activity execution; inference I/O stays outside the deterministic workflow |
|
|
525
|
+
|
|
526
|
+
For broad text interoperability choose Chat Completions; select Responses
|
|
527
|
+
explicitly for a model or tool flow that requires it. A framework may normalize
|
|
528
|
+
OpenAI-standard fields and discard provider extensions. Provider-specific
|
|
529
|
+
features need support in both the gateway conversion and the selected native
|
|
530
|
+
framework adapter. No binder changes existing model choices automatically.
|
|
531
|
+
|
|
532
|
+
These connection patterns follow the public
|
|
533
|
+
[LangChain](https://docs.langchain.com/oss/python/integrations/chat/openai),
|
|
534
|
+
[LangGraph](https://docs.langchain.com/oss/python/langgraph/streaming),
|
|
535
|
+
[CrewAI](https://docs.crewai.com/v1.15.20/en/learn/litellm-removal-guide),
|
|
536
|
+
[PydanticAI](https://ai.pydantic.dev/models/openai/),
|
|
537
|
+
[LlamaIndex](https://developers.llamaindex.ai/python/framework-api-reference/llms/openai_like/),
|
|
538
|
+
[AutoGen](https://microsoft.github.io/autogen/stable/reference/python/autogen_ext.models.openai.html),
|
|
539
|
+
[Strands](https://strandsagents.com/docs/user-guide/concepts/model-providers/openai/),
|
|
540
|
+
and [ADK](https://google.github.io/adk-docs/agents/models/litellm/) interfaces.
|
|
541
|
+
|
|
460
542
|
These binders only route native model or embedding traffic through the gateway.
|
|
461
543
|
They are not required for automatic Agentic tool enforcement.
|
|
462
544
|
|
|
@@ -928,7 +1010,99 @@ the client.
|
|
|
928
1010
|
|
|
929
1011
|
---
|
|
930
1012
|
|
|
1013
|
+
## Optional native provider facades
|
|
1014
|
+
|
|
1015
|
+
These preserve existing native provider protocols. The primary generic inference
|
|
1016
|
+
path above uses the OpenAI SDK across gateway providers. Install only the native
|
|
1017
|
+
extra your application needs.
|
|
1018
|
+
|
|
1019
|
+
### Anthropic
|
|
1020
|
+
|
|
1021
|
+
```python
|
|
1022
|
+
anthropic = shield.anthropic()
|
|
1023
|
+
response = anthropic.messages.create(
|
|
1024
|
+
model="claude-sonnet-5",
|
|
1025
|
+
max_tokens=256,
|
|
1026
|
+
messages=[{"role": "user", "content": "hello"}],
|
|
1027
|
+
)
|
|
1028
|
+
```
|
|
1029
|
+
|
|
1030
|
+
`shield.anthropic()` uses the installed Anthropic SDK's default transport class,
|
|
1031
|
+
including SDK releases backed by `httpx2`, and retains automatic prompt-cache
|
|
1032
|
+
hooks. A caller-supplied `http_client` must be compatible with that installed SDK
|
|
1033
|
+
and remains responsible for its own prompt-cache hooks.
|
|
1034
|
+
|
|
1035
|
+
### Bedrock
|
|
1036
|
+
|
|
1037
|
+
```python
|
|
1038
|
+
bedrock = shield.bedrock()
|
|
1039
|
+
response = bedrock.converse(
|
|
1040
|
+
modelId="anthropic.claude-3-sonnet-20240229",
|
|
1041
|
+
messages=[{"role": "user", "content": [{"text": "hello"}]}],
|
|
1042
|
+
)
|
|
1043
|
+
```
|
|
1044
|
+
|
|
1045
|
+
### Google GenAI
|
|
1046
|
+
|
|
1047
|
+
```python
|
|
1048
|
+
genai = shield.genai()
|
|
1049
|
+
response = genai.models.generate_content(
|
|
1050
|
+
model="gemini-3.5-flash",
|
|
1051
|
+
contents="hello",
|
|
1052
|
+
config={"automatic_function_calling": {"disable": True}},
|
|
1053
|
+
)
|
|
1054
|
+
print(response.text)
|
|
1055
|
+
```
|
|
1056
|
+
|
|
1057
|
+
This text-only call explicitly disables automatic function calling (AFC) because
|
|
1058
|
+
it has no Python tools to execute. Recent Google SDK versions otherwise warn
|
|
1059
|
+
about direct AFC use even without callable tools; a successful response still
|
|
1060
|
+
means inference completed. This is an [upstream Google SDK warning](https://github.com/googleapis/python-genai/issues/2902).
|
|
1061
|
+
When using Python callable tools, use the native chat interface:
|
|
1062
|
+
|
|
1063
|
+
```python
|
|
1064
|
+
def add(a: int, b: int) -> int:
|
|
1065
|
+
"""Add two integers."""
|
|
1066
|
+
return a + b
|
|
1067
|
+
|
|
1068
|
+
chat = genai.chats.create(model="gemini-2.5-flash", config={"tools": [add]})
|
|
1069
|
+
print(chat.send_message("What is 2 plus 3?").text)
|
|
1070
|
+
|
|
1071
|
+
for chunk in chat.send_message_stream("Now add 4 and 5."):
|
|
1072
|
+
print(chunk.text or "", end="")
|
|
1073
|
+
```
|
|
1074
|
+
|
|
1075
|
+
Multi-turn tool
|
|
1076
|
+
workflows also depend on the gateway preserving tool roles and thought signatures;
|
|
1077
|
+
a successful text-only request does not verify those conversions.
|
|
1078
|
+
|
|
1079
|
+
The gateway's native Gemini conversion preserves model/user tool roles, per-call
|
|
1080
|
+
thought signatures, and distinct IDs for parallel calls to the same function.
|
|
1081
|
+
SDK regression tests cover direct and chat calls, sync/async streaming, and
|
|
1082
|
+
callable-tool continuations. A timeout-only `http_options` override retains the
|
|
1083
|
+
gateway destination in SDK 2.8.0 (fixed in 2.7.1); SDK 2.7.0 does not merge that override correctly.
|
|
1084
|
+
|
|
1085
|
+
For streaming, use `genai.models.generate_content_stream(...)` or
|
|
1086
|
+
`chat.send_message_stream(...)` and read each chunk's `text`. The native async
|
|
1087
|
+
interfaces remain available under `genai.aio`.
|
|
1088
|
+
|
|
931
1089
|
## More examples
|
|
932
1090
|
|
|
933
1091
|
See [examples/](https://github.com/deepintai/deepintshield/tree/main/examples) for runnable per-provider chat, RAG, agent, and MCP
|
|
934
1092
|
scripts.
|
|
1093
|
+
|
|
1094
|
+
## Multimodal content inspection
|
|
1095
|
+
|
|
1096
|
+
Native provider SDK integrations remain optional; existing OpenAI SDK clients can
|
|
1097
|
+
use the gateway with `OPENAI_BASE_URL` and `OPENAI_API_KEY` (the virtual key).
|
|
1098
|
+
Provider/model capabilities determine which file, image and media operations work.
|
|
1099
|
+
Routing through the gateway does not guarantee inspection of every binary modality.
|
|
1100
|
+
Supported inline PDF text and image metadata from the last message participate in
|
|
1101
|
+
selected policies; earlier attachments are not generally re-extracted into policy
|
|
1102
|
+
text. PDF inspection-failure checks separately visit all messages. Full-history
|
|
1103
|
+
attachment inspection,
|
|
1104
|
+
pixel OCR, raw audio/video extraction, file-upload content checks and remote
|
|
1105
|
+
file-reference resolution are separate coverage requirements. Dedicated media
|
|
1106
|
+
operation evaluation requires the server's `GUARDRAILS_MULTIMODAL=true` setting.
|
|
1107
|
+
See the [current coverage boundaries](../OPENAI_PRIMARY_DESIGN.md) before relying
|
|
1108
|
+
on full multimodal content protection.
|