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 22, 19:30 UTC
Fix checks
haxzie committed
Sep 30, 2025 at 13:13 UTC
a192ba648956cdc8e05102bc3044ed3459faa9ef
3 files changed
+12
-7
python/composio/sdk.py
+1
-1
@@ -55,7 +55,7 @@ class Composio(t.Generic[TProvider], WithLogger):
55
"""
56
57
tools: Tools[TProvider]
58
- experimental: ExperimentalNamespace[TProvider]
58
+ experimental: ExperimentalNamespace
59
60
def __init__(
61
self,
python/composio/utils/shared.py
+9
-5
@@ -54,16 +54,20 @@ def json_schema_to_pydantic_type(
54
# Handle oneOf schemas first
55
if "oneOf" in json_schema:
56
one_of_options = json_schema["oneOf"]
57
- pydantic_types: t.List[t.Type] = [ # type: ignore
57
+ pydantic_types = [
58
json_schema_to_pydantic_type(option) for option in one_of_options
59
]
60
- if len(pydantic_types) == 1:
61
- return pydantic_types[0]
60
+ # Filter out None values and ensure we have valid types
61
+ valid_types = [ptype for ptype in pydantic_types if ptype is not None]
62
+ if len(valid_types) == 1:
63
+ return valid_types[0]
64
+ if len(valid_types) == 0:
65
+ return str # fallback to string type
66
# Create Union with any number of types
67
# Cast all types and use functools.reduce to create proper Union
64
- cast_types = [t.cast(t.Type, ptype) for ptype in pydantic_types]
68
+ cast_types = [t.cast(t.Type, ptype) for ptype in valid_types]
69
# Use reduce to create Union[Type1, Type2, ...] properly
66
- return reduce(lambda a, b: t.Union[a, b], cast_types)
70
+ return reduce(lambda a, b: t.Union[a, b], cast_types) # type: ignore
71
72
# Add fallback type - string
73
if "type" not in json_schema:
python/config/mypy.ini
+2
-1
@@ -1,8 +1,9 @@
1
[mypy]
2
-exclude=apps/composio|utils|\.nox|.*/setup\.py|.*/build/.*
2
+exclude = ^(apps/composio/|utils/|\.nox/|.*/setup\.py|.*/build/|examples/)
3
strict_optional=True
4
disable_error_code=var-annotated
5
6
+
7
; Only add packages which does not have type-stub package
8
[mypy-pysher.*]
9
ignore_missing_imports=true