@deeptutor/ai-sdk@0.1.11
latest
Works with
•JSR Score35%•This package works with Deno, BrowsersIt is unknown whether this package works with Cloudflare Workers, Node.js, Bun




Publisheda year ago (0.1.11)
AI SDK
This is a port of Vercel's AI SDK Core to Rust.
Main requirements are:
- This should be compilable to WebAssembly.
- The WebAssembly should be runnable in the browser and also on any target platform.
- The SDK should support many providers.
The main methods are:
| Method | Description |
|---|---|
| generateText | Generates text and tool calls. This function is ideal for non-interactive use cases such as automation tasks where you need to write text (e.g. drafting email or summarizing web pages) and for agents that use tools. |
| streamText | Stream text and tool calls. You can use the streamText function for interactive use cases such as chat bots and content streaming. |
| generateObject | Generates a typed, structured object that matches a Zod schema. You can use this function to force the language model to return structured data, e.g. for information extraction, synthetic data generation, or classification tasks. |
| streamObject | Stream a structured object that matches a Zod schema. You can use this function to stream generated UIs. |
| embedMany | Embed several values using an embedding model. The type of the value is defined by the embedding model. embedMany automatically splits large requests into smaller chunks if the model has a limit on how many embeddings can be generated in a single call. |
| embed | Generate an embedding for a single value using an embedding model. This is ideal for use cases where you need to embed a single value to e.g. retrieve similar items or to use the embedding in a downstream task. |
There are helper methods:
| Method | Description |
|---|---|
| createIdGenerator | Creates a customizable ID generator function. You can configure the alphabet, prefix, separator, and default size of the generated IDs. Example usage: let generate_id = create_id_generator(IdGeneratorOptions { prefix: "user".to_string(), separator: "_".to_string(), ..Default::default() }); let id = generate_id(); |
Add Package
deno add jsr:@deeptutor/ai-sdk
Import symbol
import * as ai_sdk from "@deeptutor/ai-sdk";
Import directly with a jsr specifier
import * as ai_sdk from "jsr:@deeptutor/ai-sdk";
Add Package
pnpm i jsr:@deeptutor/ai-sdk
pnpm dlx jsr add @deeptutor/ai-sdk
Import symbol
import * as ai_sdk from "@deeptutor/ai-sdk";
Add Package
yarn add jsr:@deeptutor/ai-sdk
yarn dlx jsr add @deeptutor/ai-sdk
Import symbol
import * as ai_sdk from "@deeptutor/ai-sdk";
Add Package
vlt install jsr:@deeptutor/ai-sdk
Import symbol
import * as ai_sdk from "@deeptutor/ai-sdk";
Add Package
npx jsr add @deeptutor/ai-sdk
Import symbol
import * as ai_sdk from "@deeptutor/ai-sdk";
Add Package
bunx jsr add @deeptutor/ai-sdk
Import symbol
import * as ai_sdk from "@deeptutor/ai-sdk";