wayland-ai
v0.1.0
Published
A TypeScript based client for the Wayland AI web API
Readme
Wayland AI TypeScript SDK
This client gives you access to the Open Source AI models hosted on the Wayland platform.
Setup
npm install wayland-aiUsage
import wayland from "wayland-ai";
const ai = new wayland('YOUR-API-TOKEN');
const chat = await ai.text.chat({
messages: [
{ role: "user", content: "What is the capital of France?" }
],
model: "llama-3.1"
});Streaming Responses
Streaming can be enabled for any endpoint by passing the stream: true property.
import wayland from "wayland-ai";
for await (const chunk of ai.text.generate({
prompt: "Write a story about a space explorer",
model: "llama-3.1",
stream: true
})) {
process.stdout.write(chunk);
}