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.8.tar.gz (9.8 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.8-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.8.tar.gz
Algorithm Hash digest
SHA256 acdcdcf90cb5b410b9b8951c04bbf6239b7216d4f4fe65673aafe445d4e00754
MD5 9d1425f50454dd62f48c22d297ed49ad
BLAKE2b-256 b05ffda7cb728addbe1f128d7f9df933ab4475606e901d4a001ea11e6fd79685

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 77b09551723cf011aa8e0dac21c6b1f9afe8d004dd1ebc346ab6e331714ba25a
MD5 6f89af8ce1fba0ba3df81d6189f0bcfc
BLAKE2b-256 3c902b5c85e31ffee31aa6d1215c61a255960ede5988a0a4ec1c9b741c032ac4

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