Skip to main content

SDK for building AI Enabled apps.

Project description

Klu.AI Python SDK

pypi python Build Status codecov

Description

SDK for building AI Enabled apps

The Klu.AI Python SDK is a library that provides access to the Klu.AI API, allowing users to interact with their workspace, applications, actions, data, models, and contexts.

Requirements

The Klu.AI Python SDK requires Python version 3.7 or later.

Installation

To install the Klu.AI Python SDK, simply run:

pip install klu

Getting Started

To use the Klu.AI Python SDK, you must first obtain an API key from the Klu.AI website. Once you have your API key, you can create a Klu object:

from klu import Klu

client = Klu("YOUR_API_KEY")

Once you have a Klu object, you can access the different models available in the Klu API:

from klu import Klu

client = Klu("YOUR_API_KEY")
models = await client.models.get("model_guid")

There is also a separate function to stream action prompt

Each of these objects provides methods for interacting with the corresponding model in the Klu API. For example, to list all applications in your workspace, you can use:

from klu import Klu

client = Klu("YOUR_API_KEY")
applications = client.applications.list()

In a similar manner, in order to get a list of data points for an action, you can do the following

from klu import Klu

client = Klu("YOUR_API_KEY")
data = client.data.get_data("action_id")

There is a special client that allows to stream action prompts. The streaming url can be received from the action creation response.

from klu import Klu

client = Klu("YOUR_API_KEY")

prompt_response = await client.actions.prompt("action_guid", "prompt", streaming=True)
async for message in client.sse_client.get_streaming_data(prompt_response.streaming_url):
    print(message)

Documentation

For more detailed information on how to use the Klu.AI Python SDK, please refer to the API documentation.

Credits

This package was created with Cookiecutter and the waynerv/cookiecutter-pypackage project template.

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

klu-0.1.18.tar.gz (26.2 kB view hashes)

Uploaded Source

Built Distribution

klu-0.1.18-py3-none-any.whl (42.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page