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.3.tar.gz (8.1 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.3.tar.gz.

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.3.tar.gz
Algorithm Hash digest
SHA256 b8ca08562ba28181c9def2877289fcda648efe6d0ee24a1145be5a084bcdab88
MD5 b1cc309abb2cf403a6e614a47220d2b7
BLAKE2b-256 8f29031e1b0020f1917aa2173dbb59602f30267a5366d92524ed23324c3731ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 451eb3bd858bf0fa76a1f28c27e7bbbf7fced267f82bffdd5464e63b6ba01f3c
MD5 334e1549b4250055b745b5e1305f0a73
BLAKE2b-256 f9bec0f692f3663a4ab0ee9dac2cd7ad8e2722d0b749d94fb8e290c27679c08d

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