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.1.tar.gz (7.1 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.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b94375b44911e0201b3e4eaf6fd62f5405a2623fceae11599d720b142d8e11f2
MD5 2534f48af48d582bf569a69539f12233
BLAKE2b-256 7924d15e80b54ff5c13180ae54b3f77f81bb5608b918461b55521d483c53475e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a18cb59ce52f9ac0ac92b09fe6d89d10a3b62933f3f8b614f16e1fd76f4f596b
MD5 bca2374a59c61a88915c2429f6ada2eb
BLAKE2b-256 373faf5b1dc1c1fab35e0f9d512dddd2a754d8550951ca5f0b5391b229b510ca

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