Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 1.69 KB

File metadata and controls

73 lines (52 loc) · 1.69 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 npm npm install @tzafon/langchain-tzafon ``` ```bash pnpm pnpm add @tzafon/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 { ChatTzafon } from "@tzafon/langchain-tzafon";

const model = new ChatTzafon({
  model: "tzafon.sm-1",
  temperature: 0,
  maxTokens: 1024,
  apiKey: process.env.TZAFON_API_KEY,
});

Invocation

import { HumanMessage } from "@langchain/core/messages";

const messages = [new HumanMessage("Hello, how are you?")];
const response = await model.invoke(messages);
console.log(response.content);

Streaming

const stream = await model.stream(messages);
for await (const chunk of stream) {
  process.stdout.write(chunk.content);
}

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.