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

Async Client

import asyncio

from cogstack_model_gateway_client.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.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.0.tar.gz (7.0 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.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4bd5ae9298d2cf6208a51dac7788f364a63eed83a2eed87176fb4b91e44e11b7
MD5 b2dc403663c2dbd54cbfff9327eb743f
BLAKE2b-256 fa1198251ca5dcab2cd5b303b5d66d1d162252bd75cfa51cdda942b0c5c3f424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cogstack_model_gateway_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c559d35609270ea66b93feab12ff50743deadf69bb61504ba25ed1aabda9506c
MD5 2ca27000867659e69c16a3951b6fc37c
BLAKE2b-256 5fa5448d33aa7b968e04a1e107f585db14debc9d4cbf2377ef36321964390ab4

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