Package: klu
Klu.ai Python SDKDescriptionThe Klu Python SDK is a library that provides access to the Klu platform. With the SDK, quick build AI-enabled apps.The SDK gives developers the ability to interact with their workspace, including:klu.appsManaging apps (projects)klu.actionsManage actions (prompt templates with model config)klu.contextCreate and manage context libaries for retrieval (RAG) or searchklu.actions.streamDeploy actions for generations and chatklu.sessionManage session memory across inference and modelsklu.feedbackCapture user feedback and behaviorklu.experimentRun 1:1 prompt evals and A/B testsklu.dataImport JSONL data for use, or export for further analysisklu.modelsManage LLM providers and default modelsklu.finetuneFine-tune models with on your dataMore resources here:Access Your Klu WorkspaceSDK GitHub RepoDocumentationPyPIInstallationTo install, run:pip install kluKlu SDK requires Python version 3.7 or later.Getting StartedTo access Klu via the SDK, first obtain your API key from theKlu.ai app. Once you have your key, you can create aKluobject:fromkluimportKluklu=Klu("YOUR_API_KEY")Manage ModelsOnce you have aKluobject, you can access the different models available in the Klu API:fromkluimportKluklu=Klu("YOUR_API_KEY")models=awaitklu.models.get("model_guid")Get AppsEach of these objects provides methods for interacting with the corresponding model in the Klu API. For example, to list all apps in your workspace, you can use:fromkluimportKluklu=Klu("YOUR_API_KEY")apps=klu.apps.list()Run Actions w/ StreamingRun inference with a Klu Action and start streaming generation response.fromkluimportKluklu=Klu("YOUR_API_KEY")prompt_response=awaitklu.actions.prompt("action_guid","prompt",streaming=True)asyncformessageinklu.actions.stream(prompt_response.streaming_url):print(message)Get DataIn a similar manner, in order to get a list of data points for an action, you can do the following:fromkluimportKluklu=Klu("YOUR_API_KEY")data=klu.data.get_data("action_guid")See the platform docs for more examples.DocumentationFor more detailed information on how to use the SDK, please refer to theKlu Platform documentation.LicenseK-human Likeness Utility © 2023 Klu, Inc.Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.