You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
3 months ago | |
|---|---|---|
| .. | ||
| src | 3 months ago | |
| README.md | 3 months ago | |
| package.json | 3 months ago | |
| vitest.config.ts | 3 months ago | |
README.md
@dm/xllm
统一的大模型请求库,支持:
- 流式输出(
for await...of) - OpenAI-Compatible 与 DeepSeek 供应商适配
- 文本、多模态输入(图片 URL)、工具调用结构统一
快速开始
import { createXllm } from "@dm/xllm";
const xllm = createXllm({
provider: "deepseek",
model: "deepseek-chat",
apiKey: process.env.DEEPSEEK_API_KEY,
});
for await (const event of xllm.stream({
messages: [{ role: "user", content: [{ type: "text", text: "你好" }] }],
})) {
if (event.type === "text.delta") process.stdout.write(event.text);
}