Skip to content

Keymate Python API - Unleash the Power of AI with a Dash of Dusty Dags

License

Notifications You must be signed in to change notification settings

Jeremy-Rich/keymate-python-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

keymate-python-api

Keymate Python API - Unleash the Power of AI with a Dash of Dusty Dags

Overview

This project provides a Python API for the Keymate platform, which is a powerful tool for interacting with AI-based systems. The API allows for streamlined integration and usage of various AI functionalities.

Features

  • Easy-to-use interface: Integrate AI into your applications with minimal effort.
  • Custom hooks: Implement custom behaviors using _hooks to extend functionality.
  • Error handling: Comprehensive error management through built-in error classes in the errors module.
  • Flexible operations: Interact with the API using operations defined in the operations module.

Project Structure

/keymate-python-api
├── LICENSE
├── README.md
├── build/
│   └── lib/
│       └── keymateapi/
│           ├── __init__.py
│           ├── _hooks/
│           ├── models/
│           ├── operations/
│           ├── sdk.py
│           ├── sdkconfiguration.py
│           └── utils/
└── .gitignore

Installation

  1. Clone the repository:

    git clone https://github.com/Jeremy-Rich/keymate-python-api.git
    cd keymate-python-api
  2. Install dependencies:

    pip install -r requirements.txt

Usage

To use the API, import the relevant modules and configure the API key as needed.

from keymateapi.sdk import KeymateSDK

# Example usage
sdk = KeymateSDK("""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""


import requests as requests_http
from ._hooks import SDKHooks
from .utils import utils
from .utils.retries import RetryConfig
from dataclasses import dataclass
from keymateapi.models import components
from typing import Callable, Dict, Optional, Tuple, Union


SERVERS = [
    'https://server.searchweb.keymate.ai',
]
"""Contains the list of servers available to the SDK"""

@dataclass
class SDKConfiguration:
    client: requests_http.Session
    security: Union[components.Security,Callable[[], components.Security]] = None
    server_url: Optional[str] = ''
    server_idx: Optional[int] = 0
    language: str = 'python'
    openapi_doc_version: str = '1.0.2'
    sdk_version: str = '0.4.0'
    gen_version: str = '2.333.3'
    user_agent: str = 'speakeasy-sdk/python 0.4.0 2.333.3 1.0.2 keymateapi'
    retry_config: Optional[RetryConfig] = None

    def __post_init__(self):
        self._hooks = SDKHooks()

    def get_server_details(self) -> Tuple[str, Dict[str, str]]:
        if self.server_url is not None and self.server_url != '':
            return utils.remove_suffix(self.server_url, '/'), {}
        if self.server_idx is None:
            self.server_idx = 0

        return SERVERS[self.server_idx], {}


    def get_hooks(self) -> SDKHooks:
        return self._hooks")

Contributing

Feel free to submit issues and pull requests. Contributions are always welcome!

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Keymate Python API - Unleash the Power of AI with a Dash of Dusty Dags

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages