Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 1.64 KB

File metadata and controls

80 lines (55 loc) · 1.64 KB
title ChatTzafon

Tzafon is a research firm building scalable compute systems and foundation models for real-world interaction. The ChatTzafon class provides access to Tzafon's OpenAI-compatible Chat Completions API.

Setup

Installation

Install the integration package:

```bash pip pip install -U langchain-tzafon ``` ```bash uv uv add langchain-tzafon ```

Credentials

Get an API key from tzafon.ai and set it as an environment variable:

export TZAFON_API_KEY="your-api-key"

Instantiation

import os
from langchain_tzafon import ChatTzafon

os.environ["TZAFON_API_KEY"] = "..."

model = ChatTzafon(
    model="tzafon.sm-1",
    temperature=0,
    max_tokens=1024,
)

Invocation

from langchain.messages import HumanMessage

messages = [HumanMessage(content="Hello, how are you?")]
response = model.invoke(messages)
print(response.content)

Streaming

for chunk in model.stream(messages):
    print(chunk.content, end="", flush=True)

Async

response = await model.ainvoke(messages)

Available models

Model Description
tzafon.sm-1 General-purpose chat model
tzafon.northstar.cua.sft Model trained for web navigation

Use the List Models API to get the latest available models.

API reference

For detailed API documentation, see the Tzafon SDK documentation.