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.2.0.tar.gz (13.7 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.2.0-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7c526618d098c2e21d015b3ff52a9778feb87c804578a767b3bf15636068ca4b
MD5 a6e6e7be474654e08d9173a394464f63
BLAKE2b-256 3ca1cc09ced7d6cd2a6d2a74cebd269c29017955e47862482b19aae044ff1cb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 912bd291d90f3bb1856e5d0da6e29bc0f0a3e504436e273b42e9df2c4176f803
MD5 bfa4b066c458d4a8eee9c0d4cedb62c3
BLAKE2b-256 a3d91d6fedc003711f8af5a07c359bba2e491fb153a575008c3f9501c9b4ec77

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