Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ members = [
"python/providers/crewai",
"python/providers/gemini",
"python/providers/google",
"python/providers/google_adk",
"python/providers/langchain",
"python/providers/openai",
"python/providers/openai_agents",
"fern",
"fern/snippets/migration"
"fern/snippets/migration",
"fern"
]

[tool.uv.sources]
Expand All @@ -19,11 +20,12 @@ composio = { workspace = true }
# Provider packages
composio-anthropic = { workspace = true }
composio-crewai = { workspace = true }
composio-langchain = { workspace = true }
composio-gemini = { workspace = true }
composio-google = { workspace = true }
composio-langchain = { workspace = true }
composio-google-adk = { workspace = true }
composio-openai = { workspace = true }
composio-openai-agents = { workspace = true }

# Fern packages
fern = { workspace = true }
fern = { workspace = true }
70 changes: 7 additions & 63 deletions python/config/mypy.ini
Original file line number Diff line number Diff line change
@@ -1,79 +1,23 @@
[mypy]
exclude=apps/composio|utils|\.nox|.*/setup\.py|.*/build/.*
strict_optional=True
exclude=apps/composio|utils|\.nox
disable_error_code=var-annotated

[mypy-jsonref.*]
ignore_missing_imports=true

[mypy-pytest.*]
ignore_missing_imports=true

[mypy-e2b.*]
ignore_missing_imports=true

[mypy-boto3.*]
ignore_missing_imports=true

[mypy-apscheduler.*]
ignore_missing_imports=true

[mypy-instructor.*]
ignore_missing_imports=true

[mypy-googleapiclient.*]
ignore_missing_imports=true

[mypy-botocore.*]
ignore_missing_imports=true

[mypy-requests_toolbelt.*]
ignore_missing_imports=true

[mypy-composio_openai.*]
ignore_missing_imports=true

[mypy-pg8000.*]
ignore_missing_imports=true

[mypy-e2b_code_interpreter.*]
ignore_missing_imports=true

[mypy-composio_langgraph.*]
ignore_missing_imports=true

[mypy-semver.*]
ignore_missing_imports=true

[mypy-redis.*]
ignore_missing_imports=true

[mypy-yaml.*]
ignore_missing_imports=true

[mypy-dateutil.*]
ignore_missing_imports=true

; Only add packages which does not have type-stub package
[mypy-pysher.*]
ignore_missing_imports=true

[mypy-httpx.*]
ignore_missing_imports=true

[mypy-openai.*]
ignore_missing_imports=true

[mypy-pydantic.*]
[mypy-crewai.*]
ignore_missing_imports=true

[mypy-fastapi.*]
[mypy-vertexai.*]
ignore_missing_imports=true

[mypy-requests.*]
[mypy-google.adk.*]
ignore_missing_imports=true

[mypy-tomli.*]
[mypy-google.genai.*]
ignore_missing_imports=true

[mypy-click.*]
[mypy-proto.marshal.collections.maps]
ignore_missing_imports=true
2 changes: 1 addition & 1 deletion python/examples/fastapi_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ def authorize_app(toolkit: str):
user_id=user_id,
auth_config_id=auth_config_id,
)
return RedirectResponse(url=connection_request.redirect_url)
return RedirectResponse(url=connection_request.redirect_url) # type: ignore
32 changes: 27 additions & 5 deletions python/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,32 @@

nox.options.default_venv_backend = "uv"

# TODO: Add providers
modules = ["composio/", "tests/", "examples/", "scripts/"]

ruff = ["ruff", "--config", "config/ruff.toml"]
modules = [
"composio/",
"providers/",
"tests/",
"examples/",
"scripts/",
]

type_stubs = [
"types-requests",
"types-protobuf",
"anthropic",
"crewai",
"semver",
"fastapi",
"langchain",
"openai-agents",
"langchain-openai",
"google-cloud-aiplatform",
]

ruff = [
"ruff",
"--config",
"config/ruff.toml",
]


@nox.session
Expand All @@ -21,7 +43,7 @@ def fmt(session: Session):
@nox.session
def chk(session: Session):
"""Check for linter and type issues"""
session.install(".", "ruff", "mypy==1.13.0", ".")
session.install(".", "ruff", "mypy==1.13.0", *type_stubs)
session.run(*ruff, "check", *modules)
for module in modules:
session.run("mypy", "--config-file", "config/mypy.ini", module)
Expand Down
3 changes: 1 addition & 2 deletions python/providers/anthropic/anthropic_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
"""

import anthropic

from composio import Composio
from composio_anthropic import AnthropicProvider

from composio import Composio

# Initialize tools.
anthropic_client = anthropic.Anthropic()
Expand Down
5 changes: 1 addition & 4 deletions python/providers/anthropic/composio_anthropic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from composio_anthropic.provider import AnthropicProvider


__all__ = (
"AnthropicProvider",
)
__all__ = ("AnthropicProvider",)
9 changes: 4 additions & 5 deletions python/providers/anthropic/composio_anthropic/provider.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import typing as t

from anthropic.types.tool_use_block import ToolUseBlock
from anthropic.types.tool_param import ToolParam
from anthropic.types.message import Message as ToolsBetaMessage
from anthropic.types.beta.beta_tool_use_block import BetaToolUseBlock

from anthropic.types.message import Message as ToolsBetaMessage
from anthropic.types.tool_param import ToolParam
from anthropic.types.tool_use_block import ToolUseBlock

from composio.core.provider import NonAgenticProvider
from composio.types import Modifiers, Tool, ToolExecutionResponse
Expand Down Expand Up @@ -58,7 +57,7 @@ def handle_tool_calls(
"""
Handle tool calls from Anthropic Claude chat completion object.

:param response: Chat completion object from
:param response: Chat completion object from
`anthropic.Anthropic.beta.tools.messages.create` function call.
:param user_id: User ID to use for executing function calls.
:param modifiers: Modifiers to use for executing function calls.
Expand Down
Empty file.
4 changes: 0 additions & 4 deletions python/providers/anthropic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ dependencies = [

[project.urls]
Homepage = "https://github.com/ComposioHQ/composio"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
1 change: 0 additions & 1 deletion python/providers/anthropic/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from setuptools import setup


setup(
name="composio_anthropic",
version="1.0.0-rc5",
Expand Down
2 changes: 1 addition & 1 deletion python/providers/crewai/composio_crewai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from composio_crewai.providers import CrewAIProvider

__all__ = ("CrewAIProvider",)
__all__ = ("CrewAIProvider",)
4 changes: 0 additions & 4 deletions python/providers/crewai/composio_crewai/providers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import typing as t

import pydantic
import pydantic.error_wrappers
import typing_extensions as te
from crewai.tools import BaseTool


from composio.core.provider import AgenticProvider, AgenticProviderExecuteFn
from composio.types import Tool
from composio.utils.pydantic import parse_pydantic_error
Expand All @@ -25,7 +22,6 @@ def wrap_tool(
"""Wrap a tool as a CrewAI tool."""

class Wrapper(BaseTool):

def _run(self, **kwargs):
try:
return execute_tool(slug=tool.slug, arguments=kwargs)
Expand Down
Empty file.
5 changes: 1 addition & 4 deletions python/providers/crewai/crewai_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,11 @@
CrewAI demo.
"""

import os

from composio_crewai import CrewAIProvider
from crewai import Agent, Crew, Task
from langchain_openai import ChatOpenAI

from composio import Composio
from composio_crewai import CrewAIProvider


# Initialize tools.
openai_client = ChatOpenAI()
Expand Down
4 changes: 0 additions & 4 deletions python/providers/crewai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ dependencies = [

[project.urls]
Homepage = "https://github.com/ComposioHQ/composio"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
1 change: 1 addition & 0 deletions python/providers/crewai/setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Setup configuration for the composio crewai toolset"""

from pathlib import Path

from setuptools import setup

setup(
Expand Down
5 changes: 1 addition & 4 deletions python/providers/gemini/composio_gemini/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from .provider import GeminiProvider


__all__ = (
"GeminiProvider",
)
__all__ = ("GeminiProvider",)
Empty file.
3 changes: 1 addition & 2 deletions python/providers/gemini/gemini_demo.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
from composio import Composio
from composio_gemini import GeminiProvider

from google import genai
from google.genai import types

from composio import Composio

# Create composio client
composio = Composio(provider=GeminiProvider())
Expand Down
4 changes: 0 additions & 4 deletions python/providers/gemini/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ dependencies = [

[project.urls]
Homepage = "https://github.com/ComposioHQ/composio"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
1 change: 0 additions & 1 deletion python/providers/gemini/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from setuptools import setup


setup(
name="composio_gemini",
version="1.0.0-rc5",
Expand Down
5 changes: 1 addition & 4 deletions python/providers/google/composio_google/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from composio_google.provider import GoogleProvider


__all__ = (
"GoogleProvider",
)
__all__ = ("GoogleProvider",)
1 change: 0 additions & 1 deletion python/providers/google/composio_google/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
FunctionDeclaration,
GenerationResponse,
Part,
Tool,
)

from composio.core.provider import NonAgenticProvider
Expand Down
Empty file.
3 changes: 1 addition & 2 deletions python/providers/google/google_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"""

import dotenv

from composio import Composio
from composio_google import GoogleProvider
from vertexai.generative_models import GenerativeModel

from composio import Composio

# Load environment variables from .env
dotenv.load_dotenv()
Expand Down
4 changes: 0 additions & 4 deletions python/providers/google/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ dependencies = [

[project.urls]
Homepage = "https://github.com/ComposioHQ/composio"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
5 changes: 1 addition & 4 deletions python/providers/google/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

from setuptools import setup


setup(
name="composio_google",
version="1.0.0-rc5",
Expand All @@ -22,8 +21,6 @@
"Operating System :: OS Independent",
],
python_requires=">=3.9,<4",
install_requires=[
"google-cloud-aiplatform>=1.38.0",
],
install_requires=["google-cloud-aiplatform>=1.38.0", "vertexai"],
include_package_data=True,
)
2 changes: 2 additions & 0 deletions python/providers/google_adk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Composio Provider For Google ADK

3 changes: 3 additions & 0 deletions python/providers/google_adk/composio_google_adk/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .provider import GoogleAdkProvider

__all__ = ("GoogleAdkProvider",)
Loading
Loading