Skip to main content

A Python client for the CogStack Model Gateway

Project description

CogStack Model Gateway Client

A Python client for interacting with the CogStack Model Gateway. The default and recommended client implementation is asynchronous, but a blocking synchronous one is also provided for easier experimentation.

Installation

pip install cogstack-model-gateway-client

Usage

The project is under active development and so is the documentation. Seems like looking at the source code is the only way to figure out what the client does.

Async Client

import asyncio

from cogstack_model_gateway_client import GatewayClient


async def main():
    async with GatewayClient(base_url="http://your-gateway-url", default_model="your-model") as client:
        # Generate annotations for a given text
        result = await client.process("Sample input text")

    print(result)


asyncio.run(main())

Synchronous Client

from cogstack_model_gateway_client import GatewayClientSync

client = GatewayClientSync(base_url="http://your-gateway-url", default_model="your-model")
result = client.process("Sample input text")
print(result)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cogstack_model_gateway_client-0.1.4.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cogstack_model_gateway_client-0.1.4-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file cogstack_model_gateway_client-0.1.4.tar.gz.

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.4.tar.gz
Algorithm Hash digest
SHA256 97fb934d54c5ff97a3ab0bfdf8de116528342e5b22272ee01508d4012306d2fe
MD5 1bd36f5d6bafb059675007b76b06ce06
BLAKE2b-256 12757cb831ba9bf2f21d403db6e915e23c766a2a2d13eca5b72aa5f7be01805b

See more details on using hashes here.

File details

Details for the file cogstack_model_gateway_client-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 28957a2874ec92b1d05b822ceb0f04bde0699824458f7b2d912d43f838f4499e
MD5 203f7ea3984ad81194b7215ee42f94d2
BLAKE2b-256 77bac2351909f24980e1458836ba4f4fc1bc8a1e2db5ad5b9e54b18de2aa6014

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page