Skip to main content

CFLabs Python SDK

Project description

CFLabs SDK

Python SDK for interacting with the CFLabs/Octavian API.

Installation

pip install cflabs-sdk

Usage

from cflabs import CFLabs

# Initialize the client
client = CFLabs(
    api_key="your-api-key",  # or set CFLABS_API_KEY environment variable
    base_url="https://api.cflabs.com"  # optional, defaults to localhost:8000
)

# Run a prompt by ID
result = client.run(
    var_parameters={"input": "your input"}
)

# Or use a prompt slug
from cflabs import Prompt

prompt = Prompt(slug="my-prompt-slug", client=client)
result = prompt.run(var_parameters={"input": "your input"})

Configuration

The SDK can be configured using:

  • Constructor arguments
  • Environment variables: CFLABS_API_KEY

Requirements

  • Python >= 3.8
  • requests >= 2.31.0

License

MIT

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

cflabs-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cflabs-0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cflabs-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for cflabs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 47694cd94d4a196f0a92342071f5897175465350558050abfbcf6f83607acb7b
MD5 77ff4d03989328db84065d84c1347f4c
BLAKE2b-256 24a2580d52538bb6f6ccd83db81ebc30a24c1e354fc4e92084a2c1b14df5c7c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cflabs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.5

File hashes

Hashes for cflabs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1778caf91ca339765d6ccb640f33fc22840a10acd6c56006b61034c38e8b6dfd
MD5 5293b7bf47d0c11f89d8ef00305cc125
BLAKE2b-256 2f405297b9fe6ba1c015c448be36b0605f973cb276dfaeded8543b7d234b1321

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