Metadata-Version: 2.2
Name: gl-connectors-tools-binary
Version: 0.0.8b1
Summary: Framework-agnostic tool SDK for GLLM Core, LangChain, and ADK
Requires-Python: <3.14,>=3.11
Description-Content-Type: text/markdown
Requires-Dist: pydantic>=2.0.0
Requires-Dist: python-dateutil>=2.8.0
Provides-Extra: gllm
Requires-Dist: gllm-core-binary>=0.4.15; extra == "gllm"
Provides-Extra: langchain
Requires-Dist: langchain-core<2.0.0,>=1.0.0; extra == "langchain"
Provides-Extra: adk
Requires-Dist: google-genai>=0.1.0; extra == "adk"
Provides-Extra: all
Requires-Dist: gllm-core-binary[langchain]>=0.4.15; extra == "all"
Requires-Dist: langchain-core<2.0.0,>=1.0.0; extra == "all"
Requires-Dist: google-genai>=0.1.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.24.0; extra == "dev"
Requires-Dist: coverage>=7.0.0; extra == "dev"
Requires-Dist: httpx>=0.27.0; extra == "dev"
Requires-Dist: pytest-httpx>=0.30.0; extra == "dev"
Requires-Dist: ruff>=0.14.9; extra == "dev"
Requires-Dist: pytest-cov>=7.0.0; extra == "dev"
Requires-Dist: pre-commit<4.0.0,>=3.6.2; extra == "dev"
Requires-Dist: mypy<2.0.0,>=1.11.2; extra == "dev"

# GL Connectors Tool SDK

Framework-agnostic tool SDK for building tools that work with **GLLM Core**, **LangChain**, and **Google ADK**.

## Installation

(Alternative to `uv add` would be `pip install`)

```bash
# Core SDK only
uv add gl-connectors-tools

# With GLLM Core support
uv add gl-connectors-tools[gllm]

# With LangChain support
uv add gl-connectors-tools[langchain]

# With Google ADK Support
uv add gl-connectors-tools[adk]

# With all frameworks
uv add gl-connectors-tools[all]
```

## Quick Start

### Creating a Tool

```python
from pydantic import BaseModel, Field
from gl_connectors_tools.tools import BaseTool


class SearchInput(BaseModel):
    query: str = Field(description="Search query")
    max_results: int = Field(default=10, description="Maximum results to return")


class SearchTool(BaseTool):
    name = "search"
    description = "Searches for information"
    input_schema = SearchInput

    def run(self, query: str, max_results: int = 10) -> str:
        # Your implementation here
        return f"Found {max_results} results for: {query}"
```

### Using with Different Frameworks

```python
from gl_connectors_tools.adapters import (
    to_gllm_tool,      # GLLM Core
    to_langchain_tool,  # LangChain
    to_adk_function,    # Google ADK
)

tool = SearchTool()

# Convert to GLLM Core Tool
gllm_tool = to_gllm_tool(tool)

# Convert to LangChain StructuredTool
lc_tool = to_langchain_tool(tool)

# Convert to ADK FunctionDeclaration
func_decl, callable_fn = to_adk_function(tool)
```

## Migrating from LangChain (Zero-Change!)

**Just change the import.** The SDK accepts LangChain naming conventions out of the box:

```diff
- from langchain_core.tools import BaseTool
+ from gl_connectors_tools.tools import BaseTool

  class MyTool(BaseTool):
      name = "my_tool"
      description = "..."
      args_schema = MyInput      # ✅ Works as-is!

      def _run(self, **kwargs):  # ✅ Works as-is!
          # implementation unchanged
```

The SDK supports both naming conventions:

| LangChain Style | SDK Style |
|-----------------|-----------|
| `args_schema`   | `input_schema` |
| `_run()`        | `run()` |
| `_arun()`       | `arun()` |

### Alternative: Wrapper for Existing Instances

If you have existing LangChain tool *instances* you can't modify:

```python
from gl_connectors_tools.adapters.langchain import LangChainToolWrapper

# Existing LangChain tool instance
from my_app.tools import MyLangChainTool

# Wrap it
sdk_tool = LangChainToolWrapper(MyLangChainTool())

# Now use it with any adapter
gllm_tool = to_gllm_tool(sdk_tool)
```

## Predefined Tools

```python
from gl_connectors_tools.predefined import TimeTool

tool = TimeTool()
result = tool.run(timezone="Asia/Jakarta")
```

## Architecture

```
┌─────────────────────────────────────────────────┐
│               Your SDK Tools                     │
│         (inherit from BaseTool)                  │
└─────────────────────────────────────────────────┘
                      │
        ┌─────────────┼─────────────┐
        ▼             ▼             ▼
   ┌─────────┐  ┌─────────┐  ┌─────────┐
   │  GLLM   │  │LangChain│  │   ADK   │
   │ Adapter │  │ Adapter │  │ Adapter │
   └─────────┘  └─────────┘  └─────────┘
```

The SDK owns the tool interface. Frameworks become output adapters, not the source of truth.
