Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

next
py 31 lines 936 Bytes
Raw
1 from __future__ import annotations
2
3 import typing as t
4
5 from composio.client.types import Tool
6 from composio.core.provider.base import BaseProvider, TTool, TToolCollection
7
8
9 class NonAgenticProvider(BaseProvider[TTool, TToolCollection]):
10 """
11 Base class for all non-agentic providers, such as `openai` This class is not
12 meant to be used directly, but rather to be extended by concrete implementations
13 This version doesn't have the execute_tool_fn for `wrap_tool` and `wrap_tools`
14 """
15
16 def __init_subclass__(cls, name: str) -> None:
17 cls.name = name
18
19 def wrap_tool(
20 self,
21 tool: Tool,
22 ) -> TTool:
23 """Wrap a tool in the provider-specific format"""
24 raise NotImplementedError
25
26 def wrap_tools(
27 self,
28 tools: t.Sequence[Tool],
29 ) -> TToolCollection:
30 """Wrap a list of tools in the provider-specific format"""
31 raise NotImplementedError