Skip to content

Latest commit

 

History

History
40 lines (25 loc) · 952 Bytes

File metadata and controls

40 lines (25 loc) · 952 Bytes

threads logo

@threaded/ai

Composable LLM workflows for Node.js. Multi-provider support, tool execution, streaming, structured output, and approval workflows.

Installation

npm install @threaded/ai

Quick Example

import { compose, scope, model, setKeys } from "@threaded/ai"

setKeys({ openai: process.env.OPENAI_API_KEY })

const workflow = compose(
  scope({ tools: [searchTool] }, model({ model: "openai/gpt-4o-mini" }))
)

const result = await workflow("find recent papers on WebSockets")
console.log(result.lastResponse.content)

Documentation

Full API docs, usage guides, and examples are in the threads/ package and at the docs site.

Examples

Working examples are in the examples/ directory.

License

ISC