Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 14:45 UTC
docs(strict-mode): correct provider support details
jkomyno committed
Aug 27, 2026 at 15:51 UTC
f37c6fbec3ad9f38815a549536809177c089010c
4 files changed
+22
-21
docs/content/docs/providers/openai.mdx
+10
-10
@@ -406,9 +406,17 @@ The OpenAI integration ships three providers, one per API surface:
406
- **`OpenAIProvider`** for the Chat Completions API. This is the SDK default, so `new Composio()` with no provider uses it. You keep the full message list and append each assistant message plus its `tool` results yourself.
407
- **`OpenAIAgentsProvider`** for the Agents SDK. Tools come with execution wired in, so the SDK runs the loop for you.
408
409
-**Strict mode.** Pass `strict: true` or `strict=True` to `OpenAIResponsesProvider`, or pass `strict: true` to `OpenAIAgentsProvider`, to normalize each tool's input schema for [structured outputs](https://platform.openai.com/docs/guides/structured-outputs). Every object lists all of its properties in `required` and is closed, while optional properties stay available but accept `null`. A `null` is dropped before the tool runs unless the tool's own schema accepts `null` for that parameter. Tools whose schema strict mode cannot express, such as objects that accept arbitrary keys, `allOf`, `prefixItems`, or unresolved `$ref`s, are sent without strict mode and log a warning.
409
+**Strict mode.** Pass `strict: true` or `strict=True` to `OpenAIResponsesProvider`, or pass `strict: true` to the TypeScript `OpenAIAgentsProvider`, to normalize each tool's input schema for [structured outputs](https://platform.openai.com/docs/guides/structured-outputs). The Python Agents SDK provider does not support strict mode yet. Every object lists all of its properties in `required` and is closed, while optional properties stay available but accept `null`. A `null` is dropped before the tool runs unless the tool's own schema accepts `null` for that parameter. Tools whose schema strict mode cannot express, such as objects that accept arbitrary keys, `allOf`, `prefixItems`, or unresolved `$ref`s, are sent without strict mode and log a warning.
410
411
-<Tabs items={["TypeScript", "Python"]}>
411
+<Tabs groupId="language" items={["Python", "TypeScript"]} persist>
412
+<Tab value="Python">
413
+```python
414
+from composio import Composio
415
+from composio_openai import OpenAIResponsesProvider
416
+
417
+composio = Composio(provider=OpenAIResponsesProvider(strict=True))
418
+```
419
+</Tab>
420
<Tab value="TypeScript">
421
```typescript
422
// @noErrors
@@ -420,14 +428,6 @@ const composio = new Composio({
428
});
429
```
430
</Tab>
423
-<Tab value="Python">
424
-```python
425
-from composio import Composio
426
-from composio_openai import OpenAIResponsesProvider
427
-
428
-composio = Composio(provider=OpenAIResponsesProvider(strict=True))
429
-```
430
-</Tab>
431
</Tabs>
432
433
<Callout type="info">
python/composio/core/provider/_openai_responses.py
+4
-4
@@ -43,15 +43,15 @@ class OpenAIResponsesProvider(
43
:param strict: Emit wrapped tools with ``strict: true`` and normalize
44
their parameter schemas for OpenAI structured outputs (every object
45
fully required and closed, optional properties widened to accept
46
- ``null``, ``$ref``/``$defs`` inlined). Mirrors the TypeScript
46
+ ``null``, local ``$ref``/``$defs`` kept). Mirrors the TypeScript
47
``OpenAIResponsesProvider({ strict })`` option. Defaults to
48
``False``.
49
"""
50
super().__init__(**kwargs)
51
self.strict = strict
52
- # Dereferenced parameter schemas of the tools wrapped under strict
53
- # mode, keyed by slug, so tool-call arguments can be reconciled
54
- # against the schema the model actually saw.
52
+ # Parameter schemas of the tools wrapped under strict mode, keyed by
53
+ # slug, so tool-call arguments can be reconciled against the schema
54
+ # the model actually saw.
55
self._strict_input_schemas: dict[str, dict[str, t.Any]] = {}
56
57
def wrap_tool(self, tool: Tool) -> ResponsesTool:
python/composio/utils/strict_schema.py
+5
-4
@@ -360,10 +360,11 @@ def to_strict_json_schema(schema: t.Any) -> StrictJsonSchemaResult:
360
Applies the strict contract at every depth: every object lists all of its
361
properties in ``required`` and is closed; optional properties are widened
362
to accept ``null`` instead of being dropped; ``oneOf`` becomes ``anyOf``;
363
- ``default`` and ``examples`` are stripped; internal ``$ref`` pointers are
364
- inlined first and ``required`` arrays are de-duplicated last. Constructs
365
- strict mode cannot express are listed in ``unsupported``; when that list
366
- is non-empty the returned ``schema`` must not be sent as strict.
363
+ ``default`` and ``examples`` are stripped; local ``$ref`` pointers into
364
+ ``$defs`` or ``definitions`` are kept and the definitions are normalized
365
+ where they are declared; ``required`` arrays are de-duplicated last.
366
+ Constructs strict mode cannot express are listed in ``unsupported``; when
367
+ that list is non-empty the returned ``schema`` must not be sent as strict.
368
369
:param schema: The JSON schema to normalize; never mutated.
370
:return: A :class:`StrictJsonSchemaResult`.
ts/packages/providers/openai/src/OpenAIResponsesProvider.ts
+3
-3
@@ -55,9 +55,9 @@ export class OpenAIResponsesProvider extends BaseNonAgenticProvider<
55
readonly name = 'openai';
56
private strict: boolean | null;
57
/**
58
- * Dereferenced parameter schemas of the tools wrapped under strict mode,
59
- * keyed by slug, so tool-call arguments can be reconciled against the
60
- * schema the model actually saw.
58
+ * Parameter schemas of the tools wrapped under strict mode, keyed by slug,
59
+ * so tool-call arguments can be reconciled against the schema the model
60
+ * actually saw.
61
*/
62
private readonly strictInputSchemas = new Map<string, Record<string, unknown>>();
63