Skip to main content

Python SDK to interact with Itzam's API

Project description

Itzam python sdk

itzam logo

Overview

Itzam Python SDK provides a simple interface to interact with the Itzam API for text generation, thread management, model listing, and run inspection.

Installation

pip install itzam

Quick Start

from itzam import Itzam

client = Itzam("your-api-key")
response = client.text.generate(
  workflow_slug="your_workflow_slug",
  input="Hello, Itzam!",
  stream=False
)
print(response.text)

Authentication

You can provide your API key directly or set it as an environment variable:

export ITZAM_API_KEY=your-api-key

Then initialize without arguments:

from itzam import Itzam
client = Itzam()

Features

  • Text Generation: Generate text using your workflows.
  • Threads: Create and manage threads for conversations.
  • Models: List available models and their details.
  • Runs: Inspect previous runs and their metadata.

Usage Examples

Generate Text

response = client.text.generate(
  workflow_slug="your_workflow_slug",
  input="Write a poem about the sea."
)
print(response.text)

Stream Text Generation

for delta in client.text.generate(
  workflow_slug="your_workflow_slug",
  input="Tell me a story.",
  stream=True
):
  print(delta, end="", flush=True)

List Models

models = client.models.list()
for model in models:
  print(model.name, model.tag)

Create a Thread

thread = client.threads.create(
  workflow_slug="your_workflow_slug",
  name="Support Conversation"
)
print(thread.id)

Get a Run

run = client.runs.get("run_id")
print(run.output)

Advanced

You can specify a custom API base URL if needed:

client = Itzam(api_key="your-api-key", base_url="https://itz.am")

Requirements

  • Python 3.10+
  • requests
  • pydantic
  • rich
  • python-dotenv (optional, for environment variable loading)

License

MIT


For more details, see the API documentation.

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

itzam-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

itzam-1.0.0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file itzam-1.0.0.tar.gz.

File metadata

  • Download URL: itzam-1.0.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for itzam-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0780e7afac7b2095ad9d217e59c899847b9e4ac982681ef02cb675043a2ebe9e
MD5 aee65bdb67773c9614551ee93c7fa1c9
BLAKE2b-256 940bb3cca5455f8f47223e599549e93960436dfdc73021f1c4e657a2ee67a49d

See more details on using hashes here.

File details

Details for the file itzam-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: itzam-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.12

File hashes

Hashes for itzam-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4d45e8139a6361e498a52ac50dee0ddbc8a4796f1fa6f0f688e32d4f8d75807
MD5 5533cbb21158556231c2fcda7994e504
BLAKE2b-256 c1684710c0fd9a83bc4e6e6df3a26fc2d7777320bbc01a180974f20bea6303d9

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