Skip to content

JoaquimCassano/itzam-python-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI Version PyPI Downloads

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

See available models

python3 -m itzam.models

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.

About

Python SDK to interact with Itzam's API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages