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.9.tar.gz (10.4 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.9-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.9.tar.gz
Algorithm Hash digest
SHA256 bcf33356f4f380eed02c6b05325a696e05e83dde102c45cbc8e03c84fbfd0877
MD5 afecc5a342ea406504373d4eba50acbe
BLAKE2b-256 8de3cef2fddc0b4aea63e02a86a0f57da6a93402e4b6c88326bef047df1a09ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 fbdd40920c8388e9a3071fd509f5693ca066a36d8b30c8e2360ab6dfeac97316
MD5 bfcc3f42162861ba980b65157c10b4da
BLAKE2b-256 372d75fb7f8d35739dcf1ac0bb484f7a3097aa0e52df093ead6e5a7b4781ccf8

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