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.10.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.10.tar.gz
Algorithm Hash digest
SHA256 d923a77a208020c60a650b94b0b3e6fc8922545b7028b3591e37be91bf1a4716
MD5 bd3aebffc21724a3f7ab732ef2c2d649
BLAKE2b-256 bc0cc8caf7204d93a2be6c03fc57b510a3645ca8a363a7fbd71306de1756052b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 7379b48f2a99d7b55162f124e74bf1bebc16fe3f25a52c65bcd6cf8b7a14a26d
MD5 5a1608e034fc420e5283a6f723c45c27
BLAKE2b-256 8736e74e0ad39d11a1e419ea8efe1581c08cc40c3eeecfe159286d4eedeb602a

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