metorial


Namemetorial JSON
Version 1.0.0rc3 PyPI version JSON
download
home_pageNone
SummaryPython SDK for Metorial - AI-powered tool calling and session management
upload_time2025-07-26 12:37:24
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT
keywords ai anthropic chat completions llm mcp metorial model-context-protocol openai sessions tools
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # metorial

The main Python client for Metorial - The open source integration platform for agentic AI. This is the primary package that provides the core client and session management functionality.

## Installation

```bash
pip install metorial
# or
uv add metorial
# or
poetry add metorial
```

## Features

- 🔧 **Multi-Provider Support**: Use the same tools across different AI providers
- 🚀 **Easy Integration**: Simple async/await interface
- 📡 **Session Management**: Automatic session lifecycle handling
- 🛠️ **Tool Discovery**: Automatic tool detection and formatting
- 🔄 **Format Conversion**: Provider-specific tool format conversion

## Supported Providers

- ✅ OpenAI (GPT-4, GPT-3.5)
- ✅ Anthropic (Claude)
- ✅ Google (Gemini)
- ✅ Mistral AI
- ✅ DeepSeek
- ✅ Together AI
- ✅ XAI (Grok)

## Usage

### Basic Usage

```python
import asyncio
from metorial import Metorial

async def main():
    # Initialize Metorial client
    metorial = Metorial(api_key="your-metorial-api-key")
    
    # Create session with your server deployments
    async with metorial.session(["your-server-deployment-id"]) as session:
        # Access tool manager
        tool_manager = session.tool_manager
        
        # Use with provider-specific packages
        # See provider packages for specific integrations

asyncio.run(main())
```

### With Provider Packages

Use metorial with provider-specific packages:

```python
import asyncio
from metorial import Metorial
from metorial_openai import MetorialOpenAISession
from openai import OpenAI

async def main():
    # Initialize clients
    metorial = Metorial(api_key="your-metorial-api-key")
    openai_client = OpenAI(api_key="your-openai-api-key")
    
    # Create session
    async with metorial.session(["deployment-id"]) as session:
        # Use with OpenAI
        openai_session = MetorialOpenAISession(session.tool_manager)
        
        response = openai_client.chat.completions.create(
            model="gpt-4",
            messages=[{"role": "user", "content": "Help me"}],
            tools=openai_session.tools
        )
        
        # Handle tool calls
        if response.choices[0].message.tool_calls:
            tool_responses = await openai_session.call_tools(
                response.choices[0].message.tool_calls
            )

asyncio.run(main())
```

## API Reference

### `Metorial`

Main client class for Metorial.

```python
client = Metorial(api_key="your-api-key")
```

**Parameters:**
- `api_key`: Your Metorial API key

**Methods:**
- `async session(deployment_ids)`: Create a session with specified deployments

### Session Context Manager

```python
async with metorial.session(["deployment-id"]) as session:
    # session.tool_manager provides access to tools
```

**Properties:**
- `tool_manager`: Manager for executing tools

## Provider Integration

This package works with provider-specific packages:

- `metorial-openai`: OpenAI integration
- `metorial-anthropic`: Anthropic (Claude) integration  
- `metorial-google`: Google (Gemini) integration
- `metorial-mistral`: Mistral AI integration
- `metorial-xai`: XAI (Grok) integration
- `metorial-deepseek`: DeepSeek integration
- `metorial-togetherai`: Together AI integration

## Error Handling

```python
from metorial import MetorialAPIError

try:
    async with metorial.session(["deployment-id"]) as session:
        # Your code here
        pass
except MetorialAPIError as e:
    print(f"API Error: {e.message} (Status: {e.status})")
except Exception as e:
    print(f"Unexpected error: {e}")
```

## Configuration

### Environment Variables

You can also configure the client using environment variables:

```bash
export METORIAL_API_KEY="your-api-key"
```

```python
# Will use METORIAL_API_KEY if no api_key provided
metorial = Metorial()
```

## Dependencies

- `metorial-core>=1.0.0`
- `metorial-mcp-session>=1.0.0`
- `typing-extensions>=4.0.0`

## License

MIT License - see [LICENSE](../../LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "metorial",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ai, anthropic, chat, completions, llm, mcp, metorial, model-context-protocol, openai, sessions, tools",
    "author": null,
    "author_email": "Metorial Team <support@metorial.com>",
    "download_url": "https://files.pythonhosted.org/packages/74/39/0b5ab59150fe357ee93eb7efe8453112485a81633db124fc0a3644f44c19/metorial-1.0.0rc3.tar.gz",
    "platform": null,
    "description": "# metorial\n\nThe main Python client for Metorial - The open source integration platform for agentic AI. This is the primary package that provides the core client and session management functionality.\n\n## Installation\n\n```bash\npip install metorial\n# or\nuv add metorial\n# or\npoetry add metorial\n```\n\n## Features\n\n- \ud83d\udd27 **Multi-Provider Support**: Use the same tools across different AI providers\n- \ud83d\ude80 **Easy Integration**: Simple async/await interface\n- \ud83d\udce1 **Session Management**: Automatic session lifecycle handling\n- \ud83d\udee0\ufe0f **Tool Discovery**: Automatic tool detection and formatting\n- \ud83d\udd04 **Format Conversion**: Provider-specific tool format conversion\n\n## Supported Providers\n\n- \u2705 OpenAI (GPT-4, GPT-3.5)\n- \u2705 Anthropic (Claude)\n- \u2705 Google (Gemini)\n- \u2705 Mistral AI\n- \u2705 DeepSeek\n- \u2705 Together AI\n- \u2705 XAI (Grok)\n\n## Usage\n\n### Basic Usage\n\n```python\nimport asyncio\nfrom metorial import Metorial\n\nasync def main():\n    # Initialize Metorial client\n    metorial = Metorial(api_key=\"your-metorial-api-key\")\n    \n    # Create session with your server deployments\n    async with metorial.session([\"your-server-deployment-id\"]) as session:\n        # Access tool manager\n        tool_manager = session.tool_manager\n        \n        # Use with provider-specific packages\n        # See provider packages for specific integrations\n\nasyncio.run(main())\n```\n\n### With Provider Packages\n\nUse metorial with provider-specific packages:\n\n```python\nimport asyncio\nfrom metorial import Metorial\nfrom metorial_openai import MetorialOpenAISession\nfrom openai import OpenAI\n\nasync def main():\n    # Initialize clients\n    metorial = Metorial(api_key=\"your-metorial-api-key\")\n    openai_client = OpenAI(api_key=\"your-openai-api-key\")\n    \n    # Create session\n    async with metorial.session([\"deployment-id\"]) as session:\n        # Use with OpenAI\n        openai_session = MetorialOpenAISession(session.tool_manager)\n        \n        response = openai_client.chat.completions.create(\n            model=\"gpt-4\",\n            messages=[{\"role\": \"user\", \"content\": \"Help me\"}],\n            tools=openai_session.tools\n        )\n        \n        # Handle tool calls\n        if response.choices[0].message.tool_calls:\n            tool_responses = await openai_session.call_tools(\n                response.choices[0].message.tool_calls\n            )\n\nasyncio.run(main())\n```\n\n## API Reference\n\n### `Metorial`\n\nMain client class for Metorial.\n\n```python\nclient = Metorial(api_key=\"your-api-key\")\n```\n\n**Parameters:**\n- `api_key`: Your Metorial API key\n\n**Methods:**\n- `async session(deployment_ids)`: Create a session with specified deployments\n\n### Session Context Manager\n\n```python\nasync with metorial.session([\"deployment-id\"]) as session:\n    # session.tool_manager provides access to tools\n```\n\n**Properties:**\n- `tool_manager`: Manager for executing tools\n\n## Provider Integration\n\nThis package works with provider-specific packages:\n\n- `metorial-openai`: OpenAI integration\n- `metorial-anthropic`: Anthropic (Claude) integration  \n- `metorial-google`: Google (Gemini) integration\n- `metorial-mistral`: Mistral AI integration\n- `metorial-xai`: XAI (Grok) integration\n- `metorial-deepseek`: DeepSeek integration\n- `metorial-togetherai`: Together AI integration\n\n## Error Handling\n\n```python\nfrom metorial import MetorialAPIError\n\ntry:\n    async with metorial.session([\"deployment-id\"]) as session:\n        # Your code here\n        pass\nexcept MetorialAPIError as e:\n    print(f\"API Error: {e.message} (Status: {e.status})\")\nexcept Exception as e:\n    print(f\"Unexpected error: {e}\")\n```\n\n## Configuration\n\n### Environment Variables\n\nYou can also configure the client using environment variables:\n\n```bash\nexport METORIAL_API_KEY=\"your-api-key\"\n```\n\n```python\n# Will use METORIAL_API_KEY if no api_key provided\nmetorial = Metorial()\n```\n\n## Dependencies\n\n- `metorial-core>=1.0.0`\n- `metorial-mcp-session>=1.0.0`\n- `typing-extensions>=4.0.0`\n\n## License\n\nMIT License - see [LICENSE](../../LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for Metorial - AI-powered tool calling and session management",
    "version": "1.0.0rc3",
    "project_urls": {
        "Changelog": "https://github.com/metorial/metorial-enterprise/blob/main/CHANGELOG.md",
        "Documentation": "https://metorial.com/docs",
        "Homepage": "https://metorial.com",
        "Repository": "https://github.com/metorial/metorial-enterprise"
    },
    "split_keywords": [
        "ai",
        " anthropic",
        " chat",
        " completions",
        " llm",
        " mcp",
        " metorial",
        " model-context-protocol",
        " openai",
        " sessions",
        " tools"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2eb464c9e4479485bbb30af6ba0cd6c813a3c7758dc75378f7fef6d26d894a83",
                "md5": "40c2b8ca79e4628bcddb6052e82a985d",
                "sha256": "95413548cec23e27075e2ad05ce059e4a1e1c1075da7165e4df7771925276a0c"
            },
            "downloads": -1,
            "filename": "metorial-1.0.0rc3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "40c2b8ca79e4628bcddb6052e82a985d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4125,
            "upload_time": "2025-07-26T12:37:22",
            "upload_time_iso_8601": "2025-07-26T12:37:22.343690Z",
            "url": "https://files.pythonhosted.org/packages/2e/b4/64c9e4479485bbb30af6ba0cd6c813a3c7758dc75378f7fef6d26d894a83/metorial-1.0.0rc3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "74390b5ab59150fe357ee93eb7efe8453112485a81633db124fc0a3644f44c19",
                "md5": "c31f712d12995cf026dd00821f01105b",
                "sha256": "727c77e7b2b7072aa85959c8a3110624e988c0d15ec43d401242c69590b83403"
            },
            "downloads": -1,
            "filename": "metorial-1.0.0rc3.tar.gz",
            "has_sig": false,
            "md5_digest": "c31f712d12995cf026dd00821f01105b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 5605,
            "upload_time": "2025-07-26T12:37:24",
            "upload_time_iso_8601": "2025-07-26T12:37:24.089250Z",
            "url": "https://files.pythonhosted.org/packages/74/39/0b5ab59150fe357ee93eb7efe8453112485a81633db124fc0a3644f44c19/metorial-1.0.0rc3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-26 12:37:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "metorial",
    "github_project": "metorial-enterprise",
    "github_not_found": true,
    "lcname": "metorial"
}
        
Elapsed time: 1.67577s