mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e613eb46c | |||
| 798644414a | |||
| 54bb83f229 | |||
| 65da232c64 | |||
| dacc7798ab | |||
| 9508807da7 | |||
| 6a7eb17cd2 | |||
| c5da34b680 | |||
| 2a37b77482 | |||
| b814cf2611 | |||
| c37817e2d8 | |||
| bbf239705c | |||
| 8a9f42596d | |||
| 29235dc1ed | |||
| e326400dbe | |||
| deeb97ab5b | |||
| d73858ef42 | |||
| 6b9584714d | |||
| b9a4a9093c | |||
| ef5be7e17c | |||
| a4235d3f68 | |||
| fa508f4259 | |||
| 94767fddcb | |||
| 685b17e59e | |||
| 9acb128943 | |||
| ee55d74dd4 | |||
| cca1050e82 | |||
| 92a848c69c | |||
| f32fff19dd | |||
| 38d7bdbd96 | |||
| 3e236ec36f |
@@ -8,16 +8,20 @@ Generate text, images, videos, speech, and transcriptions.
|
||||
|
||||
```
|
||||
lh generate (alias: gen)
|
||||
├── text <prompt> # Text generation
|
||||
├── image <prompt> # Image generation
|
||||
├── video <prompt> # Video generation
|
||||
├── tts <text> # Text-to-speech
|
||||
├── asr <audioFile> # Audio-to-text (speech recognition)
|
||||
├── download <genId> <taskId> # Wait & download generation result
|
||||
├── status <genId> <taskId> # Check async task status
|
||||
└── list # List generation topics
|
||||
├── text <prompt> # Text generation
|
||||
├── image <prompt> # Image generation
|
||||
├── video <prompt> # Video generation
|
||||
├── tts <text> # Text-to-speech
|
||||
├── asr <audioFile> # Audio-to-text (speech recognition)
|
||||
├── download <generationId> <asyncTaskId> # Wait & download generation result
|
||||
├── status <generationId> <asyncTaskId> # Check async task status
|
||||
└── list # List generation topics
|
||||
```
|
||||
|
||||
> ⚠️ **Important**: `status` and `download` require an `asyncTaskId` (UUID format, e.g.
|
||||
> `7ad0eb13-e9a5-4403-8070-1f7fe95b2f95`), **not** the generation ID (`gen_xxx`).
|
||||
> The asyncTaskId is printed after "→ Task" in the `video` / `image` command output.
|
||||
|
||||
---
|
||||
|
||||
## `lh generate text <prompt>` / `lh gen text <prompt>`
|
||||
@@ -54,7 +58,7 @@ cat README.md | lh gen text "summarize this" --pipe
|
||||
|
||||
## `lh generate image <prompt>` / `lh gen image <prompt>`
|
||||
|
||||
Generate images from text prompt. This is an async operation — the command submits the task and returns a generation ID + task ID for tracking.
|
||||
Generate images from text prompt. This is an async operation — the command submits the task and returns a generation ID + async task ID for tracking.
|
||||
|
||||
**Source**: `apps/cli/src/commands/generate/image.ts`
|
||||
|
||||
@@ -80,17 +84,22 @@ lh gen image "A cute cat" --model dall-e-3 --provider openai --json
|
||||
✓ Image generation started
|
||||
Batch ID: gb_xxx
|
||||
1 image(s) queued
|
||||
Generation gen_xxx → Task <taskId>
|
||||
Generation gen_xxx → Task 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
This is the asyncTaskId — use this for status/download
|
||||
|
||||
Use "lh generate status <generationId> <taskId>" to check progress.
|
||||
Use "lh generate status <generationId> <asyncTaskId>" to check progress.
|
||||
```
|
||||
|
||||
**Typical workflow**:
|
||||
|
||||
```bash
|
||||
# Generate image, then wait & download
|
||||
# 1. Submit generation — note down BOTH IDs from the output
|
||||
lh gen image "A cute cat"
|
||||
lh gen download <generationId> <taskId> -o cat.png
|
||||
# Generation gen_abc123 → Task 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95
|
||||
|
||||
# 2. Wait & download using generationId + asyncTaskId (the UUID)
|
||||
lh gen download gen_abc123 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95 -o cat.png
|
||||
```
|
||||
|
||||
---
|
||||
@@ -102,7 +111,7 @@ Generate video from text prompt. This is an async operation.
|
||||
**Source**: `apps/cli/src/commands/generate/video.ts`
|
||||
|
||||
```bash
|
||||
lh gen video "A cat playing piano" -m < model > -p < provider > [options]
|
||||
lh gen video "A cat playing piano" -m <model> -p <provider> [options]
|
||||
```
|
||||
|
||||
| Option | Description | Required |
|
||||
@@ -122,9 +131,26 @@ lh gen video "A cat playing piano" -m < model > -p < provider > [options]
|
||||
```
|
||||
✓ Video generation started
|
||||
Batch ID: gb_xxx
|
||||
Generation gen_xxx → Task <taskId>
|
||||
Generation gen_xxx → Task 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
This is the asyncTaskId — use this for status/download
|
||||
|
||||
Use "lh generate status <generationId> <taskId>" to check progress.
|
||||
Use "lh generate status <generationId> <asyncTaskId>" to check progress.
|
||||
```
|
||||
|
||||
**Typical workflow**:
|
||||
|
||||
```bash
|
||||
# 1. Find available video models for a provider
|
||||
lh model list volcengine --json | grep -i seedance
|
||||
|
||||
# 2. Submit generation — note down BOTH IDs from the output
|
||||
lh gen video "A cat on a runway" -m doubao-seedance-2-0-260128 -p volcengine \
|
||||
--aspect-ratio 9:16 --duration 5 --resolution 1080p
|
||||
# Generation gen_abc123 → Task 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95
|
||||
|
||||
# 3. Wait & download using generationId + asyncTaskId (the UUID)
|
||||
lh gen download gen_abc123 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95 -o result.mp4 --timeout 600
|
||||
```
|
||||
|
||||
---
|
||||
@@ -153,15 +179,18 @@ lh gen asr recording.wav [options]
|
||||
|
||||
---
|
||||
|
||||
## `lh generate download <generationId> <taskId>`
|
||||
## `lh generate download <generationId> <asyncTaskId>`
|
||||
|
||||
Wait for an async generation task to complete and download the result file.
|
||||
|
||||
**Source**: `apps/cli/src/commands/generate/index.ts`
|
||||
|
||||
> ⚠️ `<asyncTaskId>` is the UUID printed after "→ Task" in the video/image output.
|
||||
> Do **not** pass the generation ID (`gen_xxx`) here — that will cause a server error.
|
||||
|
||||
```bash
|
||||
lh gen download <generationId> <taskId> [-o output.png]
|
||||
lh gen download gen_xxx task_xxx -o ~/Desktop/result.mp4 --timeout 600
|
||||
lh gen download <generationId> <asyncTaskId> [-o output.png]
|
||||
lh gen download gen_xxx 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx -o ~/Desktop/result.mp4 --timeout 600
|
||||
```
|
||||
|
||||
| Option | Description | Default |
|
||||
@@ -175,30 +204,21 @@ lh gen download gen_xxx task_xxx -o ~/Desktop/result.mp4 --timeout 600
|
||||
1. Polls `generation.getGenerationStatus` at the specified interval
|
||||
2. Shows live progress: `⋯ Status: processing... (42s)`
|
||||
3. On success: downloads asset URL to local file
|
||||
4. On error: displays error message and exits
|
||||
4. On error / wrong ID: displays a clear message pointing to the correct ID format
|
||||
5. On timeout: suggests using `lh gen status` to check later
|
||||
|
||||
**Typical workflow**:
|
||||
|
||||
```bash
|
||||
# One-shot: generate and download
|
||||
lh gen image "A sunset"
|
||||
# Copy the generation ID and task ID from output
|
||||
lh gen download gen_xxx taskId_xxx -o sunset.png
|
||||
|
||||
# Video (longer timeout)
|
||||
lh gen video "A cat running" -m model -p provider
|
||||
lh gen download gen_xxx taskId_xxx -o cat.mp4 --timeout 600
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## `lh generate status <generationId> <taskId>`
|
||||
## `lh generate status <generationId> <asyncTaskId>`
|
||||
|
||||
Check the status of an async generation task.
|
||||
|
||||
> ⚠️ `<asyncTaskId>` is the UUID printed after "→ Task" in the video/image output.
|
||||
> Do **not** pass the generation ID (`gen_xxx`) here — that will cause a server error.
|
||||
|
||||
```bash
|
||||
lh gen status <generationId> <taskId> [--json]
|
||||
lh gen status <generationId> <asyncTaskId> [--json]
|
||||
lh gen status gen_xxx 7ad0eb13-xxxx-xxxx-xxxx-xxxxxxxxxxxx
|
||||
```
|
||||
|
||||
| Option | Description |
|
||||
@@ -235,12 +255,17 @@ Image and video generation use an async task pattern:
|
||||
- Triggers async background task (image via `createAsyncCaller`, video via `initModelRuntimeFromDB`)
|
||||
- Returns `{ data: { batch, generations }, success }` with `asyncTaskId` in each generation
|
||||
3. **Poll status** → `generation.getGenerationStatus`
|
||||
- Input: `{ generationId, asyncTaskId }` — both are required, and `asyncTaskId` must be the
|
||||
UUID from the `async_tasks` table, not `gen_xxx`
|
||||
- Returns `{ status, error, generation }` (generation includes asset URLs on success)
|
||||
- Before querying, calls `checkTimeoutTasks` which marks tasks as `error` if they have been
|
||||
`pending` or `processing` for more than ~5 minutes (`ASYNC_TASK_TIMEOUT = 298s`)
|
||||
|
||||
**Server routes**:
|
||||
|
||||
- `src/server/routers/lambda/image/index.ts` — image creation (uses `authedProcedure` + `serverDatabase`)
|
||||
- `src/server/routers/lambda/video/index.ts` — video creation (uses `authedProcedure` + `serverDatabase`)
|
||||
- `src/server/routers/lambda/generation.ts` — status checking
|
||||
- `packages/database/src/models/asyncTask.ts` — `AsyncTaskModel` including `checkTimeoutTasks`
|
||||
|
||||
**Note**: Image/video routes do NOT use the `keyVaults` middleware — they read API keys from the database via `initModelRuntimeFromDB` or `createAsyncCaller`.
|
||||
|
||||
@@ -1,58 +1,51 @@
|
||||
---
|
||||
name: code-review
|
||||
description: 'Code review checklist for LobeHub. Use when reviewing PRs, diffs, or code changes. Covers correctness, security, quality, and project-specific patterns.'
|
||||
name: review-checklist
|
||||
description: 'Common recurring mistakes in LobeHub code review — console leftovers, missing return await, hardcoded secrets, hardcoded i18n strings, desktop router pair drift, antd vs @lobehub/ui, non-idempotent migrations, cloud impact red flags. Use as a quick checklist when reviewing PRs, diffs, or branch changes.'
|
||||
---
|
||||
|
||||
# Code Review Guide
|
||||
# Review Checklist
|
||||
|
||||
## Before You Start
|
||||
|
||||
1. Read `/typescript` and `/testing` skills for code style and test conventions
|
||||
2. Get the diff (skip if already in context, e.g., injected by GitHub review app): `git diff` or `git diff origin/canary..HEAD`
|
||||
|
||||
## Checklist
|
||||
|
||||
### Correctness
|
||||
## Correctness
|
||||
|
||||
- Leftover `console.log` / `console.debug` — should use `debug` package or remove
|
||||
- Missing `return await` in try/catch — see <https://typescript-eslint.io/rules/return-await/> (not in our ESLint config yet, requires type info)
|
||||
- Can the fix/implementation be more concise, efficient, or have better compatibility?
|
||||
|
||||
### Security
|
||||
## Security
|
||||
|
||||
- No sensitive data (API keys, tokens, credentials) in `console.*` or `debug()` output
|
||||
- No base64 output to terminal — extremely long, freezes output
|
||||
- No hardcoded secrets — use environment variables
|
||||
|
||||
### Testing
|
||||
## Testing
|
||||
|
||||
- Bug fixes must include tests covering the fixed scenario
|
||||
- New logic (services, store actions, utilities) should have test coverage
|
||||
- Existing tests still cover the changed behavior?
|
||||
- Prefer `vi.spyOn` over `vi.mock` (see `/testing` skill)
|
||||
|
||||
### i18n
|
||||
## i18n
|
||||
|
||||
- New user-facing strings use i18n keys, not hardcoded text
|
||||
- Keys added to `src/locales/default/{namespace}.ts` with `{feature}.{context}.{action|status}` naming
|
||||
- For PRs: `locales/` translations for all languages updated (`pnpm i18n`)
|
||||
|
||||
### SPA / routing
|
||||
## SPA / routing
|
||||
|
||||
- **`desktopRouter` pair:** If the diff touches `src/spa/router/desktopRouter.config.tsx`, does it also update `src/spa/router/desktopRouter.config.desktop.tsx` with the same route paths and nesting? Single-file edits often cause drift and blank screens.
|
||||
|
||||
### Reuse
|
||||
## Reuse
|
||||
|
||||
- Newly written code duplicates existing utilities in `packages/utils` or shared modules?
|
||||
- Copy-pasted blocks with slight variation — extract into shared function
|
||||
- `antd` imports replaceable with `@lobehub/ui` wrapped components (`Input`, `Button`, `Modal`, `Avatar`, etc.)
|
||||
- Use `antd-style` token system, not hardcoded colors; prefer `createStaticStyles` + `cssVar.*` over `createStyles` + `token` unless runtime computation is required
|
||||
|
||||
### Database
|
||||
## Database
|
||||
|
||||
- Migration scripts must be idempotent (`IF NOT EXISTS`, `IF EXISTS` guards)
|
||||
|
||||
### Cloud Impact
|
||||
## Cloud Impact
|
||||
|
||||
A downstream cloud deployment depends on this repo. Flag changes that may require cloud-side updates:
|
||||
|
||||
@@ -61,13 +54,3 @@ A downstream cloud deployment depends on this repo. Flag changes that may requir
|
||||
- **Dependency versions bumped** — e.g., upgrading `next` or `drizzle-orm` in `package.json`
|
||||
- **`@lobechat/business-*` exports changed** — e.g., renaming a function in `src/business/` or changing type signatures in `packages/business/`
|
||||
- `src/business/` and `packages/business/` must not expose cloud commercial logic in comments or code
|
||||
|
||||
## Output Format
|
||||
|
||||
For local CLI review only (GitHub review app posts inline PR comments instead):
|
||||
|
||||
- Number all findings sequentially
|
||||
- Indicate priority: `[high]` / `[medium]` / `[low]`
|
||||
- Include file path and line number for each finding
|
||||
- Only list problems — no summary, no praise
|
||||
- Re-read full source for each finding to verify it's real, then output "All findings verified."
|
||||
@@ -238,13 +238,34 @@ Use `---` separators between major blocks for long releases.
|
||||
- Keep concise.
|
||||
- Must include `Migration overview`, operator impact, and rollback/backup note.
|
||||
|
||||
### Contributor Ordering
|
||||
|
||||
Render contributors as a **single flat list** (no separate "Community" / "Core Team" subsections). Order: **community contributors first, team members after**. Within each group, sort by PR count desc. Bots (`@lobehubbot`, `renovate[bot]`) go on a separate "maintenance" line.
|
||||
|
||||
**LobeHub team roster** — anyone in this list is a team member; anyone not in this list is a community contributor:
|
||||
|
||||
- @arvinxx
|
||||
- @Innei
|
||||
- @tjx666 (commit author name: YuTengjing)
|
||||
- @LiJian
|
||||
- @Neko
|
||||
- @Rdmclin2
|
||||
- @AmAzing129
|
||||
- @sudongyuer
|
||||
- @rivertwilight
|
||||
- @CanisMinor
|
||||
|
||||
> **Resolving handles** — git author names (e.g. `YuTengjing`) are not always the GitHub handle. Verify via `gh pr view <PR> --json author` or `gh api search/users -f q='<email>'` before listing.
|
||||
|
||||
If a new contributor appears who is not on this list, treat them as community by default and ask the user whether to add them to the roster.
|
||||
|
||||
### GitHub Release Changelog Template
|
||||
|
||||
```md
|
||||
# 🚀 LobeHub v<x.y.z> (<YYYYMMDD>)
|
||||
|
||||
**Release Date:** <Month DD, YYYY>
|
||||
**Since <Previous Version>:** <N commits> · <N merged PRs> · <N resolved issues> · <N contributors>
|
||||
**Since <Previous Version>:** <N merged PRs> · <N resolved issues> · <N contributors>
|
||||
|
||||
> <One release thesis sentence: what this release unlocks in practice.>
|
||||
|
||||
@@ -296,12 +317,11 @@ Use `---` separators between major blocks for long releases.
|
||||
|
||||
## 👥 Contributors
|
||||
|
||||
**<N merged PRs>** from **<N contributors>** across **<N commits>**.
|
||||
Huge thanks to **<N contributors>** who shipped **<N merged PRs>** this cycle.
|
||||
|
||||
### Community Contributors
|
||||
@<community-handle> · @<community-handle> · @<team-handle> · @<team-handle>
|
||||
|
||||
- @<username> - <notable contribution area>
|
||||
- @<username> - <notable contribution area>
|
||||
Plus @lobehubbot and renovate[bot] for maintenance.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# 🚀 LobeHub v2.1.54 (20260427)
|
||||
|
||||
**Hotfix Scope:** Agent topic-switching regression — stale chat state on agent change
|
||||
|
||||
> Clears residual topic state when navigating between agents and restores blank-canvas behavior on agent switch.
|
||||
|
||||
## 🐛 What's Fixed
|
||||
|
||||
- **Stale topic on agent switch** — Switching from `/agent/agt_A/tpc_X` to `/agent/agt_B` no longer leaves the previous topic's messages on screen, and _Start new topic_ responds again. (#14231)
|
||||
- **Header & sidebar consistency** — Conversation header now shows the active subtopic's title, and the sidebar keeps the parent topic's thread list expanded while a thread is open.
|
||||
|
||||
## ⚙️ Upgrade
|
||||
|
||||
- Self-hosted: pull the new image and restart. No schema or env changes.
|
||||
- Cloud: applied automatically.
|
||||
|
||||
## 👥 Owner
|
||||
|
||||
@{pr-author}
|
||||
|
||||
> **Note for Claude**: Replace `{pr-author}` with the actual PR author. Retrieve via `gh pr view <number> --json author --jq '.author.login'`. Do not hardcode a username.
|
||||
@@ -59,7 +59,10 @@ git push -u origin hotfix/v{version}-{short-hash}
|
||||
|
||||
2. **Create PR to main** with a gitmoji prefix title (e.g. `🐛 fix: description`)
|
||||
|
||||
3. **After merge**: auto-tag-release detects `hotfix/*` branch → auto patch +1.
|
||||
3. **Write a short hotfix changelog** — See `changelog-example/hotfix.md`. Keep it minimal: scope line, 1-3 fix bullets (symptom + fix in one sentence), upgrade note, owner. No long root-cause section — that lives in the commit message.
|
||||
- **Hotfix owner**: Use the actual PR author (retrieve via `gh pr view <number> --json author --jq '.author.login'`), never hardcode a username.
|
||||
|
||||
4. **After merge**: auto-tag-release detects `hotfix/*` branch → auto patch +1.
|
||||
|
||||
### Script
|
||||
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
|
||||
## Quick Reference by Name
|
||||
|
||||
- **@arvinxx**: Last resort only, mention for priority:high issues, tool calling, mcp, database
|
||||
- **@arvinxx**: General/uncategorized issues (default assignee), priority:high issues, tool calling, mcp, database
|
||||
- **@canisminor1990**: Design, UI components, editor, markdown rendering
|
||||
- **@tjx666**: Image/video generation, vision, cloud version, documentation, TTS, auth, login/register, database
|
||||
- **@ONLY-yours**: Performance, streaming, settings, general bugs, web platform, marketplace, agent builder, schedule task
|
||||
- **@tjx666**: Model providers and configuration, new model additions, image/video generation, vision, cloud version, documentation, TTS, auth, login/register, database
|
||||
- **@ONLY-yours**: Performance, streaming, settings, web platform, marketplace, agent builder, schedule task
|
||||
- **@Innei**: Knowledge base, files (KB-related), group chat, Electron, desktop client, build system
|
||||
- **@nekomeowww**: Memory, backend, deployment, DevOps, database
|
||||
- **@sudongyuer**: Mobile app (React Native)
|
||||
- **@sxjeru**: Model providers and configuration
|
||||
- **@rdmclin2**: Team workspace, IM and bot integration
|
||||
- **@tcmonster**: Subscription, refund, recharge, business cooperation
|
||||
|
||||
@@ -21,7 +20,7 @@ Quick reference for assigning issues based on labels.
|
||||
|
||||
| Label | Owner | Notes |
|
||||
| ---------------- | ------- | -------------------------------------------- |
|
||||
| All `provider:*` | @sxjeru | Model configuration and provider integration |
|
||||
| All `provider:*` | @tjx666 | Model configuration and provider integration |
|
||||
|
||||
### Platform Labels (platform:\*)
|
||||
|
||||
@@ -100,11 +99,10 @@ Quick reference for assigning issues based on labels.
|
||||
|
||||
1. **Specific feature owner** - e.g., `feature:knowledge-base` → @RiverTwilight
|
||||
2. **Platform owner** - e.g., `platform:mobile` → @sudongyuer
|
||||
3. **Provider owner** - e.g., `provider:*` → @sxjeru
|
||||
3. **Provider owner** - e.g., `provider:*` → @tjx666
|
||||
4. **Component owner** - e.g., 💄 Design → @canisminor1990
|
||||
5. **Infrastructure owner** - e.g., `deployment:*` → @nekomeowww
|
||||
6. **General maintainer** - @ONLY-yours for general bugs/issues
|
||||
7. **Last resort** - @arvinxx (only if no clear owner)
|
||||
6. **Default assignee** - @arvinxx for general/uncategorized issues
|
||||
|
||||
### Special Cases
|
||||
|
||||
@@ -121,8 +119,7 @@ Quick reference for assigning issues based on labels.
|
||||
|
||||
**No clear owner:**
|
||||
|
||||
- Assign to @ONLY-yours for general issues
|
||||
- Only mention @arvinxx if critical and truly unclear
|
||||
- Assign to @arvinxx for general issues
|
||||
|
||||
## Comment Templates
|
||||
|
||||
|
||||
@@ -121,4 +121,8 @@ cd packages/database && bunx vitest run --silent='passed-only' '[file]'
|
||||
|
||||
- Add keys to a namespace file under `src/locales/default/` (e.g. `agent.ts`, `auth.ts`)
|
||||
- For dev preview: translate `locales/zh-CN/` and `locales/en-US/`
|
||||
- Don't run `pnpm i18n` - CI handles it
|
||||
- `pnpm i18n` is slow; run it manually when locale keys need updating (e.g. before opening a PR).
|
||||
|
||||
### Code Review
|
||||
|
||||
Before reviewing a PR / diff / branch change, read the **review-checklist** skill (`.agents/skills/review-checklist/SKILL.md`) — it lists the recurring mistakes specific to this codebase.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Code generated by `npm run man:generate`; DO NOT EDIT.
|
||||
.\" Manual command details come from the Commander command tree.
|
||||
.TH LH 1 "" "@lobehub/cli 0.0.8" "User Commands"
|
||||
.TH LH 1 "" "@lobehub/cli 0.0.9" "User Commands"
|
||||
.SH NAME
|
||||
lh \- LobeHub CLI \- manage and connect to LobeHub services
|
||||
.SH SYNOPSIS
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lobehub/cli",
|
||||
"version": "0.0.8",
|
||||
"version": "0.0.9",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"lh": "./dist/index.js",
|
||||
|
||||
@@ -7,12 +7,14 @@ const CLIENT_ID = 'lobehub-cli';
|
||||
* Get a valid access token, refreshing if expired.
|
||||
* Returns null if no credentials or refresh fails.
|
||||
*/
|
||||
export async function getValidToken(): Promise<{ credentials: StoredCredentials } | null> {
|
||||
export async function getValidToken(
|
||||
bufferSeconds = 60,
|
||||
): Promise<{ credentials: StoredCredentials } | null> {
|
||||
const credentials = loadCredentials();
|
||||
if (!credentials) return null;
|
||||
|
||||
// Check if token is still valid (with 60s buffer)
|
||||
if (credentials.expiresAt && Date.now() / 1000 < credentials.expiresAt - 60) {
|
||||
// Check if token is still valid (with configurable buffer)
|
||||
if (credentials.expiresAt && Date.now() / 1000 < credentials.expiresAt - bufferSeconds) {
|
||||
return { credentials };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { Command } from 'commander';
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
vi.mock('../auth/refresh', () => ({
|
||||
getValidToken: vi.fn().mockResolvedValue({
|
||||
credentials: { accessToken: 'test-token', expiresAt: undefined, refreshToken: 'test-refresh' },
|
||||
}),
|
||||
}));
|
||||
vi.mock('../auth/resolveToken', () => ({
|
||||
resolveToken: vi.fn().mockResolvedValue({
|
||||
serverUrl: 'https://app.lobehub.com',
|
||||
@@ -83,16 +88,21 @@ vi.mock('@lobechat/device-gateway-client', () => ({
|
||||
on: vi.fn().mockImplementation((event: string, handler: (...args: any[]) => any) => {
|
||||
clientEventHandlers[event] = handler;
|
||||
}),
|
||||
reconnect: vi.fn().mockResolvedValue(undefined),
|
||||
sendSystemInfoResponse: vi.fn().mockImplementation((data: any) => {
|
||||
lastSentSystemInfoResponse = data;
|
||||
}),
|
||||
sendToolCallResponse: vi.fn().mockImplementation((data: any) => {
|
||||
lastSentToolResponse = data;
|
||||
}),
|
||||
updateToken: vi.fn(),
|
||||
};
|
||||
}),
|
||||
}));
|
||||
|
||||
// eslint-disable-next-line import-x/first
|
||||
import { GatewayClient } from '@lobechat/device-gateway-client';
|
||||
|
||||
// eslint-disable-next-line import-x/first
|
||||
import { resolveToken } from '../auth/resolveToken';
|
||||
// eslint-disable-next-line import-x/first
|
||||
@@ -242,13 +252,33 @@ describe('connect command', () => {
|
||||
const program = createProgram();
|
||||
await program.parseAsync(['node', 'test', 'connect']);
|
||||
|
||||
clientEventHandlers['auth_failed']?.('invalid token');
|
||||
await clientEventHandlers['auth_failed']?.('invalid token');
|
||||
|
||||
expect(log.error).toHaveBeenCalledWith(expect.stringContaining('Authentication failed'));
|
||||
expect(cleanupAllProcesses).toHaveBeenCalled();
|
||||
expect(exitSpy).toHaveBeenCalledWith(1);
|
||||
});
|
||||
|
||||
it('should retry auth_failed with token refresh when new token available', async () => {
|
||||
vi.mocked(resolveToken).mockResolvedValueOnce({
|
||||
serverUrl: 'https://app.lobehub.com',
|
||||
token: 'refreshed-token',
|
||||
tokenType: 'jwt',
|
||||
userId: 'test-user',
|
||||
});
|
||||
|
||||
const program = createProgram();
|
||||
await program.parseAsync(['node', 'test', 'connect']);
|
||||
|
||||
const mockClient = vi.mocked(GatewayClient).mock.results[0].value;
|
||||
|
||||
await clientEventHandlers['auth_failed']?.('token expired');
|
||||
|
||||
expect(log.info).toHaveBeenCalledWith(expect.stringContaining('Token refreshed'));
|
||||
expect(mockClient.updateToken).toHaveBeenCalledWith('refreshed-token');
|
||||
expect(exitSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should handle auth_expired', async () => {
|
||||
vi.mocked(resolveToken).mockResolvedValueOnce({
|
||||
serverUrl: 'https://app.lobehub.com',
|
||||
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
import { GatewayClient } from '@lobechat/device-gateway-client';
|
||||
import type { Command } from 'commander';
|
||||
|
||||
import { getValidToken } from '../auth/refresh';
|
||||
import { resolveToken } from '../auth/resolveToken';
|
||||
import { CLI_API_KEY_ENV } from '../constants/auth';
|
||||
import { OFFICIAL_GATEWAY_URL } from '../constants/urls';
|
||||
@@ -284,8 +285,44 @@ async function runConnect(options: ConnectOptions, isDaemonChild: boolean) {
|
||||
updateStatus('reconnecting');
|
||||
});
|
||||
|
||||
// Handle auth failed
|
||||
client.on('auth_failed', (reason) => {
|
||||
// Proactive token refresh — schedule before JWT expires
|
||||
const startProactiveRefresh = () =>
|
||||
scheduleProactiveRefresh(
|
||||
auth,
|
||||
(refreshed) => {
|
||||
client.updateToken(refreshed.token);
|
||||
auth = refreshed;
|
||||
// Schedule next refresh based on the new token
|
||||
cancelRefreshTimer = startProactiveRefresh();
|
||||
},
|
||||
info,
|
||||
error,
|
||||
);
|
||||
let cancelRefreshTimer = startProactiveRefresh();
|
||||
|
||||
// Handle auth failed — attempt token refresh once before giving up
|
||||
// (e.g., auto-reconnect may send an expired JWT before proactive refresh fires)
|
||||
let authFailedRefreshAttempted = false;
|
||||
client.on('auth_failed', async (reason) => {
|
||||
if (auth.tokenType === 'jwt' && !authFailedRefreshAttempted) {
|
||||
authFailedRefreshAttempted = true;
|
||||
info(`Authentication failed (${reason}). Attempting token refresh...`);
|
||||
try {
|
||||
const refreshed = await resolveToken({});
|
||||
if (refreshed && refreshed.token !== auth.token) {
|
||||
info('Token refreshed successfully. Reconnecting...');
|
||||
client.updateToken(refreshed.token);
|
||||
auth = refreshed;
|
||||
authFailedRefreshAttempted = false;
|
||||
cancelRefreshTimer = startProactiveRefresh();
|
||||
await client.reconnect();
|
||||
return;
|
||||
}
|
||||
} catch {
|
||||
// fall through
|
||||
}
|
||||
}
|
||||
|
||||
error(`Authentication failed: ${reason}`);
|
||||
error(
|
||||
`Run 'lh login', or set ${CLI_API_KEY_ENV} and run 'lh login --server <url>' to configure API key authentication.`,
|
||||
@@ -308,8 +345,8 @@ async function runConnect(options: ConnectOptions, isDaemonChild: boolean) {
|
||||
if (refreshed) {
|
||||
info('Token refreshed successfully. Reconnecting...');
|
||||
client.updateToken(refreshed.token);
|
||||
// Update cached auth so subsequent refreshes use the latest token
|
||||
auth = refreshed;
|
||||
cancelRefreshTimer = startProactiveRefresh();
|
||||
await client.reconnect();
|
||||
return;
|
||||
}
|
||||
@@ -330,6 +367,7 @@ async function runConnect(options: ConnectOptions, isDaemonChild: boolean) {
|
||||
// Graceful shutdown
|
||||
const cleanup = () => {
|
||||
info('Shutting down...');
|
||||
cancelRefreshTimer?.();
|
||||
cleanupAllProcesses();
|
||||
client.disconnect();
|
||||
removeStatus();
|
||||
@@ -374,6 +412,69 @@ function formatUptime(startedAt: Date): string {
|
||||
return `${seconds}s`;
|
||||
}
|
||||
|
||||
// How far before expiry to proactively refresh (1 hour)
|
||||
const PROACTIVE_REFRESH_BUFFER = 60 * 60;
|
||||
|
||||
/**
|
||||
* Parse the `exp` claim from a JWT without verifying the signature.
|
||||
*/
|
||||
function parseJwtExp(token: string): number | undefined {
|
||||
try {
|
||||
const payload = JSON.parse(Buffer.from(token.split('.')[1], 'base64url').toString());
|
||||
return typeof payload.exp === 'number' ? payload.exp : undefined;
|
||||
} catch {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedule a proactive token refresh before the JWT expires.
|
||||
* Returns a cleanup function that cancels the scheduled timer.
|
||||
*/
|
||||
function scheduleProactiveRefresh(
|
||||
auth: { token: string; tokenType: string },
|
||||
onRefreshed: (newAuth: Awaited<ReturnType<typeof resolveToken>>) => void,
|
||||
info: (msg: string) => void,
|
||||
error: (msg: string) => void,
|
||||
): (() => void) | null {
|
||||
if (auth.tokenType !== 'jwt') return null;
|
||||
|
||||
const exp = parseJwtExp(auth.token);
|
||||
if (!exp) return null;
|
||||
|
||||
const refreshAt = (exp - PROACTIVE_REFRESH_BUFFER) * 1000;
|
||||
const delay = refreshAt - Date.now();
|
||||
|
||||
if (delay < 0) {
|
||||
// Already past the refresh window — refresh immediately on next tick
|
||||
void doRefresh();
|
||||
return null;
|
||||
}
|
||||
|
||||
const timer = setTimeout(() => void doRefresh(), delay);
|
||||
return () => clearTimeout(timer);
|
||||
|
||||
async function doRefresh() {
|
||||
try {
|
||||
// Use the same buffer so getValidToken actually triggers a refresh
|
||||
const result = await getValidToken(PROACTIVE_REFRESH_BUFFER);
|
||||
if (!result) {
|
||||
error('Proactive token refresh failed — no valid credentials.');
|
||||
return;
|
||||
}
|
||||
|
||||
const refreshed = await resolveToken({});
|
||||
// Only notify if the token actually changed to avoid reschedule loops
|
||||
if (refreshed.token !== auth.token) {
|
||||
info('Proactively refreshed token.');
|
||||
onRefreshed(refreshed);
|
||||
}
|
||||
} catch {
|
||||
error('Proactive token refresh failed.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function collectSystemInfo(): DeviceSystemInfo {
|
||||
const home = os.homedir();
|
||||
const platform = process.platform;
|
||||
|
||||
@@ -9,6 +9,61 @@ import { registerTextCommand } from './text';
|
||||
import { registerTtsCommand } from './tts';
|
||||
import { registerVideoCommand } from './video';
|
||||
|
||||
/**
|
||||
* Parse a tRPC/server error and return a user-friendly message for gen status/download.
|
||||
*
|
||||
* getGenerationStatus throws NOT_FOUND in two distinct cases:
|
||||
* 1. "Async task not found" → asyncTaskId is wrong (user passed gen_xxx instead of UUID)
|
||||
* 2. "Generation not found" → generationId is wrong
|
||||
*
|
||||
* INTERNAL_SERVER_ERROR with a message mentioning "async_tasks" also indicates a bad asyncTaskId
|
||||
* (e.g. the server SQL query fails when a non-UUID is passed).
|
||||
*/
|
||||
function parseGenStatusError(
|
||||
err: any,
|
||||
generationId: string,
|
||||
asyncTaskId: string,
|
||||
command: 'status' | 'download',
|
||||
): string | null {
|
||||
const code = err?.data?.code || err?.shape?.data?.code;
|
||||
const message: string = err?.message || err?.shape?.message || '';
|
||||
|
||||
const isAsyncTaskNotFound =
|
||||
(code === 'NOT_FOUND' && message.includes('Async task not found')) ||
|
||||
(code === 'INTERNAL_SERVER_ERROR' && message.includes('async_tasks'));
|
||||
|
||||
const isGenerationNotFound = code === 'NOT_FOUND' && message.includes('Generation not found');
|
||||
|
||||
if (isAsyncTaskNotFound) {
|
||||
return (
|
||||
`${pc.red('✗')} Async task not found: ${pc.bold(asyncTaskId)}\n` +
|
||||
`\n` +
|
||||
` The second argument must be the ${pc.bold('asyncTaskId')} — the UUID printed after\n` +
|
||||
` "→ Task" in the video/image output, not the generation ID (gen_xxx).\n` +
|
||||
`\n` +
|
||||
` Example output from "lh gen video":\n` +
|
||||
` Generation ${pc.bold('gen_abc123')} → Task ${pc.dim('7ad0eb13-e9a5-4403-8070-1f7fe95b2f95')}\n` +
|
||||
`\n` +
|
||||
` Correct usage:\n` +
|
||||
` ${pc.cyan(`lh gen ${command} gen_abc123 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95`)}`
|
||||
);
|
||||
}
|
||||
|
||||
if (isGenerationNotFound) {
|
||||
return (
|
||||
`${pc.red('✗')} Generation not found: ${pc.bold(generationId)}\n` +
|
||||
`\n` +
|
||||
` The first argument must be the ${pc.bold('generationId')} (gen_xxx) from the\n` +
|
||||
` video/image output.\n` +
|
||||
`\n` +
|
||||
` Correct usage:\n` +
|
||||
` ${pc.cyan(`lh gen ${command} <generationId> <asyncTaskId>`)}`
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
export function registerGenerateCommand(program: Command) {
|
||||
const generate = program
|
||||
.command('generate')
|
||||
@@ -23,15 +78,26 @@ export function registerGenerateCommand(program: Command) {
|
||||
|
||||
// ── status ──────────────────────────────────────────
|
||||
generate
|
||||
.command('status <generationId> <taskId>')
|
||||
.command('status <generationId> <asyncTaskId>')
|
||||
.description('Check generation task status')
|
||||
.option('--json', 'Output raw JSON')
|
||||
.action(async (generationId: string, taskId: string, options: { json?: boolean }) => {
|
||||
.action(async (generationId: string, asyncTaskId: string, options: { json?: boolean }) => {
|
||||
const client = await getTrpcClient();
|
||||
const result = await client.generation.getGenerationStatus.query({
|
||||
asyncTaskId: taskId,
|
||||
generationId,
|
||||
});
|
||||
|
||||
let result: any;
|
||||
try {
|
||||
result = await client.generation.getGenerationStatus.query({
|
||||
asyncTaskId,
|
||||
generationId,
|
||||
});
|
||||
} catch (err: any) {
|
||||
const msg = parseGenStatusError(err, generationId, asyncTaskId, 'status');
|
||||
if (msg) {
|
||||
console.error(msg);
|
||||
process.exit(1);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
if (options.json) {
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
@@ -53,7 +119,7 @@ export function registerGenerateCommand(program: Command) {
|
||||
|
||||
// ── download ──────────────────────────────────────────
|
||||
generate
|
||||
.command('download <generationId> <taskId>')
|
||||
.command('download <generationId> <asyncTaskId>')
|
||||
.description('Wait for generation to complete and download the result')
|
||||
.option('-o, --output <path>', 'Output file path (default: auto-detect from asset)')
|
||||
.option('--interval <sec>', 'Polling interval in seconds', '5')
|
||||
@@ -61,7 +127,7 @@ export function registerGenerateCommand(program: Command) {
|
||||
.action(
|
||||
async (
|
||||
generationId: string,
|
||||
taskId: string,
|
||||
asyncTaskId: string,
|
||||
options: { interval?: string; output?: string; timeout?: string },
|
||||
) => {
|
||||
const client = await getTrpcClient();
|
||||
@@ -73,10 +139,20 @@ export function registerGenerateCommand(program: Command) {
|
||||
|
||||
// Poll for completion
|
||||
while (true) {
|
||||
const result = (await client.generation.getGenerationStatus.query({
|
||||
asyncTaskId: taskId,
|
||||
generationId,
|
||||
})) as any;
|
||||
let result: any;
|
||||
try {
|
||||
result = await client.generation.getGenerationStatus.query({
|
||||
asyncTaskId,
|
||||
generationId,
|
||||
});
|
||||
} catch (err: any) {
|
||||
const msg = parseGenStatusError(err, generationId, asyncTaskId, 'download');
|
||||
if (msg) {
|
||||
console.error(`\n${msg}`);
|
||||
process.exit(1);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
if (result.status === 'success' && result.generation) {
|
||||
const gen = result.generation;
|
||||
@@ -125,7 +201,7 @@ export function registerGenerateCommand(program: Command) {
|
||||
console.log(
|
||||
`${pc.red('✗')} Timed out after ${options.timeout}s. Task still ${result.status}.`,
|
||||
);
|
||||
console.log(pc.dim(`Run "lh gen status ${generationId} ${taskId}" to check later.`));
|
||||
console.log(pc.dim(`Run "lh gen status ${generationId} ${asyncTaskId}" to check later.`));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
"cookie": "^1.1.1",
|
||||
"cross-env": "^10.1.0",
|
||||
"diff": "^8.0.4",
|
||||
"electron": "41.1.0",
|
||||
"electron": "41.3.0",
|
||||
"electron-builder": "^26.8.1",
|
||||
"electron-devtools-installer": "4.0.0",
|
||||
"electron-is": "^3.0.0",
|
||||
|
||||
@@ -155,6 +155,9 @@ export default class NotificationCtr extends ControllerModule {
|
||||
const mainWindow = this.app.browserManager.getMainWindow();
|
||||
mainWindow.show();
|
||||
mainWindow.browserWindow.focus();
|
||||
if (params.navigate?.path) {
|
||||
mainWindow.broadcast('navigate', params.navigate);
|
||||
}
|
||||
});
|
||||
|
||||
notification.on('close', () => {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
"https://file.rene.wang/540830955-0fe626a3-0ddc-4f67-b595-3c5b3f1701e0.png": "/blog/assetsa8e504275f2cd891fabecca985998de0.webp",
|
||||
"https://file.rene.wang/changlog-04-14.png": "/blog/assets300abe7e259d293da6c5ed4f642a1be6.webp",
|
||||
"https://file.rene.wang/changlog-04-14.png": "/blog/assets300abe7e259d293da6c5ed4f642a1be6.webp",
|
||||
"https://file.rene.wang/clipboard-1768907980491-9cc0669fc3a38.png": "/blog/assets8be3a46c8f9c5d3b61bc541f44b7f245.webp",
|
||||
"https://file.rene.wang/clipboard-1768908081787-ed9eb1cb78bdb.png": "/blog/assetsab009b79dd794f02aec24b7607f342e8.webp",
|
||||
"https://file.rene.wang/clipboard-1768908121691-b3517bf882633.png": "/blog/assetsd3cae44cba0d3f57df6440b46246e5e7.webp",
|
||||
@@ -53,7 +52,6 @@
|
||||
"https://file.rene.wang/clipboard-1770266335710-1fec523143aab.png": "/blog/assets636c78daf95c590cd7d80284c68eb6d9.webp",
|
||||
"https://file.rene.wang/clipboard-1774923001079-89ce6aa271a62.png": "/blog/assets53e6ec9cf72554dbc1f8224fc0550a03.webp",
|
||||
"https://file.rene.wang/clipboard-1775701725582-123f8f8cf73f8.png": "/blog/assets7ea204859aeb5aa9be5810a20ba1669a.webp",
|
||||
"https://file.rene.wang/clipboard-1775701725582-123f8f8cf73f8.png": "/blog/assets7ea204859aeb5aa9be5810a20ba1669a.webp",
|
||||
"https://file.rene.wang/clipboard-1776909505252-94b051f3ea0a7.png": "/blog/assetsdfda32866c4bc59af0526e52f31d1da2.webp",
|
||||
"https://file.rene.wang/lobehub/467951f5-ad65-498d-aea9-fca8f35a4314.png": "/blog/assets907ea775d228958baca38e2dbb65939a.webp",
|
||||
"https://file.rene.wang/lobehub/58d91528-373a-4a42-b520-cf6cb1f8ce1e.png": "/blog/assets7dccdd4df55aede71001da649639437f.webp",
|
||||
@@ -470,5 +468,6 @@
|
||||
"https://github.com/user-attachments/assets/fa8fab19-ace2-4f85-8428-a3a0e28845bb": "/blog/assets/2d678631c55369ba7d753c3ffcb73782.webp",
|
||||
"https://github.com/user-attachments/assets/facdc83c-e789-4649-8060-7f7a10a1b1dd": "/blog/assets05b20e40c03ced0ec8707fed2e8e0f25.webp",
|
||||
"https://github.com/user-attachments/assets/fcdfb9c5-819a-488f-b28d-0857fe861219": "/blog/assets8477415ecec1f37e38ab38ff1217d0a7.webp",
|
||||
"https://github.com/user-attachments/assets/fd60ab55-ead2-4930-ad00-fdf77662f5a0": "/blog/assets276a4e8748e9bd300b30dcd9d0e24980.webp"
|
||||
}
|
||||
"https://github.com/user-attachments/assets/fd60ab55-ead2-4930-ad00-fdf77662f5a0": "/blog/assets276a4e8748e9bd300b30dcd9d0e24980.webp",
|
||||
"https://file.rene.wang/clipboard-1777343750668-9b3dcb0dfff86.png": "/blog/assetsfa267a02f20bc5ba6f1273bcf27b7c9f.webp"
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
title: 'Plugin System: Extend Your Agents with Community Skills'
|
||||
description: LobeHub now supports a plugin ecosystem that lets Agents access real-time information, interact with external services, and handle specialized tasks without leaving the conversation.
|
||||
description: >-
|
||||
LobeHub now supports a plugin ecosystem that lets Agents access real-time
|
||||
information, interact with external services, and handle specialized tasks
|
||||
without leaving the conversation.
|
||||
tags:
|
||||
- LobeHub
|
||||
- Plugins
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: '插件系统:用社区技能扩展你的助理'
|
||||
title: 插件系统:用社区技能扩展你的助理
|
||||
description: LobeHub 现已支持插件生态,让助理能够获取实时信息、与外部服务交互,并在对话中处理各种专业任务。
|
||||
tags:
|
||||
- LobeHub
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
title: 'Visual Recognition: Chat With Images, Not Just Text'
|
||||
description: LobeHub now supports multimodal models including GPT-4 Vision, Google Gemini Pro Vision, and GLM-4 Vision. Upload or drag images into conversations and your Agent will understand and respond to visual content.
|
||||
description: >-
|
||||
LobeHub now supports multimodal models including GPT-4 Vision, Google Gemini
|
||||
Pro Vision, and GLM-4 Vision. Upload or drag images into conversations and
|
||||
your Agent will understand and respond to visual content.
|
||||
tags:
|
||||
- Visual Recognition
|
||||
- LobeHub
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: '视觉识别:与图片对话,不只是文字'
|
||||
description: LobeHub 现已支持多模态模型,包括 GPT-4 Vision、Google Gemini Pro Vision 和 GLM-4 Vision。上传或拖拽图片到对话中,助理将理解视觉内容并作出回应。
|
||||
title: 视觉识别:与图片对话,不只是文字
|
||||
description: >-
|
||||
LobeHub 现已支持多模态模型,包括 GPT-4 Vision、Google Gemini Pro Vision 和 GLM-4
|
||||
Vision。上传或拖拽图片到对话中,助理将理解视觉内容并作出回应。
|
||||
tags:
|
||||
- 视觉识别
|
||||
- 多模态交互
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
title: 'Voice Conversations: Talk Naturally With Your Agents'
|
||||
description: LobeHub now supports Text-to-Speech (TTS) and Speech-to-Text (STT), enabling natural voice interactions. Speak with your Agents and hear responses in clear, personalized voices.
|
||||
description: >-
|
||||
LobeHub now supports Text-to-Speech (TTS) and Speech-to-Text (STT), enabling
|
||||
natural voice interactions. Speak with your Agents and hear responses in
|
||||
clear, personalized voices.
|
||||
tags:
|
||||
- TTS
|
||||
- STT
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: '语音会话:与你的助理自然对话'
|
||||
title: 语音会话:与你的助理自然对话
|
||||
description: LobeHub 现已支持文字转语音(TTS)和语音转文字(STT),实现自然的语音交互。与助理对话并听到清晰、个性化的语音回复。
|
||||
tags:
|
||||
- TTS
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
---
|
||||
title: 'Text-to-Image: Create Visuals Directly in Chat'
|
||||
description: LobeHub now supports text-to-image generation. Invoke DALL-E 3, MidJourney, or Pollinations directly during conversations to turn your ideas into images without leaving the chat.
|
||||
description: >-
|
||||
LobeHub now supports text-to-image generation. Invoke DALL-E 3, MidJourney, or
|
||||
Pollinations directly during conversations to turn your ideas into images
|
||||
without leaving the chat.
|
||||
tags:
|
||||
- Text-to-Image
|
||||
- LobeHub
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: '文生图:在对话中直接创作视觉内容'
|
||||
description: LobeHub 现已支持文本到图片生成。在对话中直接调用 DALL-E 3、MidJourney 或 Pollinations,无需离开聊天界面即可将想法转化为图像。
|
||||
title: 文生图:在对话中直接创作视觉内容
|
||||
description: >-
|
||||
LobeHub 现已支持文本到图片生成。在对话中直接调用 DALL-E 3、MidJourney 或
|
||||
Pollinations,无需离开聊天界面即可将想法转化为图像。
|
||||
tags:
|
||||
- Text to Image
|
||||
- 文生图
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: 灵活适配的认证体系:Clerk 与 Next-Auth 双方案支持
|
||||
description: >-
|
||||
LobeHub 现已支持 Clerk 和 Next-Auth 两种认证方案,让团队可以根据部署模式和安全需求选择最适合的身份验证方式。
|
||||
description: LobeHub 现已支持 Clerk 和 Next-Auth 两种认证方案,让团队可以根据部署模式和安全需求选择最适合的身份验证方式。
|
||||
tags:
|
||||
- 用户管理
|
||||
- 身份验证
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: 本地模型与云端 AI 并行使用
|
||||
description: >-
|
||||
LobeHub v0.127.0 新增 Ollama 支持,让你可以用与云端模型相同的界面运行本地大语言模型。
|
||||
description: LobeHub v0.127.0 新增 Ollama 支持,让你可以用与云端模型相同的界面运行本地大语言模型。
|
||||
tags:
|
||||
- Ollama AI
|
||||
- LobeHub
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: LobeHub 1.0:为持久化、多用户协作而生的新架构
|
||||
description: >-
|
||||
LobeHub 1.0 引入服务端数据库支持和完善的用户管理体系,实现知识库、跨设备同步和团队协作能力。
|
||||
LobeHub Cloud 同步开启 Beta 测试,内置全部新特性。
|
||||
LobeHub 1.0 引入服务端数据库支持和完善的用户管理体系,实现知识库、跨设备同步和团队协作能力。 LobeHub Cloud 同步开启 Beta
|
||||
测试,内置全部新特性。
|
||||
tags:
|
||||
- LobeHub
|
||||
- 服务端数据库
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
---
|
||||
title: LobeHub v1.6:GPT-4o mini 成为默认模型选项
|
||||
description: >-
|
||||
LobeHub v1.6 新增 GPT-4o mini 支持,同时 LobeHub Cloud 将默认模型升级为
|
||||
GPT-4o mini,让开箱即用的对话体验更进一步。
|
||||
LobeHub v1.6 新增 GPT-4o mini 支持,同时 LobeHub Cloud 将默认模型升级为 GPT-4o
|
||||
mini,让开箱即用的对话体验更进一步。
|
||||
tags:
|
||||
- LobeHub
|
||||
- GPT-4o mini
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'LobeHub Enters the Era of Artifacts'
|
||||
title: LobeHub Enters the Era of Artifacts
|
||||
description: >-
|
||||
LobeHub v1.19 brings significant updates, including full feature support for
|
||||
Claude Artifacts, a brand new discovery page design, and support for GitHub
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: '重磅更新:LobeHub 迎来 Artifacts 时代'
|
||||
title: 重磅更新:LobeHub 迎来 Artifacts 时代
|
||||
description: >-
|
||||
LobeHub v1.19 带来了重大更新,包括 Claude Artifacts 完整特性支持、全新的发现页面设计,以及 GitHub Models
|
||||
服务商支持,让 AI 助手的能力得到显著提升。
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: Export Conversations as Markdown or OpenAI JSON
|
||||
description: >-
|
||||
LobeHub v1.28.0 adds Markdown and OpenAI-format JSON exports, making it
|
||||
easier to turn conversations into documentation, debugging payloads, or
|
||||
training datasets.
|
||||
LobeHub v1.28.0 adds Markdown and OpenAI-format JSON exports, making it easier
|
||||
to turn conversations into documentation, debugging payloads, or training
|
||||
datasets.
|
||||
tags:
|
||||
- Text Format Export
|
||||
- Markdown Export
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: 支持导出对话为 Markdown 或 OpenAI JSON 格式
|
||||
description: >-
|
||||
LobeHub v1.28.0 新增 Markdown 与 OpenAI 格式 JSON 导出,方便将对话转为文档、
|
||||
调试数据或训练语料。
|
||||
description: LobeHub v1.28.0 新增 Markdown 与 OpenAI 格式 JSON 导出,方便将对话转为文档、 调试数据或训练语料。
|
||||
tags:
|
||||
- 文本格式导出
|
||||
- Markdown 导出
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: 11 月更新 - 新增 4 家模型服务商
|
||||
description: >-
|
||||
LobeHub 新增支持 Gitee AI、InternLM、xAI 和 Cloudflare Workers AI,
|
||||
为团队提供更多模型接入选择。
|
||||
description: LobeHub 新增支持 Gitee AI、InternLM、xAI 和 Cloudflare Workers AI, 为团队提供更多模型接入选择。
|
||||
tags:
|
||||
- LobeHub
|
||||
- AI 模型服务
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: DeepSeek R1 Integration with Chain-of-Thought Transparency
|
||||
description: LobeHub now supports DeepSeek R1 with real-time reasoning display, making complex problem-solving more transparent and easier to follow.
|
||||
description: >-
|
||||
LobeHub now supports DeepSeek R1 with real-time reasoning display, making
|
||||
complex problem-solving more transparent and easier to follow.
|
||||
tags:
|
||||
- LobeHub
|
||||
- DeepSeek
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "50+ New Models and 10+ Providers Added to the Ecosystem"
|
||||
description: LobeHub expands its AI ecosystem with 50+ new models and 10+ providers, making it easier to access diverse AI capabilities without changing your workflow.
|
||||
title: 50+ New Models and 10+ Providers Added to the Ecosystem
|
||||
description: >-
|
||||
LobeHub expands its AI ecosystem with 50+ new models and 10+ providers, making
|
||||
it easier to access diverse AI capabilities without changing your workflow.
|
||||
tags:
|
||||
- LobeHub
|
||||
- Model Providers
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "AI 生态扩展:新增 50+ 模型与 10+ 服务商"
|
||||
title: AI 生态扩展:新增 50+ 模型与 10+ 服务商
|
||||
description: LobeHub 完成史上最大规模 AI 生态扩展,新增 50+ 模型和 10+ 服务商,让你无需改变工作流程即可接入更多 AI 能力。
|
||||
tags:
|
||||
- LobeHub
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "Customizable Hotkeys, Data Export, and Provider Expansion"
|
||||
description: LobeHub adds customizable hotkeys, data export functionality, and expands provider support to make daily workflows smoother and more portable.
|
||||
title: 'Customizable Hotkeys, Data Export, and Provider Expansion'
|
||||
description: >-
|
||||
LobeHub adds customizable hotkeys, data export functionality, and expands
|
||||
provider support to make daily workflows smoother and more portable.
|
||||
tags:
|
||||
- LobeHub
|
||||
- Hotkeys
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "快捷键自定义、数据导出与服务商扩展"
|
||||
title: 快捷键自定义、数据导出与服务商扩展
|
||||
description: LobeHub 新增快捷键自定义、数据导出功能,并扩展服务商支持,让日常使用更顺手、数据更可迁移。
|
||||
tags:
|
||||
- LobeHub
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "Lobe UI v2 Design System and Desktop App Launch"
|
||||
description: LobeHub launches a refreshed visual design with Lobe UI v2 and officially releases the desktop app for Windows and macOS.
|
||||
title: Lobe UI v2 Design System and Desktop App Launch
|
||||
description: >-
|
||||
LobeHub launches a refreshed visual design with Lobe UI v2 and officially
|
||||
releases the desktop app for Windows and macOS.
|
||||
tags:
|
||||
- Desktop App
|
||||
- LobeHub
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "Lobe UI v2 设计系统与桌面端正式发布"
|
||||
title: Lobe UI v2 设计系统与桌面端正式发布
|
||||
description: LobeHub 推出基于 Lobe UI v2 的全新视觉设计,并正式发布 Windows 与 macOS 桌面端应用。
|
||||
tags:
|
||||
- 桌面端
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: "Prompt Variables and Claude 4 Reasoning Model Support"
|
||||
description: LobeHub introduces prompt variables for reusable templates and adds full support for Claude 4 reasoning models with web search integration.
|
||||
title: Prompt Variables and Claude 4 Reasoning Model Support
|
||||
description: >-
|
||||
LobeHub introduces prompt variables for reusable templates and adds full
|
||||
support for Claude 4 reasoning models with web search integration.
|
||||
tags:
|
||||
- Prompt Variables
|
||||
- Claude 4
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "提示词变量与 Claude 4 推理模型支持"
|
||||
title: 提示词变量与 Claude 4 推理模型支持
|
||||
description: LobeHub 引入提示词变量实现模板复用,并完整支持 Claude 4 推理模型及网页搜索集成。
|
||||
tags:
|
||||
- 提示词变量
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: "MCP Marketplace and Search Provider Expansion \U0001F50D"
|
||||
description: >-
|
||||
MCP Marketplace is now live with one-click plugin installation, alongside expanded search providers and new SSO options for easier team access.
|
||||
MCP Marketplace is now live with one-click plugin installation, alongside
|
||||
expanded search providers and new SSO options for easier team access.
|
||||
tags:
|
||||
- MCP Marketplace
|
||||
- Best MCP
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: "Image Generation, Desktop, and Auth Updates \U0001F3A8"
|
||||
description: >-
|
||||
Generate AI images across multiple providers, connect with expanded identity options, and run desktop workflows with fewer interruptions.
|
||||
Generate AI images across multiple providers, connect with expanded identity
|
||||
options, and run desktop workflows with fewer interruptions.
|
||||
tags:
|
||||
- Image Generation
|
||||
- Desktop App
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 图像生成、桌面端与认证更新 🎨
|
||||
title: "图像生成、桌面端与认证更新 \U0001F3A8"
|
||||
description: 通过多个服务商生成 AI 图像,用更多身份系统完成接入,并在桌面端享受更顺畅的工作流。
|
||||
tags:
|
||||
- 图像生成
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
---
|
||||
title: "Gemini Image Generation and Non-Streaming Mode Support \U0001F3A8"
|
||||
description: >-
|
||||
Gemini 2.5 Flash Image generation, non-streaming response mode, and expanded model coverage give you more flexibility in how you generate and receive content.
|
||||
Gemini 2.5 Flash Image generation, non-streaming response mode, and expanded
|
||||
model coverage give you more flexibility in how you generate and receive
|
||||
content.
|
||||
tags:
|
||||
- Gemini
|
||||
- Nano Banana
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: "Claude Sonnet 4.5 and Built-in Python Plugin \U0001F40D"
|
||||
description: >-
|
||||
Run Python directly in chat with the new built-in plugin, navigate long conversations faster, and work with Claude Sonnet 4.5 and other new models.
|
||||
Run Python directly in chat with the new built-in plugin, navigate long
|
||||
conversations faster, and work with Claude Sonnet 4.5 and other new models.
|
||||
tags:
|
||||
- Claude Sonnet 4.5
|
||||
- Chain of Thought
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: ComfyUI Integration and Knowledge Base Improvements ⭐
|
||||
description: >-
|
||||
Run ComfyUI visual workflows directly in LobeHub, organize knowledge with waterfall layouts and auto-extraction, and share outputs as PDF.
|
||||
Run ComfyUI visual workflows directly in LobeHub, organize knowledge with
|
||||
waterfall layouts and auto-extraction, and share outputs as PDF.
|
||||
tags:
|
||||
- AI Knowledge Base
|
||||
- Workflow
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: "MCP Cloud Endpoints and Model Library Expansion \U0001F50C"
|
||||
description: >-
|
||||
Connect to managed MCP tools from the marketplace without self-hosting, while new providers and knowledge base pages improve daily workflows.
|
||||
Connect to managed MCP tools from the marketplace without self-hosting, while
|
||||
new providers and knowledge base pages improve daily workflows.
|
||||
tags:
|
||||
- MCP
|
||||
- LobeHub
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
title: Coding Agent — Claude Code & Codex on Desktop
|
||||
description: >-
|
||||
Claude Code and Codex graduate to first-class desktop runtimes, alongside a
|
||||
new Agent Signal runtime and a wave of flagship models.
|
||||
tags:
|
||||
- Heterogeneous Agent
|
||||
- Desktop
|
||||
- Models
|
||||
---
|
||||
|
||||
# Claude Code & Codex on Desktop
|
||||
|
||||
## Features
|
||||
|
||||
- Topic remembers its own scroll position
|
||||
- User message stays pinned to the viewport top with long messages folded, the last user message can be edited and resent inline, and follow-up sends queue cleanly during a concurrent turn.
|
||||
- Delegating 3rd party coding agents such as Claude Code and Codex
|
||||
- Quick chat and capture your screen and ask LobeHun with desktop app
|
||||
- New models: GPT-5.5, DeepSeek V4 Flash and Pro with a reasoning-effort slider, LobeHub-hosted gpt-image-2, Kimi K2.6, MiMo-V2.5 and Pro
|
||||
- New providers: OpenCode Zen and OpenCode Go.
|
||||
|
||||
## Improvements and fixes
|
||||
|
||||
- Disabled markdown streaming on the first assistant block to avoid mid-stream layout shifts.
|
||||
- Conversation no longer repins to the bottom after a manual scroll.
|
||||
- Tool inspectors render correctly for Codex and heterogeneous-agent follow-ups.
|
||||
- FileEditor migrated from antd Modal to base-ui Modal for consistent focus and keyboard behavior.
|
||||
- QStash heartbeat self-reschedules to keep long-running tasks alive.
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
title: 编程 Agent —— Claude Code 与 Codex 进入桌面端
|
||||
description: Claude Code 与 Codex 成为桌面端的一等运行时,全新 Agent Signal 运行时上线,并迎来一批旗舰模型。
|
||||
tags:
|
||||
- 异构 Agent
|
||||
- 桌面端
|
||||
- 模型
|
||||
---
|
||||
|
||||
# Claude Code 与 Codex 进入桌面端
|
||||
|
||||
## 新功能
|
||||
|
||||
- 话题级别记忆滚动位置
|
||||
- 用户消息固定在视口顶部,过长内容自动折叠;最后一条用户消息可直接编辑并重发;并发对话期间的后续发送会顺序排队
|
||||
- 接入 Claude Code、Codex 等第三方编程 Agent
|
||||
- 在桌面端通过 Quick Chat 与屏幕截图直接向 LobeHub 提问
|
||||
- 新模型:GPT-5.5、DeepSeek V4 Flash / Pro(带思考强度滑块)、LobeHub 托管的 gpt-image-2、Kimi K2.6、MiMo-V2.5 与 Pro
|
||||
- 新提供商:OpenCode Zen 与 OpenCode Go
|
||||
|
||||
## 体验优化与修复
|
||||
|
||||
- 第一条助手消息不再启用 Markdown 流式渲染,避免渲染过程中的布局抖动。
|
||||
- 手动滚动后不再重新自动钉住对话底部。
|
||||
- 修复了 Codex 与异构 Agent 后续轮次中工具检查器渲染异常的问题。
|
||||
- FileEditor 从 antd Modal 迁移到 base-ui Modal,焦点与键盘行为更一致。
|
||||
- QStash 心跳支持自我重调度,长任务运行更稳定。
|
||||
+154
-37
@@ -2,225 +2,342 @@
|
||||
"$schema": "https://github.com/lobehub/lobe-chat/blob/main/docs/changelog/schema.json",
|
||||
"cloud": [],
|
||||
"community": [
|
||||
{
|
||||
"image": "/blog/assetsfa267a02f20bc5ba6f1273bcf27b7c9f.webp",
|
||||
"id": "2026-04-27-heterogeneous-agent",
|
||||
"date": "2026-04-27",
|
||||
"versionRange": [
|
||||
"2.1.53"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assetsdfda32866c4bc59af0526e52f31d1da2.webp",
|
||||
"id": "2026-04-20-daily-brief",
|
||||
"date": "2026-04-20",
|
||||
"versionRange": ["2.1.50", "2.1.52"]
|
||||
"versionRange": [
|
||||
"2.1.50",
|
||||
"2.1.52"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets300abe7e259d293da6c5ed4f642a1be6.webp",
|
||||
"id": "2026-04-13-gateway-sidebar",
|
||||
"date": "2026-04-13",
|
||||
"versionRange": ["2.1.48", "2.1.49"]
|
||||
"versionRange": [
|
||||
"2.1.48",
|
||||
"2.1.49"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets7ea204859aeb5aa9be5810a20ba1669a.webp",
|
||||
"id": "2026-04-06-auto-completion",
|
||||
"date": "2026-04-06",
|
||||
"versionRange": ["2.1.47"]
|
||||
"versionRange": [
|
||||
"2.1.47"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "2026-03-30-agent-tasks",
|
||||
"date": "2026-03-30",
|
||||
"versionRange": ["2.1.45", "2.1.46"]
|
||||
"versionRange": [
|
||||
"2.1.45",
|
||||
"2.1.46"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets53e6ec9cf72554dbc1f8224fc0550a03.webp",
|
||||
"id": "2026-03-23-media-memory",
|
||||
"date": "2026-03-23",
|
||||
"versionRange": ["2.1.44"]
|
||||
"versionRange": [
|
||||
"2.1.44"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "https://hub-apac-1.lobeobjects.space/blog/assets/4a68a7644501cb513d08670b102a446e.webp",
|
||||
"id": "2026-03-16-search",
|
||||
"date": "2026-03-16",
|
||||
"versionRange": ["2.1.38", "2.1.43"]
|
||||
"versionRange": [
|
||||
"2.1.38",
|
||||
"2.1.43"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "2026-02-08-runtime-auth",
|
||||
"date": "2026-02-08",
|
||||
"versionRange": ["2.1.6", "2.1.26"]
|
||||
"versionRange": [
|
||||
"2.1.6",
|
||||
"2.1.26"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assetsa8e504275f2cd891fabecca985998de0.webp",
|
||||
"id": "2026-01-27-v2",
|
||||
"date": "2026-01-27",
|
||||
"versionRange": ["2.0.1", "2.1.5"]
|
||||
"versionRange": [
|
||||
"2.0.1",
|
||||
"2.1.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets7f3b38c1d76cceb91edb29d6b1eb60db.webp",
|
||||
"id": "2025-12-20-mcp",
|
||||
"date": "2025-12-20",
|
||||
"versionRange": ["1.142.8", "1.143.0"]
|
||||
"versionRange": [
|
||||
"1.142.8",
|
||||
"1.143.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets3a7f0b29839603336e39e923b423409b.webp",
|
||||
"id": "2025-11-08-comfy-ui",
|
||||
"date": "2025-11-08",
|
||||
"versionRange": ["1.133.5", "1.142.8"]
|
||||
"versionRange": [
|
||||
"1.133.5",
|
||||
"1.142.8"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets35e6aa692b0c16009c61964279514166.webp",
|
||||
"id": "2025-10-08-python",
|
||||
"date": "2025-10-08",
|
||||
"versionRange": ["1.120.7", "1.133.5"]
|
||||
"versionRange": [
|
||||
"1.120.7",
|
||||
"1.133.5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assetsce5d6dc93676f974be2e162e8ace03f0.webp",
|
||||
"id": "2025-09-08-gemini",
|
||||
"date": "2025-09-08",
|
||||
"versionRange": ["1.109.1", "1.120.7"]
|
||||
"versionRange": [
|
||||
"1.109.1",
|
||||
"1.120.7"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assetsdf48eed9de76b7e37c269b294285f09d.webp",
|
||||
"id": "2025-08-08-image-generation",
|
||||
"date": "2025-08-08",
|
||||
"versionRange": ["1.97.10", "1.109.1"]
|
||||
"versionRange": [
|
||||
"1.97.10",
|
||||
"1.109.1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets902eb746fe2042fc2ea831c71002be72.webp",
|
||||
"id": "2025-07-08-mcp-market",
|
||||
"date": "2025-07-08",
|
||||
"versionRange": ["1.93.3", "1.97.10"]
|
||||
"versionRange": [
|
||||
"1.93.3",
|
||||
"1.97.10"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets5cc27b8cae995074da20d4ffe06a1460.webp",
|
||||
"id": "2025-06-08-claude-4",
|
||||
"date": "2025-06-08",
|
||||
"versionRange": ["1.84.27", "1.93.3"]
|
||||
"versionRange": [
|
||||
"1.84.27",
|
||||
"1.93.3"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets2a36d86a4eed6e7938dd6e9c684701ed.webp",
|
||||
"id": "2025-05-08-desktop-app",
|
||||
"date": "2025-05-08",
|
||||
"versionRange": ["1.77.17", "1.84.27"]
|
||||
"versionRange": [
|
||||
"1.77.17",
|
||||
"1.84.27"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assetsc0efdb82443556ae3acefe00099b3f23.webp",
|
||||
"id": "2025-04-06-exports",
|
||||
"date": "2025-04-06",
|
||||
"versionRange": ["1.67.2", "1.77.17"]
|
||||
"versionRange": [
|
||||
"1.67.2",
|
||||
"1.77.17"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assetse743f0a47127390dde766a0a790476db.webp",
|
||||
"id": "2025-03-02-new-models",
|
||||
"date": "2025-03-02",
|
||||
"versionRange": ["1.49.13", "1.67.2"]
|
||||
"versionRange": [
|
||||
"1.49.13",
|
||||
"1.67.2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets18168d5fe64ea34905a7e52fd82d0e9d.webp",
|
||||
"id": "2025-02-02-deepseek-r1",
|
||||
"date": "2025-02-02",
|
||||
"versionRange": ["1.47.8", "1.49.12"]
|
||||
"versionRange": [
|
||||
"1.47.8",
|
||||
"1.49.12"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assetsf9ed064fe764cbeff2f46910e7099a91.webp",
|
||||
"id": "2025-01-22-new-ai-provider",
|
||||
"date": "2025-01-22",
|
||||
"versionRange": ["1.43.1", "1.47.7"]
|
||||
"versionRange": [
|
||||
"1.43.1",
|
||||
"1.47.7"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets2d409f43b58953ad5396c6beab8a0719.webp",
|
||||
"id": "2025-01-03-user-profile",
|
||||
"date": "2025-01-03",
|
||||
"versionRange": ["1.34.1", "1.43.0"]
|
||||
"versionRange": [
|
||||
"1.34.1",
|
||||
"1.43.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/d9cbfcbef130183bc490d515d8a38aa4.webp",
|
||||
"id": "2024-11-27-forkable-chat",
|
||||
"date": "2024-11-27",
|
||||
"versionRange": ["1.33.1", "1.34.0"]
|
||||
"versionRange": [
|
||||
"1.33.1",
|
||||
"1.34.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/2d678631c55369ba7d753c3ffcb73782.webp",
|
||||
"id": "2024-11-25-november-providers",
|
||||
"date": "2024-11-25",
|
||||
"versionRange": ["1.30.1", "1.33.0"]
|
||||
"versionRange": [
|
||||
"1.30.1",
|
||||
"1.33.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/f10a4b98782e36797c38071eed785c6f.webp",
|
||||
"id": "2024-11-06-share-text-json",
|
||||
"date": "2024-11-06",
|
||||
"versionRange": ["1.26.1", "1.28.0"]
|
||||
"versionRange": [
|
||||
"1.26.1",
|
||||
"1.28.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/944c671604833cd2457445b211ebba33.webp",
|
||||
"id": "2024-10-27-pin-assistant",
|
||||
"date": "2024-10-27",
|
||||
"versionRange": ["1.19.1", "1.26.0"]
|
||||
"versionRange": [
|
||||
"1.19.1",
|
||||
"1.26.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/f6d047a345e47a52592cff916c9a64ce.webp",
|
||||
"id": "2024-09-20-artifacts",
|
||||
"date": "2024-09-20",
|
||||
"versionRange": ["1.17.1", "1.19.0"]
|
||||
"versionRange": [
|
||||
"1.17.1",
|
||||
"1.19.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/d7e57f8e69f97b76b3c2414f3441b6e4.webp",
|
||||
"id": "2024-09-13-openai-o1-models",
|
||||
"date": "2024-09-13",
|
||||
"versionRange": ["1.12.1", "1.17.0"]
|
||||
"versionRange": [
|
||||
"1.12.1",
|
||||
"1.17.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/d6129350de510a62fe87b2d2f0fb9477.webp",
|
||||
"id": "2024-08-21-file-upload-and-knowledge-base",
|
||||
"date": "2024-08-21",
|
||||
"versionRange": ["1.8.1", "1.12.0"]
|
||||
"versionRange": [
|
||||
"1.8.1",
|
||||
"1.12.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/37d85fdfccff9ed56e9c6827faee01c7.webp",
|
||||
"id": "2024-08-02-lobe-chat-database-docker",
|
||||
"date": "2024-08-02",
|
||||
"versionRange": ["1.6.1", "1.8.0"]
|
||||
"versionRange": [
|
||||
"1.6.1",
|
||||
"1.8.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/39d7890f8cbe21e77db8d3c94f7f22e4.webp",
|
||||
"id": "2024-07-19-gpt-4o-mini",
|
||||
"date": "2024-07-19",
|
||||
"versionRange": ["1.0.1", "1.6.0"]
|
||||
"versionRange": [
|
||||
"1.0.1",
|
||||
"1.6.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/eb477e62217f4d1b644eff975c7ac168.webp",
|
||||
"id": "2024-06-19-lobe-chat-v1",
|
||||
"date": "2024-06-19",
|
||||
"versionRange": ["0.147.0", "1.0.0"]
|
||||
"versionRange": [
|
||||
"0.147.0",
|
||||
"1.0.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/8a8d361b4c0cce6da350cc0de65c0ad6.webp",
|
||||
"id": "2024-02-14-ollama",
|
||||
"date": "2024-02-14",
|
||||
"versionRange": ["0.125.1", "0.127.0"]
|
||||
"versionRange": [
|
||||
"0.125.1",
|
||||
"0.127.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/9498087e85f27e692716a63cb3b58d79.webp",
|
||||
"id": "2024-02-08-sso-oauth",
|
||||
"date": "2024-02-08",
|
||||
"versionRange": ["0.118.1", "0.125.0"]
|
||||
"versionRange": [
|
||||
"0.118.1",
|
||||
"0.125.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/603fefbb944bc6761ebdab5956fc0084.webp",
|
||||
"id": "2023-12-22-dalle-3",
|
||||
"date": "2023-12-22",
|
||||
"versionRange": ["0.102.1", "0.118.0"]
|
||||
"versionRange": [
|
||||
"0.102.1",
|
||||
"0.118.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/8d4c2cc0ce8654fa8ac06cc036a7f941.webp",
|
||||
"id": "2023-11-19-tts-stt",
|
||||
"date": "2023-11-19",
|
||||
"versionRange": ["0.101.1", "0.102.0"]
|
||||
"versionRange": [
|
||||
"0.101.1",
|
||||
"0.102.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/d47654360d626f80144cdedb979a3526.webp",
|
||||
"id": "2023-11-14-gpt4-vision",
|
||||
"date": "2023-11-14",
|
||||
"versionRange": ["0.90.0", "0.101.0"]
|
||||
"versionRange": [
|
||||
"0.90.0",
|
||||
"0.101.0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"image": "/blog/assets/50b38eac1769ae6f13aef72f3d725eec.webp",
|
||||
"id": "2023-09-09-plugin-system",
|
||||
"date": "2023-09-09",
|
||||
"versionRange": ["0.67.0", "0.72.0"]
|
||||
"versionRange": [
|
||||
"0.67.0",
|
||||
"0.72.0"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -123,6 +123,26 @@ By connecting a Discord channel to your LobeHub agent, users can interact with t
|
||||
|
||||
Back in LobeHub's channel settings for Discord, click **Test Connection** to verify everything is configured correctly. Then send a message to your bot in Discord to confirm it responds.
|
||||
|
||||
## Step 5: Set Your Platform Identity (Recommended)
|
||||
|
||||
Two optional fields under **Advanced Settings** carry a lot of weight in day-to-day use — fill them in once and most surprises go away.
|
||||
|
||||
### Your Platform User ID
|
||||
|
||||
This is your own Discord user ID, used by:
|
||||
|
||||
- **Pairing approval** — required when **DM Policy** is set to **Pairing**, since `/approve <code>` is the owner's command and the runtime checks the sender against this ID.
|
||||
- **AI tools push** — lets the agent reach you proactively (reminders, notifications) by mapping its internal user reference to your Discord account.
|
||||
- **Anti-lockout** — auto-trusted by **Allowed Users**, so scoping the bot to friends won't accidentally lock you out.
|
||||
|
||||
To get it: in Discord, open **User Settings → Advanced** and turn on **Developer Mode**. Then right-click your own username anywhere in Discord and choose **Copy User ID**. Paste the numeric ID into **Your Platform User ID** in LobeHub's Advanced Settings.
|
||||
|
||||
### Default Server
|
||||
|
||||
The Discord guild ID the bot's AI tools should default to when you ask it to "list channels", "send to #announcements", or anything else that needs a server context without naming one explicitly. Doesn't affect access control — that's **Group Policy**'s job.
|
||||
|
||||
To get it: with **Developer Mode** on, right-click the server name in your server list and choose **Copy Server ID**. Paste it into **Default Server** in LobeHub's Advanced Settings.
|
||||
|
||||
## Access Policies
|
||||
|
||||
LobeHub gates inbound traffic with three layered settings, all under **Advanced Settings** and all defaulting to permissive.
|
||||
@@ -139,9 +159,10 @@ Controls 1:1 direct messages.
|
||||
|
||||
- **Open (default)** — Anyone who shares a server with the bot can DM it (subject to the global allowlist when set).
|
||||
- **Allowlist** — DMs require the sender to be in **Allowed User IDs**. Differs from `Open` only when the list is empty: `Allowlist` fails closed (no DMs), `Open` still lets anyone DM.
|
||||
- **Pairing** — Same gate as `Allowlist`, but a non-listed sender receives a one-time pairing code instead of a flat rejection. Approve via `/approve <code>` and the applicant is auto-appended to **Allowed User IDs**. Requires **Your Platform User ID** to be set (the runtime checks the `/approve` sender against it) and a configured Redis backend.
|
||||
- **Disabled** — The bot ignores all DMs. Senders get a one-line notice pointing them at @mentioning the bot in a shared channel instead.
|
||||
|
||||
> Discord bots can be reached by anyone in any shared server, so consider populating **Allowed User IDs** or switching DM Policy to **Disabled** if your bot is meant to be private.
|
||||
> Discord bots can be reached by anyone in any shared server, so consider populating **Allowed User IDs**, switching DM Policy to **Pairing** for self-service approval, or **Disabled** if your bot is meant to be private.
|
||||
|
||||
### Group Policy
|
||||
|
||||
@@ -163,7 +184,7 @@ See the [Channels overview](/docs/usage/channels/overview#direct-message-policy)
|
||||
| **Bot Token** | Yes | Authentication token for your Discord bot |
|
||||
| **Public Key** | Yes | Used to verify interaction requests from Discord |
|
||||
| **Allowed User IDs** | No | Comma- or whitespace-separated Discord user IDs. Global gate — applies to DMs and group @mentions |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, or `disabled` — who is allowed to DM the bot |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, `pairing`, or `disabled` — who is allowed to DM the bot |
|
||||
| **Group Policy** | No | `open` (default), `allowlist`, or `disabled` — where the bot responds to @mentions |
|
||||
| **Allowed Channel IDs** | No | Comma- or whitespace-separated Discord channel IDs. Used when Group Policy is Allowlist |
|
||||
|
||||
|
||||
@@ -122,6 +122,26 @@ tags:
|
||||
|
||||
返回 LobeHub 的 Discord 渠道设置,点击 **测试连接** 以验证配置是否正确。然后在 Discord 中向您的机器人发送消息,确认其是否响应。
|
||||
|
||||
## 第五步:填写你的平台身份(推荐)
|
||||
|
||||
**高级设置**里有两个可选字段,影响着日常使用体验,建议一开始就填好。
|
||||
|
||||
### 你的平台用户 ID
|
||||
|
||||
也就是你自己的 Discord 用户 ID,用于:
|
||||
|
||||
- **配对审批** — 当 **私信策略** 为 **配对审批** 时为必填项,`/approve <code>` 是属主命令,runtime 会用这个 ID 校验发起人。
|
||||
- **AI 工具主动推送** — 让 Agent 能主动联系你(提醒、通知),把内部用户引用映射到你的 Discord 账号。
|
||||
- **防自锁** — 自动被 **允许的用户** 信任,给好友收紧 bot 时不会把自己挡在外面。
|
||||
|
||||
获取方式:在 Discord 中打开 **用户设置 → 高级**,启用 **开发者模式**。然后在任意位置右键你自己的用户名,选 **复制用户 ID**。把数字 ID 粘贴到 LobeHub 高级设置的 **你的平台用户 ID** 字段。
|
||||
|
||||
### 默认服务器
|
||||
|
||||
Discord 的 guild ID。当你让 bot 做 "列出频道"、"发送到 #announcements" 这类需要服务器上下文但没指明哪台的事时,AI 工具会默认用这个 server。和访问控制无关 —— 那是 **群组策略** 的活。
|
||||
|
||||
获取方式:在 **开发者模式** 已开启的情况下,在服务器列表中右键服务器名,选 **复制服务器 ID**。粘贴到 LobeHub 高级设置的 **默认服务器** 字段。
|
||||
|
||||
## 接入策略
|
||||
|
||||
LobeHub 通过三层叠加配置控制入站消息,全部位于 **高级设置**,默认都为宽松。
|
||||
@@ -138,9 +158,10 @@ LobeHub 通过三层叠加配置控制入站消息,全部位于 **高级设置
|
||||
|
||||
- **开放 (Open)(默认)** — 任何与机器人共享服务器的用户都可以私信(若设置了全局白名单则受其约束)。
|
||||
- **白名单 (Allowlist)** — 私信需要发送者在 **允许的用户 ID** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式**全部拒绝**,`Open` 模式仍然放任何人私信。
|
||||
- **配对审批 (Pairing)** — 与 `Allowlist` 共享同一份名单,但非名单用户被拒后会收到一次性配对码,由你(属主)通过 `/approve <code>` 审批。审批通过的用户会被自动追加到 **允许的用户 ID**,后续 DM 直通。需先填 **你的平台用户 ID**(runtime 用它校验 `/approve` 发起人),并需要部署 Redis。
|
||||
- **禁用 (Disabled)** — 机器人忽略所有私信,发起方会收到一条提示,引导其在共享频道里 @机器人。
|
||||
|
||||
> Discord 机器人可被任意共享服务器的用户私信,如果你的机器人是私有用途,建议填入 **允许的用户 ID** 或将私信策略切到 **禁用**。
|
||||
> Discord 机器人可被任意共享服务器的用户私信,如果你的机器人是私有用途,建议填入 **允许的用户 ID**、把私信策略切到 **配对审批** 让陌生人走自助申请通道,或干脆设为 **禁用**。
|
||||
|
||||
### 群组策略
|
||||
|
||||
@@ -156,15 +177,15 @@ LobeHub 通过三层叠加配置控制入站消息,全部位于 **高级设置
|
||||
|
||||
## 配置参考
|
||||
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| ------------ | ---- | -------------------------------------------------- |
|
||||
| **应用程序 ID** | 是 | 您的 Discord 应用程序的 ID |
|
||||
| **机器人令牌** | 是 | 您的 Discord 机器人的认证令牌 |
|
||||
| **公钥** | 是 | 用于验证来自 Discord 的交互请求 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Discord 用户 ID。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些频道响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Discord 频道 ID。仅在群组策略为白名单时使用 |
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| ------------ | ---- | ---------------------------------------------------------- |
|
||||
| **应用程序 ID** | 是 | 您的 Discord 应用程序的 ID |
|
||||
| **机器人令牌** | 是 | 您的 Discord 机器人的认证令牌 |
|
||||
| **公钥** | 是 | 用于验证来自 Discord 的交互请求 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Discord 用户 ID。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist`、`pairing` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些频道响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Discord 频道 ID。仅在群组策略为白名单时使用 |
|
||||
|
||||
## 故障排除
|
||||
|
||||
|
||||
@@ -174,6 +174,22 @@ By connecting a Feishu channel to your LobeHub agent, team members can interact
|
||||
|
||||
Back in LobeHub's channel settings, click **Test Connection** to verify the credentials. Then find your bot in Feishu by searching its name and send it a message to confirm it responds.
|
||||
|
||||
## Step 7: Set Your Platform Identity (Recommended)
|
||||
|
||||
One optional field under **Advanced Settings** carries a lot of weight in day-to-day use — fill it in once and most surprises go away.
|
||||
|
||||
### Your Platform User ID
|
||||
|
||||
This is your own Feishu `open_id` (the per-app, per-user identifier — **not** the same as your Feishu mobile number or email), used by:
|
||||
|
||||
- **Pairing approval** — required when **DM Policy** is set to **Pairing**, since `/approve <code>` is the owner's command and the runtime checks the sender against this ID.
|
||||
- **AI tools push** — lets the agent reach you proactively (reminders, notifications) by mapping its internal user reference to your Feishu account.
|
||||
- **Anti-lockout** — auto-trusted by **Allowed Users**, so scoping the bot to teammates won't accidentally lock you out.
|
||||
|
||||
To get it: DM the bot once and inspect the inbound event payload — the `open_id` field on the sender is yours. The Feishu Developer Portal also exposes a **User ID** lookup that maps mobile/email to `open_id`. Paste it into **Your Platform User ID** in LobeHub's Advanced Settings.
|
||||
|
||||
> Feishu doesn't expose a single "default server" concept that AI tools can pivot on (the bot operates per-tenant via credentials), so the **Default Server** field is not exposed for Feishu channels.
|
||||
|
||||
## Access Policies
|
||||
|
||||
Two independent policies gate inbound traffic. Both default to **Open**.
|
||||
@@ -186,6 +202,7 @@ A populated **Allowed User IDs** field is a global gate — DMs *and* group `@me
|
||||
|
||||
- **Open (default)** — Any tenant member can DM the bot (subject to the global allowlist when set).
|
||||
- **Allowlist** — DMs require the sender to be in **Allowed User IDs**. Differs from `Open` only when the list is empty: `Allowlist` then fails closed (no DMs).
|
||||
- **Pairing** — Same gate as `Allowlist`, but a non-listed sender receives a one-time pairing code instead of a flat rejection. Approve via `/approve <code>` and the applicant is auto-appended to **Allowed User IDs**. Requires **Your Platform User ID** to be set (the runtime checks the `/approve` sender against it) and a configured Redis backend.
|
||||
- **Disabled** — The bot ignores all DMs and only responds to chat-group `@mentions`.
|
||||
|
||||
### Group Policy
|
||||
@@ -208,7 +225,7 @@ See the [Channels overview](/docs/usage/channels/overview#direct-message-policy)
|
||||
| **Encrypt Key** | No | Decrypts encrypted event payloads |
|
||||
| **Event Subscription URL** | — | Auto-generated after saving; paste into Feishu Developer Portal |
|
||||
| **Allowed User IDs** | No | Comma- or whitespace-separated Feishu `open_id` values. Global gate — applies to DMs and group @mentions |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, or `disabled` — who is allowed to DM the bot |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, `pairing`, or `disabled` — who is allowed to DM the bot |
|
||||
| **Group Policy** | No | `open` (default), `allowlist`, or `disabled` — where the bot responds to @mentions |
|
||||
| **Allowed Channel IDs** | No | Comma- or whitespace-separated Feishu `chat_id` values. Used when Group Policy is Allowlist |
|
||||
|
||||
|
||||
@@ -170,6 +170,22 @@ tags:
|
||||
|
||||
回到 LobeHub 的渠道设置,点击 **测试连接** 以验证凭证。然后在飞书中搜索您的机器人名称并发送消息,确认其是否响应。
|
||||
|
||||
## 第七步:填写你的平台身份(推荐)
|
||||
|
||||
**高级设置**里有一个可选字段影响日常使用体验,建议一开始就填好。
|
||||
|
||||
### 你的平台用户 ID
|
||||
|
||||
也就是你自己的飞书 `open_id`(按应用、按用户隔离的标识符 ——**不是**手机号或邮箱),用于:
|
||||
|
||||
- **配对审批** — 当 **私信策略** 为 **配对审批** 时为必填项,`/approve <code>` 是属主命令,runtime 会用这个 ID 校验发起人。
|
||||
- **AI 工具主动推送** — 让 Agent 能主动联系你(提醒、通知),把内部用户引用映射到你的飞书账号。
|
||||
- **防自锁** — 自动被 **允许的用户** 信任,给同事收紧 bot 时不会把自己挡在外面。
|
||||
|
||||
获取方式:先用任意消息私信 bot 一次,查看入站事件 payload 中发送方的 `open_id` 字段,那就是你的。飞书开发者后台也提供 **User ID 查询** 工具,用手机号 / 邮箱反查 `open_id`。粘贴到 LobeHub 高级设置的 **你的平台用户 ID** 字段。
|
||||
|
||||
> 飞书没有一个 AI 工具能默认指向的 "默认服务器" 概念(bot 通过凭证按租户运行),因此飞书渠道不展示 **默认服务器** 字段。
|
||||
|
||||
## 接入策略
|
||||
|
||||
两个独立的策略控制入站消息,默认都为 **开放**。
|
||||
@@ -182,6 +198,7 @@ tags:
|
||||
|
||||
- **开放 (Open)(默认)** — 租户内任何成员都可以私信机器人(若设置了全局白名单则受其约束)。
|
||||
- **白名单 (Allowlist)** — 私信需要发送者在 **允许的用户 ID** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式**全部拒绝**。
|
||||
- **配对审批 (Pairing)** — 与 `Allowlist` 共享同一份名单,但非名单用户被拒后会收到一次性配对码,由你(属主)通过 `/approve <code>` 审批。审批通过的用户会被自动追加到 **允许的用户 ID**,后续 DM 直通。需先填 **你的平台用户 ID**(runtime 用它校验 `/approve` 发起人),并需要部署 Redis。
|
||||
- **禁用 (Disabled)** — 机器人忽略所有私信,只在群聊里被 `@提及` 时回复。
|
||||
|
||||
### 群组策略
|
||||
@@ -196,17 +213,17 @@ tags:
|
||||
|
||||
## 配置参考
|
||||
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| ---------------------- | ---- | -------------------------------------------------- |
|
||||
| **应用 ID** | 是 | 您的飞书应用的应用 ID(`cli_xxx`) |
|
||||
| **应用密钥** | 是 | 您的飞书应用的应用密钥 |
|
||||
| **Verification Token** | 否 | 验证 webhook 事件来源(推荐) |
|
||||
| **Encrypt Key** | 否 | 解密加密事件负载 |
|
||||
| **事件订阅 URL** | — | 保存后自动生成;粘贴到飞书开发者门户 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的飞书 `open_id`。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的飞书 `chat_id`。仅在群组策略为白名单时使用 |
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| ---------------------- | ---- | ---------------------------------------------------------- |
|
||||
| **应用 ID** | 是 | 您的飞书应用的应用 ID(`cli_xxx`) |
|
||||
| **应用密钥** | 是 | 您的飞书应用的应用密钥 |
|
||||
| **Verification Token** | 否 | 验证 webhook 事件来源(推荐) |
|
||||
| **Encrypt Key** | 否 | 解密加密事件负载 |
|
||||
| **事件订阅 URL** | — | 保存后自动生成;粘贴到飞书开发者门户 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的飞书 `open_id`。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist`、`pairing` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的飞书 `chat_id`。仅在群组策略为白名单时使用 |
|
||||
|
||||
## 故障排除
|
||||
|
||||
|
||||
@@ -165,6 +165,22 @@ By connecting a Lark channel to your LobeHub agent, team members can interact wi
|
||||
|
||||
Back in LobeHub's channel settings, click **Test Connection** to verify the credentials. Then find your bot in Lark by searching its name and send it a message to confirm it responds.
|
||||
|
||||
## Step 7: Set Your Platform Identity (Recommended)
|
||||
|
||||
One optional field under **Advanced Settings** carries a lot of weight in day-to-day use — fill it in once and most surprises go away.
|
||||
|
||||
### Your Platform User ID
|
||||
|
||||
This is your own Lark `open_id` (the per-app, per-user identifier — **not** the same as your Lark mobile number or email), used by:
|
||||
|
||||
- **Pairing approval** — required when **DM Policy** is set to **Pairing**, since `/approve <code>` is the owner's command and the runtime checks the sender against this ID.
|
||||
- **AI tools push** — lets the agent reach you proactively (reminders, notifications) by mapping its internal user reference to your Lark account.
|
||||
- **Anti-lockout** — auto-trusted by **Allowed Users**, so scoping the bot to teammates won't accidentally lock you out.
|
||||
|
||||
To get it: DM the bot once and inspect the inbound event payload — the `open_id` field on the sender is yours. The Lark Developer Portal also exposes a **User ID** lookup that maps mobile/email to `open_id`. Paste it into **Your Platform User ID** in LobeHub's Advanced Settings.
|
||||
|
||||
> Lark doesn't expose a single "default server" concept that AI tools can pivot on (the bot operates per-tenant via credentials), so the **Default Server** field is not exposed for Lark channels.
|
||||
|
||||
## Access Policies
|
||||
|
||||
Two independent policies gate inbound traffic. Both default to **Open**.
|
||||
@@ -177,6 +193,7 @@ A populated **Allowed User IDs** field is a global gate — DMs *and* group `@me
|
||||
|
||||
- **Open (default)** — Any tenant member can DM the bot (subject to the global allowlist when set).
|
||||
- **Allowlist** — DMs require the sender to be in **Allowed User IDs**. Differs from `Open` only when the list is empty: `Allowlist` then fails closed (no DMs).
|
||||
- **Pairing** — Same gate as `Allowlist`, but a non-listed sender receives a one-time pairing code instead of a flat rejection. Approve via `/approve <code>` and the applicant is auto-appended to **Allowed User IDs**. Requires **Your Platform User ID** to be set (the runtime checks the `/approve` sender against it) and a configured Redis backend.
|
||||
- **Disabled** — The bot ignores all DMs and only responds to chat-group `@mentions`.
|
||||
|
||||
### Group Policy
|
||||
@@ -199,7 +216,7 @@ See the [Channels overview](/docs/usage/channels/overview#direct-message-policy)
|
||||
| **Encrypt Key** | No | Decrypts encrypted event payloads |
|
||||
| **Event Subscription URL** | — | Auto-generated after saving; paste into Lark Developer Portal |
|
||||
| **Allowed User IDs** | No | Comma- or whitespace-separated Lark `open_id` values. Global gate — applies to DMs and group @mentions |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, or `disabled` — who is allowed to DM the bot |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, `pairing`, or `disabled` — who is allowed to DM the bot |
|
||||
| **Group Policy** | No | `open` (default), `allowlist`, or `disabled` — where the bot responds to @mentions |
|
||||
| **Allowed Channel IDs** | No | Comma- or whitespace-separated Lark `chat_id` values. Used when Group Policy is Allowlist |
|
||||
|
||||
|
||||
@@ -162,6 +162,22 @@ tags:
|
||||
|
||||
回到 LobeHub 的渠道设置,点击 **Test Connection** 以验证凭证。然后在 Lark 中搜索您的机器人名称并发送消息,确认其是否响应。
|
||||
|
||||
## 第七步:填写你的平台身份(推荐)
|
||||
|
||||
**高级设置**里有一个可选字段影响日常使用体验,建议一开始就填好。
|
||||
|
||||
### 你的平台用户 ID
|
||||
|
||||
也就是你自己的 Lark `open_id`(按应用、按用户隔离的标识符 ——**不是**手机号或邮箱),用于:
|
||||
|
||||
- **配对审批** — 当 **私信策略** 为 **配对审批** 时为必填项,`/approve <code>` 是属主命令,runtime 会用这个 ID 校验发起人。
|
||||
- **AI 工具主动推送** — 让 Agent 能主动联系你(提醒、通知),把内部用户引用映射到你的 Lark 账号。
|
||||
- **防自锁** — 自动被 **允许的用户** 信任,给同事收紧 bot 时不会把自己挡在外面。
|
||||
|
||||
获取方式:先用任意消息私信 bot 一次,查看入站事件 payload 中发送方的 `open_id` 字段,那就是你的。Lark 开发者后台也提供 **User ID 查询** 工具,用手机号 / 邮箱反查 `open_id`。粘贴到 LobeHub 高级设置的 **你的平台用户 ID** 字段。
|
||||
|
||||
> Lark 没有一个 AI 工具能默认指向的 "默认服务器" 概念(bot 通过凭证按租户运行),因此 Lark 渠道不展示 **默认服务器** 字段。
|
||||
|
||||
## 接入策略
|
||||
|
||||
两个独立的策略控制入站消息,默认都为 **开放**。
|
||||
@@ -174,6 +190,7 @@ tags:
|
||||
|
||||
- **开放 (Open)(默认)** — 租户内任何成员都可以私信机器人(若设置了全局白名单则受其约束)。
|
||||
- **白名单 (Allowlist)** — 私信需要发送者在 **允许的用户 ID** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式**全部拒绝**。
|
||||
- **配对审批 (Pairing)** — 与 `Allowlist` 共享同一份名单,但非名单用户被拒后会收到一次性配对码,由你(属主)通过 `/approve <code>` 审批。审批通过的用户会被自动追加到 **允许的用户 ID**,后续 DM 直通。需先填 **你的平台用户 ID**(runtime 用它校验 `/approve` 发起人),并需要部署 Redis。
|
||||
- **禁用 (Disabled)** — 机器人忽略所有私信,只在群聊里被 `@提及` 时回复。
|
||||
|
||||
### 群组策略
|
||||
@@ -188,17 +205,17 @@ tags:
|
||||
|
||||
## 配置参考
|
||||
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| -------------------------- | ---- | -------------------------------------------------- |
|
||||
| **App ID** | 是 | 您的 Lark 应用的 App ID(`cli_xxx`) |
|
||||
| **App Secret** | 是 | 您的 Lark 应用的 App Secret |
|
||||
| **Verification Token** | 否 | 验证 webhook 事件来源(推荐) |
|
||||
| **Encrypt Key** | 否 | 解密加密事件负载 |
|
||||
| **Event Subscription URL** | — | 保存后自动生成;粘贴到 Lark 开发者门户 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Lark `open_id`。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Lark `chat_id`。仅在群组策略为白名单时使用 |
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| -------------------------- | ---- | ---------------------------------------------------------- |
|
||||
| **App ID** | 是 | 您的 Lark 应用的 App ID(`cli_xxx`) |
|
||||
| **App Secret** | 是 | 您的 Lark 应用的 App Secret |
|
||||
| **Verification Token** | 否 | 验证 webhook 事件来源(推荐) |
|
||||
| **Encrypt Key** | 否 | 解密加密事件负载 |
|
||||
| **Event Subscription URL** | — | 保存后自动生成;粘贴到 Lark 开发者门户 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Lark `open_id`。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist`、`pairing` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Lark `chat_id`。仅在群组策略为白名单时使用 |
|
||||
|
||||
## 故障排除
|
||||
|
||||
|
||||
@@ -90,11 +90,12 @@ Add one entry per row. Each row holds a platform user ID (required) and an optio
|
||||
|
||||
DM Policy only governs DMs — group `@mentions` are gated independently by **Group Policy** below. The user-level filter from the global **Allowed Users** is also applied; per-scope policy stacks on top.
|
||||
|
||||
| Policy | Behavior |
|
||||
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Open** | Any user on the platform can DM the bot (subject to the global allowlist when set). Best for public-facing assistants. |
|
||||
| **Allowlist** | DMs require the sender to be in **Allowed Users**. Distinct from `Open` only when the list is empty: `Allowlist` then **fails closed** (no DMs); `Open` still lets anyone DM. |
|
||||
| **Disabled** | The bot ignores all DMs entirely. Use this when the bot should only reply in shared channels via `@mention`. |
|
||||
| Policy | Behavior |
|
||||
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **Open** | Any user on the platform can DM the bot (subject to the global allowlist when set). Best for public-facing assistants. |
|
||||
| **Allowlist** | DMs require the sender to be in **Allowed Users**. Distinct from `Open` only when the list is empty: `Allowlist` then **fails closed** (no DMs); `Open` still lets anyone DM. |
|
||||
| **Pairing** | Same gate as `Allowlist`, but a non-listed sender receives a one-time pairing code instead of a flat rejection. The owner approves via `/approve <code>`, which appends the applicant to **Allowed Users** so future DMs flow normally. Requires **Your Platform User ID** and a configured Redis. |
|
||||
| **Disabled** | The bot ignores all DMs entirely. Use this when the bot should only reply in shared channels via `@mention`. |
|
||||
|
||||
## Group Policy
|
||||
|
||||
|
||||
@@ -89,11 +89,12 @@ tags:
|
||||
|
||||
私信策略只影响私信 — 群聊里的 `@提及` 由下面的 **群组策略** 单独管理。全局 **允许的用户** 的用户级过滤也会同时生效;各 scope 的策略叠加在上面。
|
||||
|
||||
| 策略 | 行为 |
|
||||
| ------------------- | -------------------------------------------------------------------------------------- |
|
||||
| **开放 (Open)** | 平台上的任何用户都可以私信机器人(如设置了全局白名单则受其约束)。适合面向所有人开放的助手。 |
|
||||
| **白名单 (Allowlist)** | 私信需要发送者在 **允许的用户** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式下会**全部拒绝**,而 `Open` 模式下任何人都能私信。 |
|
||||
| **禁用 (Disabled)** | 机器人会忽略所有私信。适合那种 " 只在群里被 `@` 时才回复 " 的场景。 |
|
||||
| 策略 | 行为 |
|
||||
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **开放 (Open)** | 平台上的任何用户都可以私信机器人(如设置了全局白名单则受其约束)。适合面向所有人开放的助手。 |
|
||||
| **白名单 (Allowlist)** | 私信需要发送者在 **允许的用户** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式下会**全部拒绝**,而 `Open` 模式下任何人都能私信。 |
|
||||
| **配对审批 (Pairing)** | 与 `Allowlist` 共享同一份名单,但非名单用户被拒后会收到一次性配对码,由你(属主)通过 `/approve <code>` 审批。审批通过的用户会被自动追加到 **允许的用户**,后续 DM 直通。需先填 **你的平台用户 ID** 并部署 Redis。 |
|
||||
| **禁用 (Disabled)** | 机器人会忽略所有私信。适合那种 " 只在群里被 `@` 时才回复 " 的场景。 |
|
||||
|
||||
## 群组策略
|
||||
|
||||
|
||||
@@ -132,6 +132,22 @@ LobeHub supports two connection modes for QQ bots:
|
||||
|
||||
Click **Test Connection** in LobeHub's channel settings to verify the integration. Then open QQ, find your bot, and send a message. The bot should respond through your LobeHub agent.
|
||||
|
||||
## Set Your Platform Identity (Recommended)
|
||||
|
||||
One optional field under **Advanced Settings** carries a lot of weight in day-to-day use — fill it in once and most surprises go away.
|
||||
|
||||
### Your Platform User ID
|
||||
|
||||
This is your own QQ `tiny_id` (the platform-level user identifier — **not** the public-facing QQ number, which doesn't always match), used by:
|
||||
|
||||
- **Pairing approval** — required when **DM Policy** is set to **Pairing**, since `/approve <code>` is the owner's command and the runtime checks the sender against this ID.
|
||||
- **AI tools push** — lets the agent reach you proactively (reminders, notifications) by mapping its internal user reference to your QQ account.
|
||||
- **Anti-lockout** — auto-trusted by **Allowed Users**, so scoping the bot to friends won't accidentally lock you out.
|
||||
|
||||
To get it: DM the bot once with any message and check the server logs for the `tiny_id` field on the inbound event payload (or read it from the OpenAPI dashboard if available). Paste the long numeric ID into **Your Platform User ID** in LobeHub's Advanced Settings.
|
||||
|
||||
> QQ doesn't expose a single "default server" concept that AI tools can pivot on, so the **Default Server** field is not exposed for QQ channels.
|
||||
|
||||
## Adding the Bot to Group Chats
|
||||
|
||||
To use the bot in QQ groups:
|
||||
@@ -152,6 +168,7 @@ A populated **Allowed User IDs** field is a global gate — DMs *and* group `@me
|
||||
|
||||
- **Open (default)** — Any QQ user who shares context with the bot can DM it (subject to the global allowlist when set).
|
||||
- **Allowlist** — DMs require the sender to be in **Allowed User IDs**. Differs from `Open` only when the list is empty: `Allowlist` then fails closed (no DMs).
|
||||
- **Pairing** — Same gate as `Allowlist`, but a non-listed sender receives a one-time pairing code instead of a flat rejection. Approve via `/approve <code>` and the applicant is auto-appended to **Allowed User IDs**. Requires **Your Platform User ID** to be set (the runtime checks the `/approve` sender against it) and a configured Redis backend.
|
||||
- **Disabled** — The bot ignores all DMs and only responds to group `@mentions`.
|
||||
|
||||
### Group Policy
|
||||
@@ -172,7 +189,7 @@ See the [Channels overview](/docs/usage/channels/overview#direct-message-policy)
|
||||
| **App Secret** | Yes | Your bot's App Secret from QQ Open Platform |
|
||||
| **Connection Mode** | No | `websocket` (default) or `webhook`. Choose based on your QQ Open Platform configuration |
|
||||
| **Allowed User IDs** | No | Comma- or whitespace-separated QQ `tiny_id` values. Global gate — applies to DMs and group @mentions |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, or `disabled` — who is allowed to DM the bot |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, `pairing`, or `disabled` — who is allowed to DM the bot |
|
||||
| **Group Policy** | No | `open` (default), `allowlist`, or `disabled` — where the bot responds to @mentions |
|
||||
| **Allowed Channel IDs** | No | Comma- or whitespace-separated QQ group IDs. Used when Group Policy is Allowlist |
|
||||
|
||||
|
||||
@@ -129,6 +129,22 @@ LobeHub ��持两种 QQ 机器人连接模式:
|
||||
|
||||
在 LobeHub 的渠道设置中点击 **测试连接** 以验证集成。然后打开 QQ,找到您的机器人并发送消息。机器人应通过您的 LobeHub 代理进行响应。
|
||||
|
||||
## 填写你的平台身份(推荐)
|
||||
|
||||
**高级设置**里有一个可选字段影响日常使用体验,建议一开始就填好。
|
||||
|
||||
### 你的平台用户 ID
|
||||
|
||||
也就是你自己的 QQ `tiny_id`(平台级用户标识符 ——**不是**对外可见的 QQ 号,两者不一定一致),用于:
|
||||
|
||||
- **配对审批** — 当 **私信策略** 为 **配对审批** 时为必填项,`/approve <code>` 是属主命令,runtime 会用这个 ID 校验发起人。
|
||||
- **AI 工具主动推送** — 让 Agent 能主动联系你(提醒、通知),把内部用户引用映射到你的 QQ 账号。
|
||||
- **防自锁** — 自动被 **允许的用户** 信任,给好友收紧 bot 时不会把自己挡在外面。
|
||||
|
||||
获取方式:先用任意消息私信 bot 一次,然后在 server log 里查看入站事件 payload 中的 `tiny_id` 字段(或在 OpenAPI 控制台读取,如果有)。把那串长数字 ID 粘贴到 LobeHub 高级设置的 **你的平台用户 ID** 字段。
|
||||
|
||||
> QQ 没有一个稳定的 "默认服务器" 概念可让 AI 工具默认指向,因此 QQ 渠道不展示 **默认服务器** 字段。
|
||||
|
||||
## 将机器人添加到群聊
|
||||
|
||||
要在 QQ 群聊中使用机器人:
|
||||
@@ -149,6 +165,7 @@ LobeHub ��持两种 QQ 机器人连接模式:
|
||||
|
||||
- **开放 (Open)(默认)** — 任何与机器人有上下文交集的 QQ 用户都可以私信(若设置了全局白名单则受其约束)。
|
||||
- **白名单 (Allowlist)** — 私信需要发送者在 **允许的用户 ID** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式**全部拒绝**。
|
||||
- **配对审批 (Pairing)** — 与 `Allowlist` 共享同一份名单,但非名单用户被拒后会收到一次性配对码,由你(属主)通过 `/approve <code>` 审批。审批通过的用户会被自动追加到 **允许的用户 ID**,后续 DM 直通。需先填 **你的平台用户 ID**(runtime 用它校验 `/approve` 发起人),并需要部署 Redis。
|
||||
- **禁用 (Disabled)** — 机器人忽略所有私信,只在群聊里被 `@提及` 时回复。
|
||||
|
||||
### 群组策略
|
||||
@@ -163,15 +180,15 @@ LobeHub ��持两种 QQ 机器人连接模式:
|
||||
|
||||
## 配置参考
|
||||
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| -------------- | ---- | -------------------------------------------------- |
|
||||
| **应用 ID** | 是 | 来自 QQ 开放平台的 App ID |
|
||||
| **App Secret** | 是 | 来自 QQ 开放平台的 App Secret |
|
||||
| **连接模式** | 否 | `websocket`(默认)或 `webhook`,根据 QQ 开放平台配置选择 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 QQ `tiny_id`。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 QQ 群 ID。仅在群组策略为白名单时使用 |
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| -------------- | ---- | ---------------------------------------------------------- |
|
||||
| **应用 ID** | 是 | 来自 QQ 开放平台的 App ID |
|
||||
| **App Secret** | 是 | 来自 QQ 开放平台的 App Secret |
|
||||
| **连接模式** | 否 | `websocket`(默认)或 `webhook`,根据 QQ 开放平台配置选择 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 QQ `tiny_id`。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist`、`pairing` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 QQ 群 ID。仅在群组策略为白名单时使用 |
|
||||
|
||||
## 功能限制
|
||||
|
||||
|
||||
@@ -213,6 +213,26 @@ Use this method if your Slack app already has Event Subscriptions configured wit
|
||||
Also ensure you add the `commands` scope under **OAuth & Permissions** → **Bot Token Scopes**, and enable **Interactivity & Shortcuts** with the same Webhook URL as the Request URL.
|
||||
</Steps>
|
||||
|
||||
## Set Your Platform Identity (Recommended)
|
||||
|
||||
Two optional fields under **Advanced Settings** carry a lot of weight in day-to-day use — fill them in once and most surprises go away.
|
||||
|
||||
### Your Platform User ID
|
||||
|
||||
This is your own Slack member ID, used by:
|
||||
|
||||
- **Pairing approval** — required when **DM Policy** is set to **Pairing**, since `/approve <code>` is the owner's command and the runtime checks the sender against this ID.
|
||||
- **AI tools push** — lets the agent reach you proactively (reminders, notifications) by mapping its internal user reference to your Slack account.
|
||||
- **Anti-lockout** — auto-trusted by **Allowed Users**, so scoping the bot to teammates won't accidentally lock you out.
|
||||
|
||||
To get it: in Slack, click your avatar → **Profile**, then click the `⋮` overflow menu and choose **Copy member ID**. Member IDs start with `U`. Paste it into **Your Platform User ID** in LobeHub's Advanced Settings.
|
||||
|
||||
### Default Server
|
||||
|
||||
The Slack workspace (team) ID the bot's AI tools should default to when you ask it to "list channels", "send to #announcements", or anything else that needs a workspace context without naming one explicitly. Doesn't affect access control — that's **Group Policy**'s job.
|
||||
|
||||
To get it: open Slack in the browser; the URL contains the team ID (`https://app.slack.com/client/T01ABCDEF/...`) — copy the part starting with `T`. Paste it into **Default Server** in LobeHub's Advanced Settings.
|
||||
|
||||
## Access Policies
|
||||
|
||||
Two independent policies gate inbound traffic. Both default to **Open**.
|
||||
@@ -225,6 +245,7 @@ A populated **Allowed User IDs** field is a global gate — DMs *and* channel `@
|
||||
|
||||
- **Open (default)** — Any workspace member can DM the bot (subject to the global allowlist when set).
|
||||
- **Allowlist** — DMs require the sender to be in **Allowed User IDs**. Differs from `Open` only when the list is empty: `Allowlist` then fails closed (no DMs).
|
||||
- **Pairing** — Same gate as `Allowlist`, but a non-listed sender receives a one-time pairing code instead of a flat rejection. Approve via `/approve <code>` and the applicant is auto-appended to **Allowed User IDs**. Requires **Your Platform User ID** to be set (the runtime checks the `/approve` sender against it) and a configured Redis backend.
|
||||
- **Disabled** — The bot ignores all DMs and only replies to channel `@mentions`.
|
||||
|
||||
### Group Policy
|
||||
@@ -247,7 +268,7 @@ See the [Channels overview](/docs/usage/channels/overview#direct-message-policy)
|
||||
| **App-Level Token** | Socket Mode only | App-level token (`xapp-...`) for WebSocket connection |
|
||||
| **Connection Mode** | No | `websocket` or `webhook` (default: `webhook`) |
|
||||
| **Allowed User IDs** | No | Comma- or whitespace-separated Slack member IDs. Global gate — applies to DMs and channel @mentions |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, or `disabled` — who is allowed to DM the bot |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, `pairing`, or `disabled` — who is allowed to DM the bot |
|
||||
| **Group Policy** | No | `open` (default), `allowlist`, or `disabled` — where the bot responds to @mentions |
|
||||
| **Allowed Channel IDs** | No | Comma- or whitespace-separated Slack channel IDs (start with `C`). Used when Group Policy is Allowlist |
|
||||
|
||||
|
||||
@@ -210,6 +210,26 @@ LobeHub 支持两种 Slack 连接模式:
|
||||
同时确保在 **OAuth & Permissions** → **Bot Token Scopes** 中添加 `commands` 权限,并在 **Interactivity & Shortcuts** 中启用 Interactivity,将 Request URL 设为相同的 Webhook URL。
|
||||
</Steps>
|
||||
|
||||
## 填写你的平台身份(推荐)
|
||||
|
||||
**高级设置**里有两个可选字段,影响着日常使用体验,建议一开始就填好。
|
||||
|
||||
### 你的平台用户 ID
|
||||
|
||||
也就是你自己的 Slack member ID,用于:
|
||||
|
||||
- **配对审批** — 当 **私信策略** 为 **配对审批** 时为必填项,`/approve <code>` 是属主命令,runtime 会用这个 ID 校验发起人。
|
||||
- **AI 工具主动推送** — 让 Agent 能主动联系你(提醒、通知),把内部用户引用映射到你的 Slack 账号。
|
||||
- **防自锁** — 自动被 **允许的用户** 信任,给同事收紧 bot 时不会把自己挡在外面。
|
||||
|
||||
获取方式:在 Slack 中点击你的头像 → **个人资料**,点击 `⋮` 溢出菜单,选 **复制 member ID**。member ID 以 `U` 开头。粘贴到 LobeHub 高级设置的 **你的平台用户 ID** 字段。
|
||||
|
||||
### 默认服务器
|
||||
|
||||
Slack workspace(team)ID。当你让 bot 做 "列出频道"、"发送到 #announcements" 这类需要 workspace 上下文但没指明哪个的事时,AI 工具会默认用这个。和访问控制无关 —— 那是 **群组策略** 的活。
|
||||
|
||||
获取方式:用浏览器打开 Slack,URL 里就有 team ID(`https://app.slack.com/client/T01ABCDEF/...`)—— 复制以 `T` 开头那段。粘贴到 LobeHub 高级设置的 **默认服务器** 字段。
|
||||
|
||||
## 接入策略
|
||||
|
||||
两个独立的策略控制入站消息,默认都为 **开放**。
|
||||
@@ -222,6 +242,7 @@ LobeHub 支持两种 Slack 连接模式:
|
||||
|
||||
- **开放 (Open)(默认)** — workspace 内任何成员都可以私信机器人(若设置了全局白名单则受其约束)。
|
||||
- **白名单 (Allowlist)** — 私信需要发送者在 **允许的用户 ID** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式**全部拒绝**。
|
||||
- **配对审批 (Pairing)** — 与 `Allowlist` 共享同一份名单,但非名单用户被拒后会收到一次性配对码,由你(属主)通过 `/approve <code>` 审批。审批通过的用户会被自动追加到 **允许的用户 ID**,后续 DM 直通。需先填 **你的平台用户 ID**(runtime 用它校验 `/approve` 发起人),并需要部署 Redis。
|
||||
- **禁用 (Disabled)** — 机器人忽略所有私信,只在频道里被 `@提及` 时回复。
|
||||
|
||||
### 群组策略
|
||||
@@ -236,17 +257,17 @@ LobeHub 支持两种 Slack 连接模式:
|
||||
|
||||
## 配置参考
|
||||
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| -------------- | ------------- | --------------------------------------------------- |
|
||||
| **应用 ID** | 是 | 您的 Slack 应用 ID |
|
||||
| **Bot Token** | 是 | Bot User OAuth Token(`xoxb-...`) |
|
||||
| **签名密钥** | 是 | 用于验证来自 Slack 的请求 |
|
||||
| **应用级别 Token** | 仅 Socket Mode | 应用级别 Token(`xapp-...`),用于 WebSocket 连接 |
|
||||
| **连接模式** | 否 | `websocket` 或 `webhook`(默认:`webhook`) |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Slack 成员 ID。全局闸门 — 私信和频道 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些频道中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Slack 频道 ID(以 `C` 开头)。仅在群组策略为白名单时使用 |
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| -------------- | ------------- | ---------------------------------------------------------- |
|
||||
| **应用 ID** | 是 | 您的 Slack 应用 ID |
|
||||
| **Bot Token** | 是 | Bot User OAuth Token(`xoxb-...`) |
|
||||
| **签名密钥** | 是 | 用于验证来自 Slack 的请求 |
|
||||
| **应用级别 Token** | 仅 Socket Mode | 应用级别 Token(`xapp-...`),用于 WebSocket 连接 |
|
||||
| **连接模式** | 否 | `websocket` 或 `webhook`(默认:`webhook`) |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Slack 成员 ID。全局闸门 — 私信和频道 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist`、`pairing` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些频道中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Slack 频道 ID(以 `C` 开头)。仅在群组策略为白名单时使用 |
|
||||
|
||||
## 故障排除
|
||||
|
||||
|
||||
@@ -79,6 +79,22 @@ Click **Test Connection** in LobeHub's channel settings to verify the integratio
|
||||
|
||||

|
||||
|
||||
## Set Your Platform Identity (Recommended)
|
||||
|
||||
One optional field under **Advanced Settings** carries a lot of weight in day-to-day use — fill it in once and most surprises go away.
|
||||
|
||||
### Your Platform User ID
|
||||
|
||||
This is your own Telegram numeric user ID, used by:
|
||||
|
||||
- **Pairing approval** — required when **DM Policy** is set to **Pairing**, since `/approve <code>` is the owner's command and the runtime checks the sender against this ID.
|
||||
- **AI tools push** — lets the agent reach you proactively (reminders, notifications) by mapping its internal user reference to your Telegram account.
|
||||
- **Anti-lockout** — auto-trusted by **Allowed Users**, so scoping the bot to friends won't accidentally lock you out.
|
||||
|
||||
To get it: open Telegram, message [@userinfobot](https://t.me/userinfobot), and it will reply with your numeric user ID. Paste it into **Your Platform User ID** in LobeHub's Advanced Settings.
|
||||
|
||||
> Telegram doesn't have a "default server" concept (each chat is its own surface), so the **Default Server** field is not exposed for Telegram channels.
|
||||
|
||||
## Adding the Bot to Group Chats
|
||||
|
||||
To use the bot in Telegram groups:
|
||||
@@ -105,6 +121,7 @@ A populated **Allowed User IDs** field acts as a global gate — DMs *and* group
|
||||
|
||||
- **Open (default)** — Anyone on Telegram can DM the bot (subject to the global allowlist when set).
|
||||
- **Allowlist** — DMs require the sender to be in **Allowed User IDs**. Differs from `Open` only when the list is empty: `Allowlist` then fails closed (no DMs).
|
||||
- **Pairing** — Same gate as `Allowlist`, but a non-listed sender receives a one-time pairing code instead of a flat rejection. Approve via `/approve <code>` and the applicant is auto-appended to **Allowed User IDs**. Requires **Your Platform User ID** to be set (the runtime checks the `/approve` sender against it) and a configured Redis backend.
|
||||
- **Disabled** — The bot ignores all DMs and only responds to group `@mentions`.
|
||||
|
||||
### Group Policy
|
||||
@@ -125,7 +142,7 @@ See the [Channels overview](/docs/usage/channels/overview#direct-message-policy)
|
||||
| **Bot User ID** | Auto | Automatically derived from the bot token |
|
||||
| **Webhook Secret Token** | No | Optional secret for verifying webhook requests |
|
||||
| **Allowed User IDs** | No | Comma- or whitespace-separated Telegram numeric user IDs. Global gate — applies to DMs and group @mentions |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, or `disabled` — who is allowed to DM the bot |
|
||||
| **DM Policy** | No | `open` (default), `allowlist`, `pairing`, or `disabled` — who is allowed to DM the bot |
|
||||
| **Group Policy** | No | `open` (default), `allowlist`, or `disabled` — where the bot responds in groups |
|
||||
| **Allowed Channel IDs** | No | Comma- or whitespace-separated Telegram chat IDs (group IDs are negative). Used when Group Policy is Allowlist |
|
||||
|
||||
|
||||
@@ -78,6 +78,22 @@ tags:
|
||||
|
||||

|
||||
|
||||
## 填写你的平台身份(推荐)
|
||||
|
||||
**高级设置**里有一个可选字段影响日常使用体验,建议一开始就填好。
|
||||
|
||||
### 你的平台用户 ID
|
||||
|
||||
也就是你自己的 Telegram 数字用户 ID,用于:
|
||||
|
||||
- **配对审批** — 当 **私信策略** 为 **配对审批** 时为必填项,`/approve <code>` 是属主命令,runtime 会用这个 ID 校验发起人。
|
||||
- **AI 工具主动推送** — 让 Agent 能主动联系你(提醒、通知),把内部用户引用映射到你的 Telegram 账号。
|
||||
- **防自锁** — 自动被 **允许的用户** 信任,给好友收紧 bot 时不会把自己挡在外面。
|
||||
|
||||
获取方式:打开 Telegram,私信 [@userinfobot](https://t.me/userinfobot),它会把你的数字用户 ID 回给你。粘贴到 LobeHub 高级设置的 **你的平台用户 ID** 字段。
|
||||
|
||||
> Telegram 没有 "默认服务器" 的概念(每个会话各自独立),因此 Telegram 渠道不展示 **默认服务器** 字段。
|
||||
|
||||
## 将机器人添加到群组聊天
|
||||
|
||||
要在 Telegram 群组中使用机器人:
|
||||
@@ -104,6 +120,7 @@ tags:
|
||||
|
||||
- **开放 (Open)(默认)** — Telegram 上任何用户都可以私信机器人(若设置了全局白名单则受其约束)。
|
||||
- **白名单 (Allowlist)** — 私信需要发送者在 **允许的用户 ID** 里。和 `Open` 的差别在白名单为空时:`Allowlist` 模式**全部拒绝**。
|
||||
- **配对审批 (Pairing)** — 与 `Allowlist` 共享同一份名单,但非名单用户被拒后会收到一次性配对码,由你(属主)通过 `/approve <code>` 审批。审批通过的用户会被自动追加到 **允许的用户 ID**,后续 DM 直通。需先填 **你的平台用户 ID**(runtime 用它校验 `/approve` 发起人),并需要部署 Redis。
|
||||
- **禁用 (Disabled)** — 机器人忽略所有私信,只在群组里被 `@提及` 时回复。
|
||||
|
||||
### 群组策略
|
||||
@@ -118,15 +135,15 @@ tags:
|
||||
|
||||
## 配置参考
|
||||
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| ---------------- | ---- | --------------------------------------------------- |
|
||||
| **机器人令牌** | 是 | 来自 BotFather 的 API 令牌 |
|
||||
| **机器人用户 ID** | 自动 | 根据机器人令牌自动生成 |
|
||||
| **Webhook 密钥令牌** | 否 | 用于验证 Webhook 请求的可选密钥 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Telegram 数字用户 ID。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群组中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Telegram chat ID(群组为负数)。仅在群组策略为白名单时使用 |
|
||||
| 字段 | 是否必需 | 描述 |
|
||||
| ---------------- | ---- | ---------------------------------------------------------- |
|
||||
| **机器人令牌** | 是 | 来自 BotFather 的 API 令牌 |
|
||||
| **机器人用户 ID** | 自动 | 根据机器人令牌自动生成 |
|
||||
| **Webhook 密钥令牌** | 否 | 用于验证 Webhook 请求的可选密钥 |
|
||||
| **允许的用户 ID** | 否 | 逗号或空格分隔的 Telegram 数字用户 ID。全局闸门 — 私信和群聊 @ 都受其约束 |
|
||||
| **私信策略** | 否 | `open`(默认)、`allowlist`、`pairing` 或 `disabled` — 控制谁可以私信机器人 |
|
||||
| **群组策略** | 否 | `open`(默认)、`allowlist` 或 `disabled` — 控制机器人在哪些群组中响应 |
|
||||
| **允许的频道 ID** | 否 | 逗号或空格分隔的 Telegram chat ID(群组为负数)。仅在群组策略为白名单时使用 |
|
||||
|
||||
## 故障排除
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Then, When } from '@cucumber/cucumber';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { CustomWorld } from '../../support/world';
|
||||
import type { CustomWorld } from '../../support/world';
|
||||
|
||||
// ============================================
|
||||
// When Steps (Actions)
|
||||
@@ -143,7 +143,9 @@ When('I wait for the next page to load', async function (this: CustomWorld) {
|
||||
When('I click on the first assistant card', async function (this: CustomWorld) {
|
||||
await this.page.waitForLoadState('networkidle', { timeout: 30_000 });
|
||||
|
||||
const firstCard = this.page.locator('[data-testid="assistant-item"]').first();
|
||||
const firstCard = this.page
|
||||
.locator('[data-testid="assistant-item"][data-agent-type="agent"]')
|
||||
.first();
|
||||
await firstCard.waitFor({ state: 'visible', timeout: 30_000 });
|
||||
|
||||
// Store the current URL before clicking
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
"channel.charLimitHint": "Maximum number of characters per message",
|
||||
"channel.concurrency": "Concurrency Mode",
|
||||
"channel.concurrencyDebounce": "Debounce",
|
||||
"channel.concurrencyHint": "Queue processes messages one at a time; Debounce waits for a burst of messages to finish before processing",
|
||||
"channel.concurrencyDebounceHint": "Only process the last message in a burst (earlier ones are dropped)",
|
||||
"channel.concurrencyHint": "How concurrent messages are batched",
|
||||
"channel.concurrencyQueue": "Queue",
|
||||
"channel.concurrencyQueueHint": "Process messages one at a time",
|
||||
"channel.connectFailed": "Bot connection failed",
|
||||
"channel.connectQueued": "Bot connection queued. It will start shortly.",
|
||||
"channel.connectStarting": "Bot is starting. Please wait a moment.",
|
||||
@@ -32,9 +34,11 @@
|
||||
"channel.connecting": "Connecting...",
|
||||
"channel.connectionConfig": "Connection Configuration",
|
||||
"channel.connectionMode": "Connection Mode",
|
||||
"channel.connectionModeHint": "WebSocket is recommended for new bots. Use Webhook if your bot already has a callback URL configured.",
|
||||
"channel.connectionModeHint": "How the platform delivers events to the bot",
|
||||
"channel.connectionModeWebSocket": "WebSocket",
|
||||
"channel.connectionModeWebSocketHint": "Recommended for new bots",
|
||||
"channel.connectionModeWebhook": "Webhook",
|
||||
"channel.connectionModeWebhookHint": "Use if your bot has a callback URL configured",
|
||||
"channel.copied": "Copied to clipboard",
|
||||
"channel.copy": "Copy",
|
||||
"channel.credentials": "Credentials",
|
||||
@@ -56,9 +60,14 @@
|
||||
"channel.dm": "Direct Messages",
|
||||
"channel.dmPolicy": "DM Policy",
|
||||
"channel.dmPolicyAllowlist": "Allowlist",
|
||||
"channel.dmPolicyAllowlistHint": "Only listed users can DM the bot",
|
||||
"channel.dmPolicyDisabled": "Disabled",
|
||||
"channel.dmPolicyHint": "Control who can send direct messages to the bot",
|
||||
"channel.dmPolicyDisabledHint": "Reject all DMs",
|
||||
"channel.dmPolicyHint": "Who can DM the bot",
|
||||
"channel.dmPolicyOpen": "Open",
|
||||
"channel.dmPolicyOpenHint": "Accept DMs from anyone",
|
||||
"channel.dmPolicyPairing": "Pairing",
|
||||
"channel.dmPolicyPairingHint": "Strangers need /approve to DM",
|
||||
"channel.documentation": "Documentation",
|
||||
"channel.enabled": "Enabled",
|
||||
"channel.encryptKey": "Encrypt Key",
|
||||
@@ -80,9 +89,12 @@
|
||||
"channel.groupAllowFromNamePlaceholder": "e.g. #general (your reminder)",
|
||||
"channel.groupPolicy": "Group Policy",
|
||||
"channel.groupPolicyAllowlist": "Allowlist",
|
||||
"channel.groupPolicyAllowlistHint": "Only respond in listed channels",
|
||||
"channel.groupPolicyDisabled": "Disabled",
|
||||
"channel.groupPolicyHint": "Control where the bot responds in groups, channels, and threads",
|
||||
"channel.groupPolicyDisabledHint": "Ignore all group messages",
|
||||
"channel.groupPolicyHint": "Where the bot responds in groups, channels, and threads",
|
||||
"channel.groupPolicyOpen": "Open",
|
||||
"channel.groupPolicyOpenHint": "Respond in any group, channel, or thread",
|
||||
"channel.historyLimit": "History Message Limit",
|
||||
"channel.historyLimitHint": "Default number of messages to fetch when reading channel history",
|
||||
"channel.importConfig": "Import Configuration",
|
||||
@@ -111,8 +123,8 @@
|
||||
"channel.secretToken": "Webhook Secret Token",
|
||||
"channel.secretTokenHint": "Optional. Used to verify webhook requests from Telegram.",
|
||||
"channel.secretTokenPlaceholder": "Optional secret for webhook verification",
|
||||
"channel.serverId": "Default Server (for AI tools)",
|
||||
"channel.serverIdHint": "The server / guild ID AI tools should default to when you ask the bot to act on a server (e.g. 'list channels', 'send to #announcements'). Independent of access control — see Group Policy for that.",
|
||||
"channel.serverId": "Default Server ID",
|
||||
"channel.serverIdHint": "Default server / guild AI tools act on; not used for access control",
|
||||
"channel.settings": "Advanced Settings",
|
||||
"channel.settingsResetConfirm": "Are you sure you want to reset advanced settings to default?",
|
||||
"channel.settingsResetDefault": "Reset to Default",
|
||||
@@ -138,8 +150,8 @@
|
||||
"channel.testFailed": "Connection test failed",
|
||||
"channel.testSuccess": "Connection test passed",
|
||||
"channel.updateFailed": "Failed to update status",
|
||||
"channel.userId": "Your Platform User ID (for AI tools)",
|
||||
"channel.userIdHint": "AI tools use this to reach you proactively (e.g. reminders, notifications); also auto-trusted by the global allowlist.",
|
||||
"channel.userId": "Your Platform User ID",
|
||||
"channel.userIdHint": "Lets AI tools reach you proactively (e.g. reminders); auto-trusted by the global allowlist",
|
||||
"channel.validationError": "Please fill in Application ID and Token",
|
||||
"channel.verificationToken": "Verification Token",
|
||||
"channel.verificationTokenHint": "Optional. Used to verify webhook event source.",
|
||||
|
||||
@@ -570,12 +570,18 @@
|
||||
"taskList.view.list": "List",
|
||||
"taskList.viewAll": "View all",
|
||||
"taskSchedule.clear": "Clear",
|
||||
"taskSchedule.continuous": "Continuous",
|
||||
"taskSchedule.enable": "Enable automation",
|
||||
"taskSchedule.every": "Every",
|
||||
"taskSchedule.frequency": "Frequency",
|
||||
"taskSchedule.hours": "Hours",
|
||||
"taskSchedule.interval": "Recurring",
|
||||
"taskSchedule.intervalTab": "Recurring",
|
||||
"taskSchedule.maxExecutions": "Max runs",
|
||||
"taskSchedule.minutes": "Minutes",
|
||||
"taskSchedule.scheduleType.daily": "Daily",
|
||||
"taskSchedule.scheduleType.hourly": "Hourly",
|
||||
"taskSchedule.scheduleType.weekly": "Weekly",
|
||||
"taskSchedule.scheduler": "Scheduler",
|
||||
"taskSchedule.schedulerNotReady": "Scheduler is coming soon. Use Recurring for now.",
|
||||
"taskSchedule.schedulerTab": "Scheduler",
|
||||
@@ -584,6 +590,8 @@
|
||||
"taskSchedule.tag.every": "Every {{interval}}",
|
||||
"taskSchedule.tag.heartbeat": "Heartbeat · {{every}}",
|
||||
"taskSchedule.tag.schedule": "Schedule · {{schedule}}{{timezone}}",
|
||||
"taskSchedule.time": "Time",
|
||||
"taskSchedule.timezone": "Timezone",
|
||||
"taskSchedule.title": "Schedule",
|
||||
"taskSchedule.unit.hour_one": "{{count}} hr",
|
||||
"taskSchedule.unit.hour_other": "{{count}} hrs",
|
||||
@@ -591,6 +599,14 @@
|
||||
"taskSchedule.unit.minute_other": "{{count}} mins",
|
||||
"taskSchedule.unit.second_one": "{{count}} sec",
|
||||
"taskSchedule.unit.second_other": "{{count}} secs",
|
||||
"taskSchedule.weekday": "Weekday",
|
||||
"taskSchedule.weekdays.fri": "Fri",
|
||||
"taskSchedule.weekdays.mon": "Mon",
|
||||
"taskSchedule.weekdays.sat": "Sat",
|
||||
"taskSchedule.weekdays.sun": "Sun",
|
||||
"taskSchedule.weekdays.thu": "Thu",
|
||||
"taskSchedule.weekdays.tue": "Tue",
|
||||
"taskSchedule.weekdays.wed": "Wed",
|
||||
"thread.closeSubagentThread": "Collapse subagent conversation",
|
||||
"thread.divider": "Subtopic",
|
||||
"thread.openSubagentThread": "View full subagent conversation",
|
||||
|
||||
@@ -624,6 +624,8 @@
|
||||
"user.logout": "Logout",
|
||||
"user.myProfile": "My Profile",
|
||||
"user.noAgents": "This user hasn’t published any Agents yet",
|
||||
"user.noAgents.ownerDescription": "Create your first Agent and share it with the Community.",
|
||||
"user.noAgents.title": "No Agents yet",
|
||||
"user.noFavoriteAgents": "No saved Agents yet",
|
||||
"user.noFavoritePlugins": "No saved Skills yet",
|
||||
"user.noForkedAgentGroups": "No forked Agent Groups yet",
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
"agentSelection.search": "No matching agents found",
|
||||
"brief.action.acknowledge": "Acknowledge",
|
||||
"brief.action.approve": "Approve",
|
||||
"brief.action.confirmDone": "Confirm complete",
|
||||
"brief.action.feedback": "Feedback",
|
||||
"brief.action.retry": "Retry",
|
||||
"brief.addFeedback": "Share feedback",
|
||||
"brief.collapse": "Show less",
|
||||
"brief.commentPlaceholder": "Share your feedback...",
|
||||
"brief.commentSubmit": "Submit feedback",
|
||||
"brief.editResult": "Edit",
|
||||
"brief.expandAll": "Show more",
|
||||
"brief.feedbackSent": "Feedback shared",
|
||||
"brief.resolved": "Marked as resolved",
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
"channel.charLimitHint": "单条消息的最大字符数",
|
||||
"channel.concurrency": "并发模式",
|
||||
"channel.concurrencyDebounce": "防抖",
|
||||
"channel.concurrencyHint": "队列模式逐条处理消息;防抖模式等待连续消息发送完毕后再统一处理",
|
||||
"channel.concurrencyDebounceHint": "仅处理连续消息中的最后一条,前序消息会被丢弃",
|
||||
"channel.concurrencyHint": "并发消息的处理方式",
|
||||
"channel.concurrencyQueue": "队列",
|
||||
"channel.concurrencyQueueHint": "逐条处理消息",
|
||||
"channel.connectFailed": "Bot 连接失败",
|
||||
"channel.connectQueued": "机器人连接已排队。即将启动。",
|
||||
"channel.connectStarting": "机器人正在启动。请稍候。",
|
||||
@@ -32,9 +34,11 @@
|
||||
"channel.connecting": "连接中...",
|
||||
"channel.connectionConfig": "连接配置",
|
||||
"channel.connectionMode": "连接模式",
|
||||
"channel.connectionModeHint": "新机器人推荐使用 WebSocket。如果你的机器人已配置了回调地址,请选择 Webhook。",
|
||||
"channel.connectionModeHint": "平台向机器人推送事件的方式",
|
||||
"channel.connectionModeWebSocket": "WebSocket",
|
||||
"channel.connectionModeWebSocketHint": "推荐用于新机器人",
|
||||
"channel.connectionModeWebhook": "Webhook",
|
||||
"channel.connectionModeWebhookHint": "已配置回调地址时选用",
|
||||
"channel.copied": "已复制到剪贴板",
|
||||
"channel.copy": "复制",
|
||||
"channel.credentials": "凭证配置",
|
||||
@@ -56,9 +60,14 @@
|
||||
"channel.dm": "私信",
|
||||
"channel.dmPolicy": "私信策略",
|
||||
"channel.dmPolicyAllowlist": "白名单",
|
||||
"channel.dmPolicyAllowlistHint": "仅允许名单内的用户发送私信",
|
||||
"channel.dmPolicyDisabled": "禁用",
|
||||
"channel.dmPolicyHint": "控制谁可以向机器人发送私信",
|
||||
"channel.dmPolicyDisabledHint": "拒绝所有私信",
|
||||
"channel.dmPolicyHint": "谁可以向机器人发送私信",
|
||||
"channel.dmPolicyOpen": "开放",
|
||||
"channel.dmPolicyOpenHint": "接受任何人发送的私信",
|
||||
"channel.dmPolicyPairing": "配对审批",
|
||||
"channel.dmPolicyPairingHint": "陌生人需经 /approve 审批后才能私信",
|
||||
"channel.documentation": "文档",
|
||||
"channel.enabled": "已启用",
|
||||
"channel.encryptKey": "Encrypt Key",
|
||||
@@ -80,9 +89,12 @@
|
||||
"channel.groupAllowFromNamePlaceholder": "如:#general(仅你自己可见)",
|
||||
"channel.groupPolicy": "群组策略",
|
||||
"channel.groupPolicyAllowlist": "白名单",
|
||||
"channel.groupPolicyAllowlistHint": "仅在名单内的频道中响应",
|
||||
"channel.groupPolicyDisabled": "禁用",
|
||||
"channel.groupPolicyHint": "控制机器人在群组、频道、子话题里的响应范围",
|
||||
"channel.groupPolicyDisabledHint": "忽略所有群组消息",
|
||||
"channel.groupPolicyHint": "机器人在群组、频道、子话题中的响应范围",
|
||||
"channel.groupPolicyOpen": "开放",
|
||||
"channel.groupPolicyOpenHint": "在所有群组、频道、子话题中响应",
|
||||
"channel.historyLimit": "历史消息条数",
|
||||
"channel.historyLimitHint": "读取频道历史消息时默认获取的消息数量",
|
||||
"channel.importConfig": "导入平台配置",
|
||||
@@ -111,8 +123,8 @@
|
||||
"channel.secretToken": "Webhook 密钥",
|
||||
"channel.secretTokenHint": "可选。用于验证来自 Telegram 的 Webhook 请求。",
|
||||
"channel.secretTokenPlaceholder": "可选的 Webhook 验证密钥",
|
||||
"channel.serverId": "默认服务器(供 AI 工具使用)",
|
||||
"channel.serverIdHint": "你让 bot 在某个服务器上做事时(比如 \"列出频道\"、\"发到 #announcements\"),AI 工具默认操作的服务器 / Guild ID。跟访问控制无关 —— 那是群组策略的事。",
|
||||
"channel.serverId": "默认服务器 ID",
|
||||
"channel.serverIdHint": "AI 工具默认作用的服务器 / Guild,与访问控制无关",
|
||||
"channel.settings": "高级设置",
|
||||
"channel.settingsResetConfirm": "确定要将高级设置恢复为默认配置吗?",
|
||||
"channel.settingsResetDefault": "恢复默认配置",
|
||||
@@ -138,8 +150,8 @@
|
||||
"channel.testFailed": "连接测试失败",
|
||||
"channel.testSuccess": "连接测试通过",
|
||||
"channel.updateFailed": "更新状态失败",
|
||||
"channel.userId": "你的平台用户 ID(供 AI 工具使用)",
|
||||
"channel.userIdHint": "AI 工具用它主动联系你(如定时提醒、通知);该 ID 也会被全局白名单自动信任。",
|
||||
"channel.userId": "你的平台用户 ID",
|
||||
"channel.userIdHint": "供 AI 工具主动联系你(如提醒、通知),并自动加入全局白名单",
|
||||
"channel.validationError": "请填写应用 ID 和 Token",
|
||||
"channel.verificationToken": "Verification Token",
|
||||
"channel.verificationTokenHint": "可选。用于验证事件推送来源。",
|
||||
|
||||
@@ -570,12 +570,18 @@
|
||||
"taskList.view.list": "列表",
|
||||
"taskList.viewAll": "查看全部",
|
||||
"taskSchedule.clear": "清除",
|
||||
"taskSchedule.continuous": "持续执行",
|
||||
"taskSchedule.enable": "启用自动化",
|
||||
"taskSchedule.every": "每",
|
||||
"taskSchedule.frequency": "执行频率",
|
||||
"taskSchedule.hours": "小时",
|
||||
"taskSchedule.interval": "循环任务",
|
||||
"taskSchedule.intervalTab": "循环任务",
|
||||
"taskSchedule.maxExecutions": "最大次数",
|
||||
"taskSchedule.minutes": "分钟",
|
||||
"taskSchedule.scheduleType.daily": "每日",
|
||||
"taskSchedule.scheduleType.hourly": "每小时",
|
||||
"taskSchedule.scheduleType.weekly": "每周",
|
||||
"taskSchedule.scheduler": "定时任务",
|
||||
"taskSchedule.schedulerNotReady": "定时任务即将上线。暂时请使用“循环任务”。",
|
||||
"taskSchedule.schedulerTab": "定时任务",
|
||||
@@ -584,6 +590,8 @@
|
||||
"taskSchedule.tag.every": "每 {{interval}}",
|
||||
"taskSchedule.tag.heartbeat": "心跳 · {{every}}",
|
||||
"taskSchedule.tag.schedule": "计划 · {{schedule}}{{timezone}}",
|
||||
"taskSchedule.time": "时间",
|
||||
"taskSchedule.timezone": "时区",
|
||||
"taskSchedule.title": "计划",
|
||||
"taskSchedule.unit.hour_one": "{{count}} 小时",
|
||||
"taskSchedule.unit.hour_other": "{{count}} 小时",
|
||||
@@ -591,6 +599,14 @@
|
||||
"taskSchedule.unit.minute_other": "{{count}} 分钟",
|
||||
"taskSchedule.unit.second_one": "{{count}} 秒",
|
||||
"taskSchedule.unit.second_other": "{{count}} 秒",
|
||||
"taskSchedule.weekday": "星期",
|
||||
"taskSchedule.weekdays.fri": "五",
|
||||
"taskSchedule.weekdays.mon": "一",
|
||||
"taskSchedule.weekdays.sat": "六",
|
||||
"taskSchedule.weekdays.sun": "日",
|
||||
"taskSchedule.weekdays.thu": "四",
|
||||
"taskSchedule.weekdays.tue": "二",
|
||||
"taskSchedule.weekdays.wed": "三",
|
||||
"thread.closeSubagentThread": "收起子智能体对话",
|
||||
"thread.divider": "子话题",
|
||||
"thread.openSubagentThread": "查看完整子智能体对话",
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
"footer.title": "喜欢我们的产品?",
|
||||
"fullscreen": "全屏模式",
|
||||
"generation.hero.taglinePrefix": "即刻创作",
|
||||
"generation.promptModeration.blocked": "请求内容可能违反内容政策。请调整提示词后重试",
|
||||
"generation.promptModeration.blocked": "内容安全检查未通过,请调整提示词后重试。",
|
||||
"getDesktopApp": "获取桌面应用",
|
||||
"historyRange": "历史范围",
|
||||
"home.suggestQuestions": "试试这些示例",
|
||||
|
||||
@@ -624,6 +624,8 @@
|
||||
"user.logout": "退出登录",
|
||||
"user.myProfile": "我的主页",
|
||||
"user.noAgents": "该用户暂未发布助理",
|
||||
"user.noAgents.ownerDescription": "创建你的第一个助理,分享到社区。",
|
||||
"user.noAgents.title": "还没有助理",
|
||||
"user.noFavoriteAgents": "暂无收藏的助理",
|
||||
"user.noFavoritePlugins": "暂无收藏的插件",
|
||||
"user.noForkedAgentGroups": "尚无已派生的代理组",
|
||||
|
||||
@@ -111,6 +111,8 @@
|
||||
"response.PluginServerError": "技能服务端返回错误,请根据下方信息检查技能描述、配置或服务端实现",
|
||||
"response.PluginSettingsInvalid": "该技能需要完成配置后才能使用,请检查技能配置",
|
||||
"response.ProviderBizError": "模型服务商返回错误。请根据以下信息排查,或稍后重试",
|
||||
"response.ProviderContentModeration": "内容安全检查未通过,请调整描述后重试。",
|
||||
"response.ProviderContentModerationWarning": "多次触发内容安全限制,继续违规可能导致账号受限。",
|
||||
"response.QuotaLimitReached": "Token 用量或请求次数已达配额上限。请提升配额或稍后再试",
|
||||
"response.QuotaLimitReachedCloud": "当前模型服务负载较高,请稍后重试或切换其他模型。",
|
||||
"response.ServerAgentRuntimeError": "助理运行服务暂不可用。请稍后再试,或邮件联系我们",
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
"agentSelection.search": "未找到匹配的助理",
|
||||
"brief.action.acknowledge": "确认",
|
||||
"brief.action.approve": "批准",
|
||||
"brief.action.confirmDone": "确认完成",
|
||||
"brief.action.feedback": "反馈",
|
||||
"brief.action.retry": "重试",
|
||||
"brief.addFeedback": "分享反馈",
|
||||
"brief.collapse": "收起",
|
||||
"brief.commentPlaceholder": "分享你的反馈…",
|
||||
"brief.commentSubmit": "提交反馈",
|
||||
"brief.editResult": "编辑",
|
||||
"brief.expandAll": "展开全部",
|
||||
"brief.feedbackSent": "反馈已提交",
|
||||
"brief.resolved": "已标记为已解决",
|
||||
|
||||
+1
-1
@@ -165,7 +165,7 @@
|
||||
"stylelint-config-clean-order": "7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^6.1.0",
|
||||
"@ant-design/icons": "^6.2.1",
|
||||
"@ant-design/pro-components": "^2.8.10",
|
||||
"@anthropic-ai/sdk": "^0.73.0",
|
||||
"@atlaskit/pragmatic-drag-and-drop": "^1.7.7",
|
||||
|
||||
@@ -6,11 +6,11 @@ Generate text, images, videos, and audio. Alias: \`lh generate\`.
|
||||
|
||||
- \`lh gen text <prompt> [-m <model>] [-p <provider>] [--stream] [--temperature <t>]\` - Generate text
|
||||
- \`lh gen image <prompt> [-m <model>] [-n <count>] [--width <w>] [--height <h>]\` - Generate image
|
||||
- \`lh gen video <prompt> [-m <model>] [--aspect-ratio <r>] [--duration <d>]\` - Generate video
|
||||
- \`lh gen video <prompt> -m <model> -p <provider> [--aspect-ratio <r>] [--duration <d>] [--resolution <res>]\` - Generate video
|
||||
- \`lh gen tts <text> [-o <output>] [--voice <v>] [--speed <s>]\` - Text-to-speech
|
||||
- \`lh gen asr <audioFile> [--model <m>] [--language <l>]\` - Speech-to-text
|
||||
- \`lh gen status <generationId> <taskId>\` - Check generation task status
|
||||
- \`lh gen download <generationId> <taskId> [-o <output>]\` - Wait and download result
|
||||
- \`lh gen status <generationId> <asyncTaskId>\` - Check generation task status
|
||||
- \`lh gen download <generationId> <asyncTaskId> [-o <output>]\` - Wait and download result
|
||||
- \`lh gen list\` - List generation topics
|
||||
|
||||
## Tips
|
||||
@@ -18,6 +18,30 @@ Generate text, images, videos, and audio. Alias: \`lh generate\`.
|
||||
- Image/video generation is async; use \`status\` or \`download\` to get results
|
||||
- \`--stream\` for text generation outputs tokens as they arrive
|
||||
- \`--pipe\` for text generation outputs only the raw text (no formatting)
|
||||
|
||||
## ⚠️ asyncTaskId vs generationId
|
||||
|
||||
\`gen status\` and \`gen download\` require TWO different IDs:
|
||||
|
||||
- \`<generationId>\` — prefixed with \`gen_\`, e.g. \`gen_abc123\`
|
||||
- \`<asyncTaskId>\` — a UUID printed after \`→ Task\` in the \`gen image\` / \`gen video\` output,
|
||||
e.g. \`7ad0eb13-e9a5-4403-8070-1f7fe95b2f95\`
|
||||
|
||||
Passing \`gen_xxx\` as \`<asyncTaskId>\` will cause a server error. Always use the UUID.
|
||||
|
||||
Example output from \`lh gen video\`:
|
||||
\`\`\`
|
||||
✓ Video generation started
|
||||
Batch ID: gb_xxx
|
||||
Generation gen_abc123 → Task 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ← this is asyncTaskId
|
||||
\`\`\`
|
||||
|
||||
Correct usage:
|
||||
\`\`\`bash
|
||||
lh gen status gen_abc123 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95
|
||||
lh gen download gen_abc123 7ad0eb13-e9a5-4403-8070-1f7fe95b2f95 -o result.mp4
|
||||
\`\`\`
|
||||
`;
|
||||
|
||||
export default content;
|
||||
|
||||
@@ -15,7 +15,7 @@ export const BriefManifest: BuiltinToolManifest = {
|
||||
properties: {
|
||||
actions: {
|
||||
description:
|
||||
'Custom action buttons for the user. If omitted, defaults are generated based on type. Each action has key (identifier), label (display text), and type ("resolve" to close, "comment" to prompt feedback).',
|
||||
'Custom action buttons for the user. Ignored when type is "result" (result briefs render a fixed approve button). For other types, if omitted, defaults are generated based on type. Each action has key (identifier), label (display text), and type ("resolve" to close, "comment" to prompt feedback).',
|
||||
items: {
|
||||
properties: {
|
||||
key: { description: 'Action identifier, e.g. "approve", "split"', type: 'string' },
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
export const TASK_STATUSES = [
|
||||
'backlog',
|
||||
'running',
|
||||
'scheduled',
|
||||
'paused',
|
||||
'completed',
|
||||
'failed',
|
||||
'canceled',
|
||||
] as const;
|
||||
|
||||
export const UNFINISHED_TASK_STATUSES = ['backlog', 'running', 'paused'] as const;
|
||||
export const UNFINISHED_TASK_STATUSES = ['backlog', 'running', 'scheduled', 'paused'] as const;
|
||||
|
||||
@@ -0,0 +1,477 @@
|
||||
// @vitest-environment node
|
||||
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
import { getTestDB } from '../../core/getTestDB';
|
||||
import { agents, chatGroups, documents, knowledgeBases, tasks, topics, users } from '../../schemas';
|
||||
import type { LobeChatDatabase } from '../../type';
|
||||
import { RecentModel } from '../recent';
|
||||
|
||||
const serverDB: LobeChatDatabase = await getTestDB();
|
||||
|
||||
const userId = 'recent-model-test-user';
|
||||
const otherUserId = 'recent-model-test-other-user';
|
||||
|
||||
const recentModel = new RecentModel(serverDB, userId);
|
||||
|
||||
const now = () => new Date();
|
||||
const minutesAgo = (n: number) => new Date(Date.now() - n * 60 * 1000);
|
||||
|
||||
const baseDocFields = {
|
||||
fileType: 'markdown',
|
||||
source: 'document',
|
||||
totalCharCount: 100,
|
||||
totalLineCount: 5,
|
||||
} as const;
|
||||
|
||||
const baseTaskFields = {
|
||||
instruction: 'do the thing',
|
||||
seq: 1,
|
||||
} as const;
|
||||
|
||||
describe('RecentModel', () => {
|
||||
beforeEach(async () => {
|
||||
await serverDB.delete(users);
|
||||
await serverDB.insert(users).values([{ id: userId }, { id: otherUserId }]);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await serverDB.delete(users);
|
||||
});
|
||||
|
||||
describe('queryRecent', () => {
|
||||
it('returns empty array when user has no recent items', async () => {
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('only returns rows for the calling user', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-mine', userId, slug: 'inbox' });
|
||||
await serverDB
|
||||
.insert(agents)
|
||||
.values({ id: 'agent-other', userId: otherUserId, slug: 'inbox' });
|
||||
|
||||
await serverDB.insert(topics).values([
|
||||
{ id: 'topic-mine', userId, agentId: 'agent-mine', title: 'mine', updatedAt: now() },
|
||||
{
|
||||
id: 'topic-other',
|
||||
userId: otherUserId,
|
||||
agentId: 'agent-other',
|
||||
title: 'other',
|
||||
updatedAt: now(),
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0]).toMatchObject({ id: 'topic-mine', type: 'topic' });
|
||||
});
|
||||
|
||||
describe('topics arm', () => {
|
||||
it('includes inbox-agent topics and group topics', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-inbox', userId, slug: 'inbox' });
|
||||
await serverDB.insert(chatGroups).values({ id: 'group-1', userId });
|
||||
|
||||
await serverDB.insert(topics).values([
|
||||
{
|
||||
id: 'topic-inbox',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
title: 'inbox topic',
|
||||
updatedAt: minutesAgo(5),
|
||||
},
|
||||
{
|
||||
id: 'topic-group',
|
||||
userId,
|
||||
groupId: 'group-1',
|
||||
title: 'group topic',
|
||||
updatedAt: minutesAgo(2),
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result.map((r) => r.id)).toEqual(['topic-group', 'topic-inbox']);
|
||||
expect(result[0]).toMatchObject({
|
||||
id: 'topic-group',
|
||||
type: 'topic',
|
||||
routeId: null,
|
||||
routeGroupId: 'group-1',
|
||||
});
|
||||
expect(result[1]).toMatchObject({
|
||||
id: 'topic-inbox',
|
||||
type: 'topic',
|
||||
routeId: 'agent-inbox',
|
||||
routeGroupId: null,
|
||||
});
|
||||
});
|
||||
|
||||
it('includes topics on non-virtual non-group agents', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-real', userId, virtual: false });
|
||||
|
||||
await serverDB.insert(topics).values({
|
||||
id: 'topic-real',
|
||||
userId,
|
||||
agentId: 'agent-real',
|
||||
title: 'real',
|
||||
updatedAt: now(),
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0].id).toBe('topic-real');
|
||||
});
|
||||
|
||||
it('excludes topics on virtual agents that are not in a group', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-virtual', userId, virtual: true });
|
||||
|
||||
await serverDB.insert(topics).values({
|
||||
id: 'topic-virtual',
|
||||
userId,
|
||||
agentId: 'agent-virtual',
|
||||
title: 'virtual',
|
||||
updatedAt: now(),
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('excludes topics with system triggers', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-inbox', userId, slug: 'inbox' });
|
||||
|
||||
await serverDB.insert(topics).values([
|
||||
{ id: 'topic-cron', userId, agentId: 'agent-inbox', trigger: 'cron', updatedAt: now() },
|
||||
{ id: 'topic-eval', userId, agentId: 'agent-inbox', trigger: 'eval', updatedAt: now() },
|
||||
{
|
||||
id: 'topic-task',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
trigger: 'task_manager',
|
||||
updatedAt: now(),
|
||||
},
|
||||
{
|
||||
id: 'topic-task2',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
trigger: 'task',
|
||||
updatedAt: now(),
|
||||
},
|
||||
{
|
||||
id: 'topic-chat',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
trigger: 'chat',
|
||||
updatedAt: now(),
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result.map((r) => r.id)).toEqual(['topic-chat']);
|
||||
});
|
||||
|
||||
it('falls back to "Untitled Topic" when title is null', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-inbox', userId, slug: 'inbox' });
|
||||
await serverDB.insert(topics).values({
|
||||
id: 'topic-untitled',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
title: null,
|
||||
updatedAt: now(),
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result[0].title).toBe('Untitled Topic');
|
||||
});
|
||||
|
||||
it('returns topic metadata when present', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-inbox', userId, slug: 'inbox' });
|
||||
await serverDB.insert(topics).values({
|
||||
id: 'topic-with-meta',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
metadata: { bot: { platform: 'slack' } } as any,
|
||||
updatedAt: now(),
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result[0].metadata).toEqual({ bot: { platform: 'slack' } });
|
||||
});
|
||||
});
|
||||
|
||||
describe('documents arm', () => {
|
||||
it('includes user-authored "api" pages', async () => {
|
||||
await serverDB.insert(documents).values({
|
||||
id: 'doc-api',
|
||||
userId,
|
||||
title: 'My Page',
|
||||
sourceType: 'api',
|
||||
updatedAt: now(),
|
||||
...baseDocFields,
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0]).toMatchObject({
|
||||
id: 'doc-api',
|
||||
type: 'document',
|
||||
title: 'My Page',
|
||||
routeId: null,
|
||||
routeGroupId: null,
|
||||
metadata: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
it('excludes web-browsing scraped pages (sourceType "web")', async () => {
|
||||
await serverDB.insert(documents).values([
|
||||
{
|
||||
id: 'doc-api',
|
||||
userId,
|
||||
title: 'Real Page',
|
||||
sourceType: 'api',
|
||||
updatedAt: minutesAgo(1),
|
||||
...baseDocFields,
|
||||
},
|
||||
{
|
||||
id: 'doc-web',
|
||||
userId,
|
||||
title: 'XAU USD | Gold Spot US Dollar',
|
||||
sourceType: 'web',
|
||||
updatedAt: now(),
|
||||
...baseDocFields,
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result.map((r) => r.id)).toEqual(['doc-api']);
|
||||
});
|
||||
|
||||
it('excludes file uploads (sourceType "file")', async () => {
|
||||
await serverDB.insert(documents).values({
|
||||
id: 'doc-file',
|
||||
userId,
|
||||
sourceType: 'file',
|
||||
updatedAt: now(),
|
||||
...baseDocFields,
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('excludes documents inside a knowledge base', async () => {
|
||||
await serverDB.insert(knowledgeBases).values({ id: 'kb-1', userId, name: 'kb' });
|
||||
await serverDB.insert(documents).values({
|
||||
id: 'doc-kb',
|
||||
userId,
|
||||
title: 'kb doc',
|
||||
sourceType: 'api',
|
||||
knowledgeBaseId: 'kb-1',
|
||||
updatedAt: now(),
|
||||
...baseDocFields,
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('excludes folder documents', async () => {
|
||||
await serverDB.insert(documents).values({
|
||||
id: 'doc-folder',
|
||||
userId,
|
||||
title: 'Folder',
|
||||
sourceType: 'api',
|
||||
updatedAt: now(),
|
||||
...baseDocFields,
|
||||
fileType: 'custom/folder',
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toEqual([]);
|
||||
});
|
||||
|
||||
it('falls back to filename then "Untitled Document" when title is null', async () => {
|
||||
await serverDB.insert(documents).values([
|
||||
{
|
||||
id: 'doc-fallback-filename',
|
||||
userId,
|
||||
title: null,
|
||||
filename: 'notes.md',
|
||||
sourceType: 'api',
|
||||
updatedAt: minutesAgo(1),
|
||||
...baseDocFields,
|
||||
},
|
||||
{
|
||||
id: 'doc-untitled',
|
||||
userId,
|
||||
title: null,
|
||||
filename: null,
|
||||
sourceType: 'api',
|
||||
updatedAt: now(),
|
||||
...baseDocFields,
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
const byId = Object.fromEntries(result.map((r) => [r.id, r.title]));
|
||||
expect(byId['doc-fallback-filename']).toBe('notes.md');
|
||||
expect(byId['doc-untitled']).toBe('Untitled Document');
|
||||
});
|
||||
});
|
||||
|
||||
describe('tasks arm', () => {
|
||||
it('includes active tasks and surfaces assigneeAgentId as routeId', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-assignee', userId });
|
||||
|
||||
await serverDB.insert(tasks).values({
|
||||
id: 'task-active',
|
||||
createdByUserId: userId,
|
||||
assigneeAgentId: 'agent-assignee',
|
||||
identifier: 'T-1',
|
||||
name: 'Active Task',
|
||||
status: 'running',
|
||||
updatedAt: now(),
|
||||
...baseTaskFields,
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result).toHaveLength(1);
|
||||
expect(result[0]).toMatchObject({
|
||||
id: 'task-active',
|
||||
type: 'task',
|
||||
title: 'Active Task',
|
||||
routeId: 'agent-assignee',
|
||||
routeGroupId: null,
|
||||
});
|
||||
});
|
||||
|
||||
it('excludes completed and canceled tasks', async () => {
|
||||
await serverDB.insert(tasks).values([
|
||||
{
|
||||
id: 'task-done',
|
||||
createdByUserId: userId,
|
||||
identifier: 'T-2',
|
||||
status: 'completed',
|
||||
updatedAt: now(),
|
||||
...baseTaskFields,
|
||||
},
|
||||
{
|
||||
id: 'task-canceled',
|
||||
createdByUserId: userId,
|
||||
identifier: 'T-3',
|
||||
status: 'canceled',
|
||||
updatedAt: now(),
|
||||
...baseTaskFields,
|
||||
},
|
||||
{
|
||||
id: 'task-running',
|
||||
createdByUserId: userId,
|
||||
identifier: 'T-4',
|
||||
status: 'running',
|
||||
updatedAt: now(),
|
||||
...baseTaskFields,
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
expect(result.map((r) => r.id)).toEqual(['task-running']);
|
||||
});
|
||||
|
||||
it('falls back from name → instruction → "Untitled Task"', async () => {
|
||||
await serverDB.insert(tasks).values([
|
||||
{
|
||||
id: 'task-named',
|
||||
createdByUserId: userId,
|
||||
identifier: 'T-A',
|
||||
name: 'Named',
|
||||
instruction: 'do A',
|
||||
seq: 1,
|
||||
status: 'running',
|
||||
updatedAt: minutesAgo(2),
|
||||
},
|
||||
{
|
||||
id: 'task-instruction',
|
||||
createdByUserId: userId,
|
||||
identifier: 'T-B',
|
||||
name: null,
|
||||
instruction: 'fallback to instruction',
|
||||
seq: 2,
|
||||
status: 'running',
|
||||
updatedAt: minutesAgo(1),
|
||||
},
|
||||
]);
|
||||
|
||||
const result = await recentModel.queryRecent();
|
||||
const byId = Object.fromEntries(result.map((r) => [r.id, r.title]));
|
||||
expect(byId['task-named']).toBe('Named');
|
||||
expect(byId['task-instruction']).toBe('fallback to instruction');
|
||||
});
|
||||
});
|
||||
|
||||
describe('combined results', () => {
|
||||
it('orders all three types by updatedAt desc and applies the limit', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-inbox', userId, slug: 'inbox' });
|
||||
|
||||
await serverDB.insert(topics).values({
|
||||
id: 'topic-1',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
title: 'topic',
|
||||
updatedAt: minutesAgo(10),
|
||||
});
|
||||
await serverDB.insert(documents).values({
|
||||
id: 'doc-1',
|
||||
userId,
|
||||
title: 'doc',
|
||||
sourceType: 'api',
|
||||
updatedAt: minutesAgo(5),
|
||||
...baseDocFields,
|
||||
});
|
||||
await serverDB.insert(tasks).values({
|
||||
id: 'task-1',
|
||||
createdByUserId: userId,
|
||||
identifier: 'T-1',
|
||||
name: 'task',
|
||||
status: 'running',
|
||||
updatedAt: minutesAgo(1),
|
||||
...baseTaskFields,
|
||||
});
|
||||
|
||||
const result = await recentModel.queryRecent(10);
|
||||
expect(result.map((r) => `${r.type}:${r.id}`)).toEqual([
|
||||
'task:task-1',
|
||||
'document:doc-1',
|
||||
'topic:topic-1',
|
||||
]);
|
||||
});
|
||||
|
||||
it('respects the limit parameter', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-inbox', userId, slug: 'inbox' });
|
||||
await serverDB.insert(topics).values(
|
||||
Array.from({ length: 5 }, (_, i) => ({
|
||||
id: `topic-${i}`,
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
title: `t${i}`,
|
||||
updatedAt: minutesAgo(i),
|
||||
})),
|
||||
);
|
||||
|
||||
const result = await recentModel.queryRecent(2);
|
||||
expect(result).toHaveLength(2);
|
||||
expect(result.map((r) => r.id)).toEqual(['topic-0', 'topic-1']);
|
||||
});
|
||||
|
||||
it('returns Date objects for updatedAt', async () => {
|
||||
await serverDB.insert(agents).values({ id: 'agent-inbox', userId, slug: 'inbox' });
|
||||
await serverDB.insert(topics).values({
|
||||
id: 'topic-date',
|
||||
userId,
|
||||
agentId: 'agent-inbox',
|
||||
updatedAt: now(),
|
||||
});
|
||||
|
||||
const [row] = await recentModel.queryRecent();
|
||||
expect(row.updatedAt).toBeInstanceOf(Date);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,4 +1,5 @@
|
||||
import { sql } from 'drizzle-orm';
|
||||
import { and, desc, eq, inArray, isNotNull, isNull, ne, not, or, sql } from 'drizzle-orm';
|
||||
import { unionAll } from 'drizzle-orm/pg-core';
|
||||
|
||||
import { agents, DOCUMENT_FOLDER_TYPE, documents, tasks, topics } from '../schemas';
|
||||
import type { LobeChatDatabase } from '../type';
|
||||
@@ -13,6 +14,17 @@ export interface RecentDbItem {
|
||||
updatedAt: Date;
|
||||
}
|
||||
|
||||
// Mirrors `MAIN_SIDEBAR_EXCLUDE_TRIGGERS` in `src/const/topic.ts`. System-trigger
|
||||
// topics live in their own surfaces (Task Manager, cron, eval, task runs) and
|
||||
// would clutter the main "Recent" list.
|
||||
const SYSTEM_TOPIC_TRIGGERS = ['cron', 'eval', 'task_manager', 'task'];
|
||||
|
||||
// Excluded so file uploads and web-browsing tool scrapes don't surface as
|
||||
// "recent docs"; only user-authored pages ('api') and legacy 'topic' rows remain.
|
||||
const TOOL_DOCUMENT_SOURCE_TYPES = ['file', 'web'] as const;
|
||||
|
||||
const TASK_FINAL_STATUSES = ['completed', 'canceled'];
|
||||
|
||||
export class RecentModel {
|
||||
private userId: string;
|
||||
private db: LobeChatDatabase;
|
||||
@@ -23,69 +35,85 @@ export class RecentModel {
|
||||
}
|
||||
|
||||
queryRecent = async (limit: number = 10): Promise<RecentDbItem[]> => {
|
||||
const query = sql`
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
${topics.id} as id,
|
||||
COALESCE(${topics.title}, 'Untitled Topic') as title,
|
||||
'topic' as type,
|
||||
${topics.agentId} as route_id,
|
||||
${topics.groupId} as route_group_id,
|
||||
${topics.updatedAt} as updated_at,
|
||||
${topics.metadata} as metadata
|
||||
FROM ${topics}
|
||||
LEFT JOIN ${agents} ON ${topics.agentId} = ${agents.id}
|
||||
WHERE ${topics.userId} = ${this.userId}
|
||||
AND (
|
||||
${topics.groupId} IS NOT NULL
|
||||
OR ${agents.slug} = 'inbox'
|
||||
OR (${topics.groupId} IS NULL AND ${agents.virtual} != true)
|
||||
)
|
||||
const topicArm = this.db
|
||||
.select({
|
||||
id: topics.id,
|
||||
metadata: sql<any>`${topics.metadata}`.as('metadata'),
|
||||
routeGroupId: sql<string | null>`${topics.groupId}`.as('route_group_id'),
|
||||
routeId: sql<string | null>`${topics.agentId}`.as('route_id'),
|
||||
title: sql<string>`COALESCE(${topics.title}, 'Untitled Topic')`.as('title'),
|
||||
type: sql<RecentDbItem['type']>`'topic'`.as('type'),
|
||||
updatedAt: topics.updatedAt,
|
||||
})
|
||||
.from(topics)
|
||||
.leftJoin(agents, eq(topics.agentId, agents.id))
|
||||
.where(
|
||||
and(
|
||||
eq(topics.userId, this.userId),
|
||||
or(
|
||||
isNotNull(topics.groupId),
|
||||
eq(agents.slug, 'inbox'),
|
||||
and(isNull(topics.groupId), ne(agents.virtual, true)),
|
||||
),
|
||||
or(isNull(topics.trigger), not(inArray(topics.trigger, SYSTEM_TOPIC_TRIGGERS))),
|
||||
),
|
||||
);
|
||||
|
||||
UNION ALL
|
||||
const documentArm = this.db
|
||||
.select({
|
||||
id: documents.id,
|
||||
metadata: sql<any>`NULL`.as('metadata'),
|
||||
routeGroupId: sql<string | null>`NULL`.as('route_group_id'),
|
||||
routeId: sql<string | null>`NULL`.as('route_id'),
|
||||
title:
|
||||
sql<string>`COALESCE(${documents.title}, ${documents.filename}, 'Untitled Document')`.as(
|
||||
'title',
|
||||
),
|
||||
type: sql<RecentDbItem['type']>`'document'`.as('type'),
|
||||
updatedAt: documents.updatedAt,
|
||||
})
|
||||
.from(documents)
|
||||
.where(
|
||||
and(
|
||||
eq(documents.userId, this.userId),
|
||||
not(inArray(documents.sourceType, TOOL_DOCUMENT_SOURCE_TYPES)),
|
||||
isNull(documents.knowledgeBaseId),
|
||||
ne(documents.fileType, DOCUMENT_FOLDER_TYPE),
|
||||
),
|
||||
);
|
||||
|
||||
SELECT
|
||||
${documents.id} as id,
|
||||
COALESCE(${documents.title}, ${documents.filename}, 'Untitled Document') as title,
|
||||
'document' as type,
|
||||
NULL as route_id,
|
||||
NULL as route_group_id,
|
||||
${documents.updatedAt} as updated_at,
|
||||
NULL as metadata
|
||||
FROM ${documents}
|
||||
WHERE ${documents.userId} = ${this.userId}
|
||||
AND ${documents.sourceType} != 'file'
|
||||
AND ${documents.knowledgeBaseId} IS NULL
|
||||
AND ${documents.fileType} != ${DOCUMENT_FOLDER_TYPE}
|
||||
const taskArm = this.db
|
||||
.select({
|
||||
id: tasks.id,
|
||||
metadata: sql<any>`NULL`.as('metadata'),
|
||||
routeGroupId: sql<string | null>`NULL`.as('route_group_id'),
|
||||
routeId: sql<string | null>`${tasks.assigneeAgentId}`.as('route_id'),
|
||||
title: sql<string>`COALESCE(${tasks.name}, ${tasks.instruction}, 'Untitled Task')`.as(
|
||||
'title',
|
||||
),
|
||||
type: sql<RecentDbItem['type']>`'task'`.as('type'),
|
||||
updatedAt: tasks.updatedAt,
|
||||
})
|
||||
.from(tasks)
|
||||
.where(
|
||||
and(
|
||||
eq(tasks.createdByUserId, this.userId),
|
||||
not(inArray(tasks.status, TASK_FINAL_STATUSES)),
|
||||
),
|
||||
);
|
||||
|
||||
UNION ALL
|
||||
const rows = await unionAll(topicArm, documentArm, taskArm)
|
||||
.orderBy(desc(sql`updated_at`))
|
||||
.limit(limit);
|
||||
|
||||
SELECT
|
||||
${tasks.id} as id,
|
||||
COALESCE(${tasks.name}, ${tasks.instruction}, 'Untitled Task') as title,
|
||||
'task' as type,
|
||||
${tasks.assigneeAgentId} as route_id,
|
||||
NULL as route_group_id,
|
||||
${tasks.updatedAt} as updated_at,
|
||||
NULL as metadata
|
||||
FROM ${tasks}
|
||||
WHERE ${tasks.createdByUserId} = ${this.userId}
|
||||
AND ${tasks.status} NOT IN ('completed', 'canceled')
|
||||
) AS combined
|
||||
ORDER BY updated_at DESC
|
||||
LIMIT ${limit}
|
||||
`;
|
||||
|
||||
const result = await this.db.execute(query);
|
||||
|
||||
return result.rows.map((row: any) => ({
|
||||
return rows.map((row) => ({
|
||||
id: row.id,
|
||||
metadata: row.metadata ?? undefined,
|
||||
routeGroupId: row.route_group_id,
|
||||
routeId: row.route_id,
|
||||
routeGroupId: row.routeGroupId,
|
||||
routeId: row.routeId,
|
||||
title: row.title,
|
||||
type: row.type as RecentDbItem['type'],
|
||||
updatedAt: new Date(row.updated_at),
|
||||
type: row.type,
|
||||
updatedAt: row.updatedAt instanceof Date ? row.updatedAt : new Date(row.updatedAt as any),
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -175,12 +175,13 @@ export class TaskTopicModel {
|
||||
.orderBy(desc(taskTopics.seq));
|
||||
}
|
||||
|
||||
async findWithHandoff(taskId: string, limit = 4) {
|
||||
async findWithHandoff(taskId: string, limit: number) {
|
||||
const { topics } = await import('../schemas/topic');
|
||||
return this.db
|
||||
.select({
|
||||
createdAt: taskTopics.createdAt,
|
||||
handoff: taskTopics.handoff,
|
||||
metadata: topics.metadata,
|
||||
seq: taskTopics.seq,
|
||||
status: taskTopics.status,
|
||||
title: topics.title,
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
export interface ShowDesktopNotificationParams {
|
||||
body: string;
|
||||
force?: boolean;
|
||||
/**
|
||||
* SPA path to navigate to when the user clicks the notification.
|
||||
* Reuses the existing `navigate` main-broadcast pipeline, so it requires
|
||||
* `DesktopNavigationBridge` to be mounted on the renderer side.
|
||||
*/
|
||||
navigate?: { path: string; replace?: boolean };
|
||||
requestAttention?: boolean;
|
||||
silent?: boolean;
|
||||
title: string;
|
||||
|
||||
@@ -1,6 +1,68 @@
|
||||
import { type AIChatModelCard } from '../types/aiModel';
|
||||
import { type AIChatModelCard, type AIImageModelCard } from '../types/aiModel';
|
||||
import { gptImage2Schema } from './lobehub';
|
||||
|
||||
const aihubmixModels: AIChatModelCard[] = [
|
||||
const aihubmixChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 1_050_000,
|
||||
description: 'GPT-5.5 is our newest frontier model for the most complex professional work.',
|
||||
displayName: 'GPT-5.5',
|
||||
enabled: true,
|
||||
id: 'gpt-5.5',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.272]': 5,
|
||||
'[0.272, infinity]': 10,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textInput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.272]': 0.5,
|
||||
'[0.272, infinity]': 1,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textInput_cacheRead',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.272]': 30,
|
||||
'[0.272, infinity]': 45,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textOutput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-23',
|
||||
settings: {
|
||||
extendParams: ['gpt5_2ReasoningEffort', 'textVerbosity'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -13,7 +75,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'GPT-5.4 is the frontier model for complex professional work with highest reasoning capability.',
|
||||
displayName: 'GPT-5.4',
|
||||
enabled: true,
|
||||
id: 'gpt-5.4',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
@@ -745,6 +806,87 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 2_000_000,
|
||||
description: 'A non-reasoning variant for simple use cases',
|
||||
displayName: 'Grok 4.20 (Non-Reasoning)',
|
||||
enabled: true,
|
||||
id: 'grok-4-20-non-reasoning',
|
||||
maxOutput: 2_000_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-03-09',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 2_000_000,
|
||||
description: 'Intelligent, blazing-fast model that reasons before responding',
|
||||
displayName: 'Grok 4.20',
|
||||
enabled: true,
|
||||
id: 'grok-4-20-reasoning',
|
||||
maxOutput: 2_000_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-03-09',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 2_000_000,
|
||||
description:
|
||||
'A team of 4 or 16 agents, Excels at research use cases, Does not currently support client-side tools. Only supports xAI server side tools (eg X Search, Web Search tools) and remote MCP tools.',
|
||||
displayName: 'Grok 4.20 Multi-Agent',
|
||||
enabled: true,
|
||||
id: 'grok-4.20-multi-agent-0309',
|
||||
maxOutput: 2_000_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 6, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-03-09',
|
||||
settings: {
|
||||
extendParams: ['grok4_20ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -853,6 +995,36 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
"Claude Opus 4.7 is Anthropic's most capable generally available model for complex reasoning and agentic coding.",
|
||||
displayName: 'Claude Opus 4.7',
|
||||
enabled: true,
|
||||
id: 'claude-opus-4-7',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput_cacheWrite', rate: 6.25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-16',
|
||||
settings: {
|
||||
extendParams: ['disableContextCaching', 'enableAdaptiveThinking', 'opus47Effort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -865,7 +1037,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'Claude Opus 4.6 is Anthropic’s most intelligent model for building agents and coding.',
|
||||
displayName: 'Claude Opus 4.6',
|
||||
enabled: true,
|
||||
id: 'claude-opus-4-6',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
@@ -1195,48 +1366,6 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek-V3.2 is an efficient LLM with DSA sparse attention and strengthened reasoning. Its key strength is agent capability, combining reasoning with real tool use through large-scale task synthesis for more robust, compliant, and generalizable agents.',
|
||||
displayName: 'DeepSeek V3.2',
|
||||
id: 'deepseek-chat',
|
||||
maxOutput: 8192,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 0.45, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput_cacheRead', rate: 0.03, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-12-01',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'DeepSeek V3.2 thinking mode outputs a chain-of-thought before the final answer to improve accuracy.',
|
||||
displayName: 'DeepSeek V3.2 Thinking',
|
||||
enabled: true,
|
||||
id: 'deepseek-reasoner',
|
||||
maxOutput: 65_536,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 0.45, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput_cacheRead', rate: 0.03, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-12-01',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -1783,4 +1912,30 @@ const aihubmixModels: AIChatModelCard[] = [
|
||||
},
|
||||
];
|
||||
|
||||
export default aihubmixModels;
|
||||
const aihubmixImageModels: AIImageModelCard[] = [
|
||||
{
|
||||
description:
|
||||
"OpenAI's next-generation multimodal image model with native reasoning, up to 4K resolution, near-perfect text rendering, and high-fidelity multilingual support.",
|
||||
displayName: 'GPT Image 2',
|
||||
enabled: true,
|
||||
id: 'gpt-image-2',
|
||||
parameters: gptImage2Schema,
|
||||
pricing: {
|
||||
// Medium quality at 1024x1024: ~1767 output tokens * $30/M = $0.053 per image.
|
||||
// Source: https://aihubmix.com/model/gpt-image-2
|
||||
approximatePricePerImage: 0.053,
|
||||
units: [
|
||||
{ name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'imageInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'imageOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-21',
|
||||
type: 'image',
|
||||
},
|
||||
];
|
||||
|
||||
export const allModels = [...aihubmixChatModels, ...aihubmixImageModels];
|
||||
|
||||
export default allModels;
|
||||
|
||||
@@ -1,6 +1,37 @@
|
||||
import { type AIChatModelCard } from '../types/aiModel';
|
||||
|
||||
const anthropicChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
"Claude Opus 4.7 is Anthropic's most capable generally available model for complex reasoning and agentic coding.",
|
||||
displayName: 'Claude Opus 4.7',
|
||||
enabled: true,
|
||||
id: 'claude-opus-4-7',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput_cacheWrite', rate: 6.25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-16',
|
||||
settings: {
|
||||
disabledParams: ['temperature', 'top_p'],
|
||||
extendParams: ['disableContextCaching', 'enableAdaptiveThinking', 'opus47Effort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -13,7 +44,6 @@ const anthropicChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'Claude Opus 4.6 is Anthropic’s most intelligent model for building agents and coding.',
|
||||
displayName: 'Claude Opus 4.6',
|
||||
enabled: true,
|
||||
id: 'claude-opus-4-6',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
|
||||
@@ -1,6 +1,97 @@
|
||||
import type { AIChatModelCard } from '../types/aiModel';
|
||||
|
||||
const baichuanChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
search: true,
|
||||
},
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'We introduce Baichuan-M3, a new-generation medical-enhanced large language model designed to support clinical-grade medical assistance. In contrast to prior approaches that primarily focus on static question answering or superficial role-playing, Baichuan-M3 is trained to explicitly model the clinical decision-making process, aiming to improve usability and reliability in real-world medical practice. Rather than merely producing plausible-sounding answers, fluent doctor-like questioning, or high-frequency but vague recommendations such as “you should seek medical attention as soon as possible,” Baichuan-M3 is explicitly trained to proactively acquire critical clinical information, construct coherent medical reasoning pathways, and systematically constrain hallucination-prone behaviors throughout the decision process. This design endows the model with intrinsic medical-enhanced capabilities aligned with real clinical workflows. Across evaluations of clinical inquiry, medical hallucination robustness, HealthBench, and HealthBench-Hard, Baichuan-M3 surpasses the latest flagship model released by OpenAI, GPT-5.2, establishing a new state of the art in medical-enhanced language models.',
|
||||
displayName: 'Baichuan M3 Plus',
|
||||
id: 'Baichuan-M3-Plus',
|
||||
maxOutput: 32_768,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 9, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
searchImpl: 'internal',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
},
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
'We introduce Baichuan-M3, a new-generation medical-enhanced large language model designed to support clinical-grade medical assistance. In contrast to prior approaches that primarily focus on static question answering or superficial role-playing, Baichuan-M3 is trained to explicitly model the clinical decision-making process, aiming to improve usability and reliability in real-world medical practice. Rather than merely producing plausible-sounding answers, fluent doctor-like questioning, or high-frequency but vague recommendations such as “you should seek medical attention as soon as possible,” Baichuan-M3 is explicitly trained to proactively acquire critical clinical information, construct coherent medical reasoning pathways, and systematically constrain hallucination-prone behaviors throughout the decision process. This design endows the model with intrinsic medical-enhanced capabilities aligned with real clinical workflows. Across evaluations of clinical inquiry, medical hallucination robustness, HealthBench, and HealthBench-Hard, Baichuan-M3 surpasses the latest flagship model released by OpenAI, GPT-5.2, establishing a new state of the art in medical-enhanced language models.',
|
||||
displayName: 'Baichuan M3',
|
||||
enabled: true,
|
||||
id: 'Baichuan-M3',
|
||||
maxOutput: 32_768,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['reasoningBudgetToken'],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
search: true,
|
||||
},
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
"We introduce Baichuan-M2, a medically-enhanced reasoning model, designed for real-world medical reasoning tasks. We start from real-world medical questions and conduct reinforcement learning training based on a large-scale verifier system. While maintaining the model's general capabilities, the medical effectiveness of the Baichuan-M2 model has achieved a breakthrough improvement. Baichuan-M2 is the best open-source medical model in the world to date. It surpasses all open-source models, including gpt-oss-120b, as well as many cutting-edge closed-source models on the HealthBench Benchmark. It is the open-source model closest to GPT-5 in medical capabilities. Our practice demonstrates that a robust verifier is crucial for linking model capabilities to the real world and an end-to-end reinforcement learning approach fundamentally enhances the model's medical reasoning abilities. The release of Baichuan-M2 advances the cutting edge of technology in the field of medical artificial intelligence.",
|
||||
displayName: 'Baichuan M2 Plus',
|
||||
id: 'Baichuan-M2-Plus',
|
||||
maxOutput: 32_768,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 10, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
searchImpl: 'internal',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
reasoning: true,
|
||||
},
|
||||
contextWindowTokens: 32_768,
|
||||
description:
|
||||
"We introduce Baichuan-M2, a medically-enhanced reasoning model, designed for real-world medical reasoning tasks. We start from real-world medical questions and conduct reinforcement learning training based on a large-scale verifier system. While maintaining the model's general capabilities, the medical effectiveness of the Baichuan-M2 model has achieved a breakthrough improvement. Baichuan-M2 is the best open-source medical model in the world to date. It surpasses all open-source models, including gpt-oss-120b, as well as many cutting-edge closed-source models on the HealthBench Benchmark. It is the open-source model closest to GPT-5 in medical capabilities. Our practice demonstrates that a robust verifier is crucial for linking model capabilities to the real world and an end-to-end reinforcement learning approach fundamentally enhances the model's medical reasoning abilities. The release of Baichuan-M2 advances the cutting edge of technology in the field of medical artificial intelligence.",
|
||||
displayName: 'Baichuan M2',
|
||||
id: 'Baichuan-M2',
|
||||
maxOutput: 32_768,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 20, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['reasoningBudgetToken'],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
|
||||
@@ -1,6 +1,35 @@
|
||||
import type { AIChatModelCard } from '../types/aiModel';
|
||||
|
||||
const bedrockChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
"Claude Opus 4.7 is Anthropic's most capable generally available model for complex reasoning and agentic coding.",
|
||||
displayName: 'Claude Opus 4.7',
|
||||
enabled: true,
|
||||
id: 'global.anthropic.claude-opus-4-7',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput_cacheWrite', rate: 6.25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-16',
|
||||
settings: {
|
||||
disabledParams: ['temperature', 'top_p'],
|
||||
extendParams: ['disableContextCaching', 'enableAdaptiveThinking', 'opus47Effort'],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -12,7 +41,6 @@ const bedrockChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
"Claude Opus 4.6 is Anthropic's most intelligent model for building agents and coding.",
|
||||
displayName: 'Claude Opus 4.6',
|
||||
enabled: true,
|
||||
id: 'global.anthropic.claude-opus-4-6-v1',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
|
||||
@@ -220,7 +220,7 @@ export { default as internlm } from './internlm';
|
||||
export { default as jina } from './jina';
|
||||
export { default as kimicodingplan } from './kimiCodingPlan';
|
||||
export { default as lmstudio } from './lmstudio';
|
||||
export { default as lobehub } from './lobehub/index';
|
||||
export { gptImage1Schema, default as lobehub } from './lobehub/index';
|
||||
export { default as longcat } from './longcat';
|
||||
export { default as minimax } from './minimax';
|
||||
export { default as minimaxcodingplan } from './minimaxCodingPlan';
|
||||
@@ -233,7 +233,7 @@ export { default as novita } from './novita';
|
||||
export { default as nvidia } from './nvidia';
|
||||
export { default as ollama } from './ollama';
|
||||
export { default as ollamacloud } from './ollamacloud';
|
||||
export { gptImage1ParamsSchema, default as openai, openaiChatModels } from './openai';
|
||||
export { default as openai, openaiChatModels } from './openai';
|
||||
export { default as opencodecodingplan } from './opencodeCodingPlan';
|
||||
export { default as opencodezen } from './opencodeZen';
|
||||
export { default as openrouter } from './openrouter';
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
import type { AIChatModelCard } from '../types/aiModel';
|
||||
|
||||
const longcatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
'The core features of LongCat-2.0-Preview are as follows: Designed for agent development scenarios, with native support for tool use, multi-step reasoning, and long-context tasks; Excels in code generation, automated workflows, and complex instruction execution; Deeply integrated with productivity tools such as Claude Code, OpenClaw, OpenCode, and Kilo Code.',
|
||||
displayName: 'LongCat-2.0-Preview',
|
||||
enabled: true,
|
||||
id: 'LongCat-2.0-Preview',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-20',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -11,6 +31,7 @@ const longcatModels: AIChatModelCard[] = [
|
||||
displayName: 'LongCat-Flash-Lite',
|
||||
enabled: true,
|
||||
id: 'LongCat-Flash-Lite',
|
||||
maxOutput: 262_144,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
@@ -27,10 +48,11 @@ const longcatModels: AIChatModelCard[] = [
|
||||
},
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'The LongCat-Flash-Thinking-2601 model has been officially released. As an upgraded reasoning model built on a Mixture-of-Experts (MoE) architecture, it features a total of 560 billion parameters. While maintaining strong competitiveness across traditional reasoning benchmarks, it systematically enhances Agent-level reasoning capabilities through large-scale multi-environment reinforcement learning. Compared to the LongCat-Flash-Thinking model, the key upgrades are as follows: Extreme Robustness in Noisy Environments: Through systematic curriculum-style training targeting noise and uncertainty in real-world settings, the model demonstrates outstanding performance in Agent tool invocation, Agent-based search, and tool-integrated reasoning, with significantly improved generalization. Powerful Agent Capabilities: By constructing a tightly coupled dependency graph encompassing more than 60 tools, and scaling training through multi-environment expansion and large-scale exploratory learning, the model markedly improves its ability to generalize to complex and out-of-distribution real-world scenarios. Advanced Deep Thinking Mode: It expands the breadth of reasoning via parallel inference and deepens analytical capability through recursive feedback-driven summarization and abstraction mechanisms, effectively addressing highly challenging problems.',
|
||||
displayName: 'LongCat-Flash-Thinking-2601',
|
||||
'To ensure you receive top-tier reasoning performance, the LongCat API platform has unified and upgraded calls to the LongCat-Flash-Thinking model. All existing requests using `model=LongCat-Flash-Thinking` will be automatically routed to the latest version, LongCat-Flash-Thinking-2601, with no code changes required.',
|
||||
displayName: 'LongCat-Flash-Thinking',
|
||||
enabled: true,
|
||||
id: 'LongCat-Flash-Thinking-2601',
|
||||
id: 'LongCat-Flash-Thinking',
|
||||
maxOutput: 262_144,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
@@ -47,16 +69,17 @@ const longcatModels: AIChatModelCard[] = [
|
||||
},
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'LongCat-Flash-Thinking has been officially released and open-sourced simultaneously. It is a deep reasoning model that can be used for free conversations within LongCat Chat, or accessed via API by specifying model=LongCat-Flash-Thinking.',
|
||||
displayName: 'LongCat-Flash-Thinking',
|
||||
id: 'LongCat-Flash-Thinking',
|
||||
'The LongCat-Flash-Thinking-2601 model has been officially released. As an upgraded reasoning model built on a Mixture-of-Experts (MoE) architecture, it features a total of 560 billion parameters. While maintaining strong competitiveness across traditional reasoning benchmarks, it systematically enhances Agent-level reasoning capabilities through large-scale multi-environment reinforcement learning. Compared to the LongCat-Flash-Thinking model, the key upgrades are as follows: Extreme Robustness in Noisy Environments: Through systematic curriculum-style training targeting noise and uncertainty in real-world settings, the model demonstrates outstanding performance in Agent tool invocation, Agent-based search, and tool-integrated reasoning, with significantly improved generalization. Powerful Agent Capabilities: By constructing a tightly coupled dependency graph encompassing more than 60 tools, and scaling training through multi-environment expansion and large-scale exploratory learning, the model markedly improves its ability to generalize to complex and out-of-distribution real-world scenarios. Advanced Deep Thinking Mode: It expands the breadth of reasoning via parallel inference and deepens analytical capability through recursive feedback-driven summarization and abstraction mechanisms, effectively addressing highly challenging problems.',
|
||||
displayName: 'LongCat-Flash-Thinking-2601',
|
||||
id: 'LongCat-Flash-Thinking-2601',
|
||||
maxOutput: 262_144,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-09-22',
|
||||
releasedAt: '2026-01-14',
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
@@ -69,6 +92,7 @@ const longcatModels: AIChatModelCard[] = [
|
||||
displayName: 'LongCat-Flash-Chat',
|
||||
enabled: true,
|
||||
id: 'LongCat-Flash-Chat',
|
||||
maxOutput: 262_144,
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput', rate: 0, strategy: 'fixed', unit: 'millionTokens' },
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { type ModelParamsSchema } from '../standard-parameters';
|
||||
import {
|
||||
type AIChatModelCard,
|
||||
type AIEmbeddingModelCard,
|
||||
@@ -8,17 +7,107 @@ import {
|
||||
type AITTSModelCard,
|
||||
type AIVideoModelCard,
|
||||
} from '../types/aiModel';
|
||||
|
||||
export const gptImage1ParamsSchema: ModelParamsSchema = {
|
||||
imageUrls: { default: [] },
|
||||
prompt: { default: '' },
|
||||
size: {
|
||||
default: 'auto',
|
||||
enum: ['auto', '1024x1024', '1536x1024', '1024x1536'],
|
||||
},
|
||||
};
|
||||
import { gptImage1Schema, gptImage2Schema } from './lobehub';
|
||||
|
||||
export const openaiChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 1_050_000,
|
||||
description: 'GPT-5.5 is our newest frontier model for the most complex professional work.',
|
||||
displayName: 'GPT-5.5',
|
||||
enabled: true,
|
||||
id: 'gpt-5.5',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.272]': 5,
|
||||
'[0.272, infinity]': 10,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textInput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.272]': 0.5,
|
||||
'[0.272, infinity]': 1,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textInput_cacheRead',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.272]': 30,
|
||||
'[0.272, infinity]': 45,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textOutput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-23',
|
||||
settings: {
|
||||
extendParams: ['gpt5_2ReasoningEffort', 'textVerbosity'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 1_050_000,
|
||||
description:
|
||||
'GPT-5.5 pro uses more compute to think harder and provide consistently better answers.',
|
||||
displayName: 'GPT-5.5 Pro',
|
||||
id: 'gpt-5.5-pro',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
units: [
|
||||
{
|
||||
name: 'textInput',
|
||||
rate: 30,
|
||||
strategy: 'fixed',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
name: 'textOutput',
|
||||
rate: 180,
|
||||
strategy: 'fixed',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-23',
|
||||
settings: {
|
||||
extendParams: ['gpt5_2ProReasoningEffort', 'textVerbosity'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -232,7 +321,6 @@ export const openaiChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
"GPT-5.4 nano is OpenAI's cheapest GPT-5.4-class model for simple high-volume tasks.",
|
||||
displayName: 'GPT-5.4 nano',
|
||||
enabled: true,
|
||||
id: 'gpt-5.4-nano',
|
||||
maxOutput: 128_000,
|
||||
pricing: {
|
||||
@@ -1509,13 +1597,34 @@ export const openaiSTTModels: AISTTModelCard[] = [
|
||||
|
||||
// Image generation models
|
||||
export const openaiImageModels: AIImageModelCard[] = [
|
||||
{
|
||||
description:
|
||||
"OpenAI's next-generation multimodal image model with native reasoning, up to 4K resolution, near-perfect text rendering, and high-fidelity multilingual support.",
|
||||
displayName: 'GPT Image 2',
|
||||
enabled: true,
|
||||
id: 'gpt-image-2',
|
||||
parameters: gptImage2Schema,
|
||||
pricing: {
|
||||
// Medium quality at 1024x1024: ~1767 output tokens * $30/M = $0.053 per image.
|
||||
// Source: https://developers.openai.com/api/docs/guides/image-generation#calculating-costs
|
||||
approximatePricePerImage: 0.053,
|
||||
units: [
|
||||
{ name: 'textInput', rate: 5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput_cacheRead', rate: 1.25, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'imageInput', rate: 8, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'imageInput_cacheRead', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'imageOutput', rate: 30, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-21',
|
||||
type: 'image',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'An enhanced GPT Image 1 model with 4× faster generation, more precise editing, and improved text rendering.',
|
||||
displayName: 'GPT Image 1.5',
|
||||
enabled: true,
|
||||
id: 'gpt-image-1.5',
|
||||
parameters: gptImage1ParamsSchema,
|
||||
parameters: gptImage1Schema,
|
||||
pricing: {
|
||||
approximatePricePerImage: 0.034,
|
||||
units: [
|
||||
@@ -1533,9 +1642,8 @@ export const openaiImageModels: AIImageModelCard[] = [
|
||||
{
|
||||
description: 'ChatGPT native multimodal image generation model.',
|
||||
displayName: 'GPT Image 1',
|
||||
enabled: true,
|
||||
id: 'gpt-image-1',
|
||||
parameters: gptImage1ParamsSchema,
|
||||
parameters: gptImage1Schema,
|
||||
pricing: {
|
||||
approximatePricePerImage: 0.042,
|
||||
units: [
|
||||
@@ -1552,9 +1660,8 @@ export const openaiImageModels: AIImageModelCard[] = [
|
||||
description:
|
||||
'A lower-cost GPT Image 1 variant with native text and image input and image output.',
|
||||
displayName: 'GPT Image 1 Mini',
|
||||
enabled: true,
|
||||
id: 'gpt-image-1-mini',
|
||||
parameters: gptImage1ParamsSchema,
|
||||
parameters: gptImage1Schema,
|
||||
pricing: {
|
||||
approximatePricePerImage: 0.011,
|
||||
units: [
|
||||
@@ -1572,7 +1679,6 @@ export const openaiImageModels: AIImageModelCard[] = [
|
||||
description:
|
||||
'The latest DALL·E model, released in November 2023, supports more realistic, accurate image generation with stronger detail.',
|
||||
displayName: 'DALL·E 3',
|
||||
enabled: true,
|
||||
id: 'dall-e-3',
|
||||
parameters: {
|
||||
prompt: { default: '' },
|
||||
|
||||
@@ -7,6 +7,30 @@ import {
|
||||
// https://help.aliyun.com/zh/model-studio/models?spm=a2c4g.11186623
|
||||
|
||||
const qwenChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
"Kimi K2.6 is Kimi's latest and most capable model, delivering stronger long-horizon coding, instruction following, and self-correction while supporting text, image, and video inputs plus chat and agent tasks.",
|
||||
displayName: 'Kimi K2.6',
|
||||
id: 'kimi-k2.6',
|
||||
maxOutput: 32_768,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 6.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 27, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -184,6 +208,56 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
'DeepSeek V4 Flash is the cost-efficient member of the V4 family with a 1M context window and hybrid thinking. Thinking mode is on by default and can be toggled via the `thinking` parameter; non-thinking mode is optimized for latency-sensitive workflows.',
|
||||
displayName: 'DeepSeek V4 Flash',
|
||||
id: 'deepseek-v4-flash',
|
||||
maxOutput: 393_216,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 1, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'deepseekV4ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
'DeepSeek V4 Pro is the flagship of the V4 family, optimized for high-intensity reasoning, agentic workflows, and long-horizon planning. Thinking mode is on by default and can be toggled via the `thinking` parameter.',
|
||||
displayName: 'DeepSeek V4 Pro',
|
||||
id: 'deepseek-v4-pro',
|
||||
maxOutput: 393_216,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 12, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 24, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'deepseekV4ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -205,6 +279,7 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -229,6 +304,7 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -253,6 +329,7 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -305,6 +382,51 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
},
|
||||
contextWindowTokens: 202_752,
|
||||
description:
|
||||
'GLM-5.1 is Zhipu’s latest flagship model, aligned with Claude Opus 4.6 on overall and coding capabilities. It excels at long-horizon tasks, able to autonomously plan, execute, and iterate for up to 8 hours in a single task, making it an ideal foundation for Autonomous Agents and long-horizon Coding Agents.',
|
||||
displayName: 'GLM-5.1',
|
||||
id: 'glm-5.1',
|
||||
maxOutput: 16_384,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.032]': 6,
|
||||
'[0.032, infinity]': 8,
|
||||
},
|
||||
pricingParams: ['textInputRange'],
|
||||
},
|
||||
name: 'textInput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.032]': 24,
|
||||
'[0.032, infinity]': 28,
|
||||
},
|
||||
pricingParams: ['textInputRange'],
|
||||
},
|
||||
name: 'textOutput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -818,6 +940,33 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 262_144,
|
||||
description:
|
||||
'The Qwen 3.6 series 27B is a native vision-language dense model. Compared to version 3.5-27B, it delivers significant improvements in agentic coding capabilities, with further enhancements in STEM performance and reasoning ability. On the visual side, it shows notable gains in spatial intelligence, object localization, and detection, while also steadily improving in video understanding, document OCR, and visual agent capabilities.',
|
||||
displayName: 'Qwen3.6-27B',
|
||||
id: 'qwen3.6-27b',
|
||||
maxOutput: 65_536,
|
||||
organization: 'Qwen',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 18, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-22',
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -1687,6 +1836,88 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'qwen3.5-plus-2026-04-20', // Supports context caching
|
||||
},
|
||||
contextWindowTokens: 1_000_000,
|
||||
description:
|
||||
'Qwen 3.5 is a native vision-language Plus model. Compared to the February 15 snapshot, this version delivers substantial improvements in agentic coding capabilities and significantly faster inference speed. Its knowledge, reasoning, and long-context abilities remain at a high level, meeting the demands of complex agent tasks. It is well-suited for coding agents, production workflows, and high-throughput scenarios. This version corresponds to the April 20, 2026 snapshot.',
|
||||
displayName: 'Qwen3.5 Plus 2026-04-20',
|
||||
id: 'qwen3.5-plus-2026-04-20',
|
||||
maxOutput: 65_536,
|
||||
organization: 'Qwen',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.128]': 0.8 * 0.1,
|
||||
'[0.128, 0.256]': 2 * 0.1,
|
||||
'[0.256, infinity]': 4 * 0.1,
|
||||
},
|
||||
pricingParams: ['textInputRange'],
|
||||
},
|
||||
name: 'textInput_cacheRead',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.128]': 0.8 * 1.25,
|
||||
'[0.128, 0.256]': 2 * 1.25,
|
||||
'[0.256, infinity]': 4 * 1.25,
|
||||
},
|
||||
pricingParams: ['textInputRange'],
|
||||
},
|
||||
name: 'textInput_cacheWrite',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.128]': 0.8,
|
||||
'[0.128, 0.256]': 2,
|
||||
'[0.256, infinity]': 4,
|
||||
},
|
||||
pricingParams: ['textInputRange'],
|
||||
},
|
||||
name: 'textInput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.128]': 4.8,
|
||||
'[0.128, 0.256]': 12,
|
||||
'[0.256, infinity]': 24,
|
||||
},
|
||||
pricingParams: ['textInputRange'],
|
||||
},
|
||||
name: 'textOutput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-04-22',
|
||||
settings: {
|
||||
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -1851,6 +2082,7 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'The largest closed-source model in the Qwen3.6 series. It delivers stronger world knowledge, instruction following, and agentic coding performance for complex tasks. It is text-only, supports thinking mode by default, explicit caching, and function calling.',
|
||||
displayName: 'Qwen3.6 Max Preview',
|
||||
enabled: true,
|
||||
id: 'qwen3.6-max-preview',
|
||||
maxOutput: 65_536,
|
||||
organization: 'Qwen',
|
||||
@@ -1915,7 +2147,6 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'Qwen3 Max models deliver large gains over the 2.5 series in general ability, Chinese/English understanding, complex instruction following, subjective open tasks, multilingual ability, and tool use, with fewer hallucinations. The latest qwen3-max improves agentic programming and tool use over qwen3-max-preview. This release reaches field SOTA and targets more complex agent needs.',
|
||||
displayName: 'Qwen3 Max',
|
||||
enabled: true,
|
||||
id: 'qwen3-max',
|
||||
maxOutput: 65_536,
|
||||
organization: 'Qwen',
|
||||
@@ -2996,6 +3227,9 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-05-28',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
@@ -3018,6 +3252,9 @@ const qwenChatModels: AIChatModelCard[] = [
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-01-27',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
@@ -3166,12 +3403,38 @@ const qwenImageModels: AIImageModelCard[] = [
|
||||
releasedAt: '2025-12-19',
|
||||
type: 'image',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'The Qwen-Image-2.0 series full-version model integrates image generation and image editing into a unified capability. It supports more professional text rendering with up to 1k token instruction capacity, delivers more delicate and realistic visual textures, enables fine-grained depiction of realistic scenes, and demonstrates stronger semantic alignment with prompts. The full-version model provides the strongest text rendering capability and the highest level of realism within the 2.0 series.',
|
||||
displayName: 'Qwen Image 2.0 Pro 2026-04-22',
|
||||
id: 'qwen-image-2.0-pro-2026-04-22',
|
||||
enabled: true,
|
||||
organization: 'Qwen',
|
||||
parameters: {
|
||||
height: { default: 1024, max: 4096, min: 256, step: 1 },
|
||||
imageUrls: {
|
||||
default: [],
|
||||
},
|
||||
prompt: {
|
||||
default: '',
|
||||
},
|
||||
seed: { default: null },
|
||||
width: { default: 1024, max: 4096, min: 256, step: 1 },
|
||||
promptExtend: { default: false },
|
||||
watermark: { default: false },
|
||||
},
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [{ name: 'imageGeneration', rate: 0.5, strategy: 'fixed', unit: 'image' }],
|
||||
},
|
||||
releasedAt: '2026-04-22',
|
||||
type: 'image',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'The Qwen-Image-2.0 series full-version model integrates image generation and image editing into a unified capability. It supports more professional text rendering with up to 1k token instruction capacity, delivers more delicate and realistic visual textures, enables fine-grained depiction of realistic scenes, and demonstrates stronger semantic alignment with prompts. The full-version model provides the strongest text rendering capability and the highest level of realism within the 2.0 series.',
|
||||
displayName: 'Qwen Image 2.0 Pro',
|
||||
id: 'qwen-image-2.0-pro',
|
||||
enabled: true,
|
||||
organization: 'Qwen',
|
||||
parameters: {
|
||||
height: { default: 1024, max: 4096, min: 256, step: 1 },
|
||||
@@ -3721,11 +3984,124 @@ const qwenImageModels: AIImageModelCard[] = [
|
||||
];
|
||||
|
||||
const qwenVideoModels: AIVideoModelCard[] = [
|
||||
{
|
||||
description:
|
||||
'HappyHorse-1.0-I2V supports text-to-video generation, delivering highly faithful dynamic visuals. It can accurately understand textual semantics and produce high-quality videos that are smooth, natural, and rich in detail.',
|
||||
displayName: 'HappyHorse-1.0-I2V',
|
||||
enabled: true,
|
||||
id: 'happyhorse-1.0-i2v',
|
||||
parameters: {
|
||||
duration: { default: 5, max: 15, min: 3 },
|
||||
imageUrl: {
|
||||
default: null,
|
||||
},
|
||||
prompt: { default: '' },
|
||||
resolution: {
|
||||
default: '1080P',
|
||||
enum: ['720P', '1080P'],
|
||||
},
|
||||
seed: { default: null },
|
||||
watermark: { default: false },
|
||||
},
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [{ name: 'videoGeneration', rate: 1.6, strategy: 'fixed', unit: 'second' }],
|
||||
},
|
||||
releasedAt: '2026-04-22',
|
||||
type: 'video',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'HappyHorse-1.0-R2V supports reference-based video generation, offering more stable subject and scene consistency. It supports up to 9 reference images, accurately preserves creative intent, and delivers enhanced expressive capability.',
|
||||
displayName: 'HappyHorse-1.0-R2V',
|
||||
enabled: true,
|
||||
id: 'happyhorse-1.0-r2v',
|
||||
parameters: {
|
||||
aspectRatio: {
|
||||
default: '16:9',
|
||||
enum: ['16:9', '9:16', '1:1', '4:3', '3:4'],
|
||||
},
|
||||
duration: { default: 5, max: 10, min: 3 },
|
||||
imageUrls: {
|
||||
default: [],
|
||||
maxCount: 9,
|
||||
},
|
||||
prompt: { default: '' },
|
||||
resolution: {
|
||||
default: '1080P',
|
||||
enum: ['720P', '1080P'],
|
||||
},
|
||||
seed: { default: null },
|
||||
watermark: { default: false },
|
||||
},
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [{ name: 'videoGeneration', rate: 1.6, strategy: 'fixed', unit: 'second' }],
|
||||
},
|
||||
releasedAt: '2026-04-26',
|
||||
type: 'video',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'HappyHorse-1.0-T2V supports text-to-video generation, delivering highly faithful dynamic visuals. It can accurately understand textual semantics and produce high-quality videos that are smooth, natural, and rich in detail.',
|
||||
displayName: 'HappyHorse-1.0-T2V',
|
||||
enabled: true,
|
||||
id: 'happyhorse-1.0-t2v',
|
||||
parameters: {
|
||||
aspectRatio: {
|
||||
default: '16:9',
|
||||
enum: ['16:9', '9:16', '1:1', '4:3', '3:4'],
|
||||
},
|
||||
duration: { default: 5, max: 15, min: 3 },
|
||||
prompt: { default: '' },
|
||||
resolution: {
|
||||
default: '1080P',
|
||||
enum: ['720P', '1080P'],
|
||||
},
|
||||
seed: { default: null },
|
||||
watermark: { default: false },
|
||||
},
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [{ name: 'videoGeneration', rate: 1.6, strategy: 'fixed', unit: 'second' }],
|
||||
},
|
||||
releasedAt: '2026-04-21',
|
||||
type: 'video',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'Wanxiang 2.7 Image-to-Video delivers a comprehensive upgrade in performance capabilities. Dramatic scenes feature delicate and natural emotional expression, while action sequences are intense and impactful. Combined with more dynamic and rhythmically driven shot transitions, it achieves stronger overall performance and storytelling.',
|
||||
displayName: 'Wan2.7 I2V 2026-04-25',
|
||||
enabled: true,
|
||||
id: 'wan2.7-i2v-2026-04-25',
|
||||
parameters: {
|
||||
duration: { default: 5, max: 15, min: 2 },
|
||||
endImageUrl: {
|
||||
default: null,
|
||||
},
|
||||
imageUrl: {
|
||||
default: null,
|
||||
},
|
||||
prompt: { default: '' },
|
||||
resolution: {
|
||||
default: '1080P',
|
||||
enum: ['720P', '1080P'],
|
||||
},
|
||||
seed: { default: null },
|
||||
promptExtend: { default: false },
|
||||
watermark: { default: false },
|
||||
},
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [{ name: 'videoGeneration', rate: 1, strategy: 'fixed', unit: 'second' }],
|
||||
},
|
||||
releasedAt: '2026-04-26',
|
||||
type: 'video',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'Wanxiang 2.7 Image-to-Video delivers a comprehensive upgrade in performance capabilities. Dramatic scenes feature delicate and natural emotional expression, while action sequences are intense and impactful. Combined with more dynamic and rhythmically driven shot transitions, it achieves stronger overall performance and storytelling.',
|
||||
displayName: 'Wan2.7 I2V',
|
||||
enabled: true,
|
||||
id: 'wan2.7-i2v',
|
||||
parameters: {
|
||||
duration: { default: 5, max: 15, min: 2 },
|
||||
@@ -3786,8 +4162,35 @@ const qwenVideoModels: AIVideoModelCard[] = [
|
||||
{
|
||||
description:
|
||||
'Wanxiang 2.7 Text-to-Video delivers a comprehensive upgrade in performance capabilities. Dramatic scenes feature delicate and natural emotional expression, while action sequences are intense and impactful. Enhanced with more dynamic and rhythmically driven shot transitions, it achieves stronger overall acting and storytelling performance.',
|
||||
displayName: 'Wan2.7 T2V',
|
||||
displayName: 'Wan2.7 T2V 2026-04-25',
|
||||
enabled: true,
|
||||
id: 'wan2.7-t2v-2026-04-25',
|
||||
parameters: {
|
||||
aspectRatio: {
|
||||
default: '16:9',
|
||||
enum: ['16:9', '9:16', '1:1', '4:3', '3:4'],
|
||||
},
|
||||
duration: { default: 5, max: 15, min: 2 },
|
||||
prompt: { default: '' },
|
||||
resolution: {
|
||||
default: '1080P',
|
||||
enum: ['720P', '1080P'],
|
||||
},
|
||||
seed: { default: null },
|
||||
promptExtend: { default: false },
|
||||
watermark: { default: false },
|
||||
},
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [{ name: 'videoGeneration', rate: 1, strategy: 'fixed', unit: 'second' }],
|
||||
},
|
||||
releasedAt: '2026-04-26',
|
||||
type: 'video',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'Wanxiang 2.7 Text-to-Video delivers a comprehensive upgrade in performance capabilities. Dramatic scenes feature delicate and natural emotional expression, while action sequences are intense and impactful. Enhanced with more dynamic and rhythmically driven shot transitions, it achieves stronger overall acting and storytelling performance.',
|
||||
displayName: 'Wan2.7 T2V',
|
||||
id: 'wan2.7-t2v',
|
||||
parameters: {
|
||||
aspectRatio: {
|
||||
@@ -3815,7 +4218,6 @@ const qwenVideoModels: AIVideoModelCard[] = [
|
||||
description:
|
||||
'Wanxiang 2.6 introduces multi-shot narrative capabilities, while also supporting automatic voiceover generation and the ability to incorporate custom audio files.',
|
||||
displayName: 'Wan2.6 I2V Flash',
|
||||
enabled: true,
|
||||
id: 'wan2.6-i2v-flash',
|
||||
parameters: {
|
||||
duration: { default: 5, max: 15, min: 2 },
|
||||
@@ -3869,7 +4271,6 @@ const qwenVideoModels: AIVideoModelCard[] = [
|
||||
description:
|
||||
'Wanxiang 2.6 Reference-to-Video – Flash offers faster generation and better cost performance. It supports referencing specific characters or any objects, accurately maintaining consistency in appearance and voice, and enables multi-character reference for co-performance.',
|
||||
displayName: 'Wan2.6 R2V Flash',
|
||||
enabled: true,
|
||||
id: 'wan2.6-r2v-flash',
|
||||
parameters: {
|
||||
duration: { default: 5, max: 10, min: 2 },
|
||||
@@ -3947,7 +4348,6 @@ const qwenVideoModels: AIVideoModelCard[] = [
|
||||
description:
|
||||
'Wanxiang 2.6 introduces multi-shot narrative capabilities, while also supporting automatic voiceover generation and the ability to incorporate custom audio files.',
|
||||
displayName: 'Wan2.6 T2V',
|
||||
enabled: true,
|
||||
id: 'wan2.6-t2v',
|
||||
parameters: {
|
||||
duration: { default: 5, max: 15, min: 2 },
|
||||
|
||||
@@ -3,6 +3,28 @@ import type { AIChatModelCard, AIImageModelCard } from '../types/aiModel';
|
||||
// https://platform.stepfun.com/docs/pricing/details
|
||||
|
||||
const stepfunChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
},
|
||||
contextWindowTokens: 256_000,
|
||||
description:
|
||||
'Built on Step 3.5 Flash and optimized for high-frequency agent scenarios, it further improves token efficiency and inference speed while retaining flagship-level reasoning and tool-calling capabilities. It also supports switching to a low-reasoning mode to reduce resource consumption. Additionally, targeted optimizations have been made to enhance compatibility with coding tasks and agent frameworks.',
|
||||
displayName: 'Step 3.5 Flash 2603',
|
||||
enabled: true,
|
||||
id: 'step-3.5-flash-2603',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.14, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 0.7, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 2.1, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -13,7 +35,6 @@ const stepfunChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'Stepfun’s flagship language reasoning model.This model has top-notch reasoning capabilities and fast and reliable execution capabilities.Able to decompose and plan complex tasks, call tools quickly and reliably to perform tasks, and be competent in various complex tasks such as logical reasoning, mathematics, software engineering, and in-depth research.',
|
||||
displayName: 'Step 3.5 Flash',
|
||||
enabled: true,
|
||||
id: 'step-3.5-flash',
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
|
||||
@@ -14,6 +14,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-2-0-pro-260215',
|
||||
@@ -66,6 +67,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2026-02-15',
|
||||
settings: {
|
||||
extendParams: ['gpt5ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -75,6 +77,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-2-0-lite-260215',
|
||||
@@ -127,6 +130,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2026-02-15',
|
||||
settings: {
|
||||
extendParams: ['gpt5ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -136,6 +140,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-2-0-mini-260215',
|
||||
@@ -187,6 +192,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2026-02-15',
|
||||
settings: {
|
||||
extendParams: ['gpt5ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -196,6 +202,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-2-0-code-preview-260215',
|
||||
@@ -247,6 +254,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2026-02-15',
|
||||
settings: {
|
||||
extendParams: ['gpt5ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -256,6 +264,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-1-8-251228',
|
||||
@@ -308,6 +317,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
releasedAt: '2025-12-18',
|
||||
settings: {
|
||||
extendParams: ['gpt5ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -317,6 +327,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-code-preview-251028',
|
||||
@@ -362,6 +373,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -564,6 +576,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-1-6-vision-250815',
|
||||
@@ -608,6 +621,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -617,6 +631,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-1-6-thinking-250715',
|
||||
@@ -659,6 +674,9 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
{ name: 'textInput_cacheRead', rate: 0.16, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
@@ -667,6 +685,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-1-6-251015',
|
||||
@@ -712,6 +731,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['gpt5ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -721,6 +741,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-1-6-lite-251015',
|
||||
@@ -766,6 +787,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['gpt5ReasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
@@ -775,6 +797,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
reasoning: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
},
|
||||
config: {
|
||||
deploymentName: 'doubao-seed-1-6-flash-250828',
|
||||
@@ -819,6 +842,7 @@ const doubaoChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
settings: {
|
||||
extendParams: ['enableReasoning'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
|
||||
@@ -3,6 +3,56 @@ import type { AIChatModelCard, AIImageModelCard, AIVideoModelCard } from '../typ
|
||||
// https://cloud.baidu.com/doc/qianfan/s/rmh4stp0j
|
||||
|
||||
const wenxinChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
video: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'ERNIE 5.0, the new-generation model in the ERNIE series, is a natively multimodal large model. It adopts a unified multimodal modeling approach, jointly modeling text, images, audio, and video to deliver comprehensive multimodal capabilities. Its foundational abilities have been significantly upgraded, achieving strong performance on benchmark evaluations. It particularly excels in multimodal understanding, instruction following, creative writing, factual accuracy, agent planning, and tool utilization.',
|
||||
displayName: 'ERNIE 5.0',
|
||||
enabled: true,
|
||||
id: 'ernie-5.0',
|
||||
maxOutput: 65_536,
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.032]': 6,
|
||||
'[0.032, 0.128]': 10,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textInput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
lookup: {
|
||||
prices: {
|
||||
'[0, 0.032]': 24,
|
||||
'[0.032, 0.128]': 40,
|
||||
},
|
||||
pricingParams: ['textInput'],
|
||||
},
|
||||
name: 'textOutput',
|
||||
strategy: 'lookup',
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2026-03-05',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
@@ -15,7 +65,6 @@ const wenxinChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'Wenxin 5.0 Thinking is a native full-modal flagship model with unified text, image, audio, and video modeling. It delivers broad capability upgrades for complex QA, creation, and agent scenarios.',
|
||||
displayName: 'ERNIE 5.0 Thinking',
|
||||
enabled: true,
|
||||
id: 'ernie-5.0-thinking-latest',
|
||||
maxOutput: 65_536,
|
||||
pricing: {
|
||||
@@ -1780,11 +1829,32 @@ const wenxinImageModels: AIImageModelCard[] = [
|
||||
},
|
||||
type: 'image',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'ERNIE-Image is an 8B-parameter text-to-image model developed by Baidu. It ranks among the top on multiple benchmarks, achieving a tied first place in SuperCLUE in China and leading in the open-source track.',
|
||||
displayName: 'ERNIE Image Turbo',
|
||||
enabled: true,
|
||||
id: 'ernie-image-turbo',
|
||||
parameters: {
|
||||
prompt: {
|
||||
default: '',
|
||||
},
|
||||
size: {
|
||||
default: '1024x1024',
|
||||
enum: ['1024x1024', '848x1264', '768x1376', '896x1200', '1264x848', '1376x768', '1200x896'],
|
||||
},
|
||||
watermark: { default: false },
|
||||
},
|
||||
pricing: {
|
||||
currency: 'CNY',
|
||||
units: [{ name: 'imageGeneration', rate: 0.11, strategy: 'fixed', unit: 'image' }],
|
||||
},
|
||||
type: 'image',
|
||||
},
|
||||
{
|
||||
description:
|
||||
'ERNIE iRAG is an image retrieval-augmented generation model for image search, image-text retrieval, and content generation.',
|
||||
displayName: 'ERNIE iRAG',
|
||||
enabled: true,
|
||||
id: 'irag-1.0',
|
||||
parameters: {
|
||||
height: { default: 1024, max: 2048, min: 512, step: 1 },
|
||||
@@ -1805,7 +1875,6 @@ const wenxinImageModels: AIImageModelCard[] = [
|
||||
description:
|
||||
'ERNIE iRAG Edit is an image editing model supporting erasing, repainting, and variant generation.',
|
||||
displayName: 'ERNIE iRAG Edit',
|
||||
enabled: true,
|
||||
id: 'ernie-irag-edit',
|
||||
parameters: {
|
||||
height: { default: 1024, max: 2048, min: 512, step: 1 },
|
||||
|
||||
@@ -5,16 +5,15 @@ const xaiChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 2_000_000,
|
||||
description: 'Intelligent, blazing-fast model that reasons before responding',
|
||||
displayName: 'Grok 4.20 Beta',
|
||||
description: 'A non-reasoning variant for simple use cases',
|
||||
displayName: 'Grok 4.20 (Non-Reasoning)',
|
||||
enabled: true,
|
||||
id: 'grok-4.20-beta-0309-reasoning',
|
||||
id: 'grok-4.20-0309-non-reasoning',
|
||||
pricing: {
|
||||
units: [
|
||||
{
|
||||
@@ -55,15 +54,16 @@ const xaiChatModels: AIChatModelCard[] = [
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 2_000_000,
|
||||
description: 'A non-reasoning variant for simple use cases',
|
||||
displayName: 'Grok 4.20 Beta (Non-Reasoning)',
|
||||
description: 'Intelligent, blazing-fast model that reasons before responding',
|
||||
displayName: 'Grok 4.20',
|
||||
enabled: true,
|
||||
id: 'grok-4.20-beta-0309-non-reasoning',
|
||||
id: 'grok-4.20-0309-reasoning',
|
||||
pricing: {
|
||||
units: [
|
||||
{
|
||||
@@ -111,9 +111,9 @@ const xaiChatModels: AIChatModelCard[] = [
|
||||
contextWindowTokens: 2_000_000,
|
||||
description:
|
||||
'A team of 4 or 16 agents, Excels at research use cases, Does not currently support client-side tools. Only supports xAI server side tools (eg X Search, Web Search tools) and remote MCP tools.',
|
||||
displayName: 'Grok 4.20 Multi-Agent Beta',
|
||||
displayName: 'Grok 4.20 Multi-Agent',
|
||||
enabled: true,
|
||||
id: 'grok-4.20-multi-agent-beta-0309',
|
||||
id: 'grok-4.20-multi-agent-0309',
|
||||
pricing: {
|
||||
units: [
|
||||
{
|
||||
@@ -235,192 +235,6 @@ const xaiChatModels: AIChatModelCard[] = [
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 2_000_000,
|
||||
description:
|
||||
'We’re excited to release Grok 4 Fast, our latest progress in cost-effective reasoning models.',
|
||||
displayName: 'Grok 4 Fast (Non-Reasoning)',
|
||||
id: 'grok-4-fast-non-reasoning',
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{
|
||||
name: 'textInput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 0.2, upTo: 0.128 },
|
||||
{ rate: 0.4, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
name: 'textOutput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 0.5, upTo: 0.128 },
|
||||
{ rate: 1, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-09-09',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 2_000_000,
|
||||
description:
|
||||
'We’re excited to release Grok 4 Fast, our latest progress in cost-effective reasoning models.',
|
||||
displayName: 'Grok 4 Fast',
|
||||
id: 'grok-4-fast-reasoning',
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.05, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{
|
||||
name: 'textInput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 0.2, upTo: 0.128 },
|
||||
{ rate: 0.4, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
{
|
||||
name: 'textOutput',
|
||||
strategy: 'tiered',
|
||||
tiers: [
|
||||
{ rate: 0.5, upTo: 0.128 },
|
||||
{ rate: 1, upTo: 'infinity' },
|
||||
],
|
||||
unit: 'millionTokens',
|
||||
},
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-09-09',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
structuredOutput: true,
|
||||
},
|
||||
contextWindowTokens: 256_000,
|
||||
description:
|
||||
'We’re excited to launch grok-code-fast-1, a fast and cost-effective reasoning model that excels at agentic coding.',
|
||||
displayName: 'Grok Code Fast 1',
|
||||
id: 'grok-code-fast-1',
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.02, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 0.2, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 1.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-08-27',
|
||||
// settings: {
|
||||
// reasoning_effort is not supported by grok-code. Specifying reasoning_effort parameter will get an error response.
|
||||
// extendParams: ['reasoningEffort'],
|
||||
// },
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
vision: true,
|
||||
},
|
||||
contextWindowTokens: 256_000,
|
||||
description:
|
||||
'Our newest and strongest flagship model, excelling in NLP, math, and reasoning—an ideal all-rounder.',
|
||||
displayName: 'Grok 4 0709',
|
||||
id: 'grok-4',
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-07-09',
|
||||
settings: {
|
||||
// reasoning_effort is not supported by grok-4. Specifying reasoning_effort parameter will get an error response.
|
||||
// extendParams: ['reasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'A flagship model that excels at enterprise use cases like data extraction, coding, and summarization, with deep domain knowledge in finance, healthcare, law, and science.',
|
||||
displayName: 'Grok 3',
|
||||
id: 'grok-3',
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.75, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 3, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 15, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-04-03',
|
||||
settings: {
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
{
|
||||
abilities: {
|
||||
functionCall: true,
|
||||
reasoning: true,
|
||||
search: true,
|
||||
structuredOutput: true,
|
||||
},
|
||||
contextWindowTokens: 131_072,
|
||||
description:
|
||||
'A lightweight model that thinks before responding. It’s fast and smart for logic tasks that don’t require deep domain knowledge, with access to raw reasoning traces.',
|
||||
displayName: 'Grok 3 Mini',
|
||||
id: 'grok-3-mini',
|
||||
pricing: {
|
||||
units: [
|
||||
{ name: 'textInput_cacheRead', rate: 0.075, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textInput', rate: 0.3, strategy: 'fixed', unit: 'millionTokens' },
|
||||
{ name: 'textOutput', rate: 0.5, strategy: 'fixed', unit: 'millionTokens' },
|
||||
],
|
||||
},
|
||||
releasedAt: '2025-04-03',
|
||||
settings: {
|
||||
extendParams: ['reasoningEffort'],
|
||||
searchImpl: 'params',
|
||||
},
|
||||
type: 'chat',
|
||||
},
|
||||
];
|
||||
|
||||
const xaiImageModels: AIImageModelCard[] = [
|
||||
|
||||
@@ -120,7 +120,6 @@ const xiaomimimoChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'MiMo-V2-Pro is specifically designed for high-intensity agent workflows in real-world scenarios. It features over 1 trillion total parameters (42B activated parameters), adopts an innovative hybrid attention architecture, and supports an ultra-long context length of up to 1 million tokens. Built on a powerful foundational model, we continuously scale computational resources across a broader range of agent scenarios, further expanding the action space of intelligence and achieving significant generalization—from coding to real-world task execution (“claw”).',
|
||||
displayName: 'MiMo-V2 Pro',
|
||||
enabled: true,
|
||||
id: 'mimo-v2-pro',
|
||||
maxOutput: 131_072,
|
||||
pricing: {
|
||||
@@ -175,7 +174,6 @@ const xiaomimimoChatModels: AIChatModelCard[] = [
|
||||
description:
|
||||
'MiMo-V2-Omni is purpose-built for complex multimodal interaction and execution scenarios in the real world. We constructed a full-modality foundation from the ground up, integrating text, vision, and speech, and unified “perception” and “action” within a single architecture. This not only breaks the traditional limitation of models that emphasize understanding over execution, but also endows the model with native capabilities in multimodal perception, tool usage, function execution, and GUI operations. MiMo-V2-Omni can seamlessly integrate with major agent frameworks, achieving a leap from understanding to control while significantly lowering the barrier to deploying fully multimodal agents.',
|
||||
displayName: 'MiMo-V2 Omni',
|
||||
enabled: true,
|
||||
id: 'mimo-v2-omni',
|
||||
maxOutput: 131_072,
|
||||
pricing: {
|
||||
|
||||
@@ -21,6 +21,7 @@ const Doubao: ModelProviderCard = {
|
||||
sdkType: 'openai',
|
||||
showDeployName: true,
|
||||
showModelFetcher: false,
|
||||
supportResponsesApi: true,
|
||||
},
|
||||
url: 'https://www.volcengine.com/product/ark',
|
||||
};
|
||||
|
||||
@@ -51,6 +51,7 @@ export const responsesAPIModels = new Set([
|
||||
'gpt-5.4-nano',
|
||||
'gpt-5.4-pro',
|
||||
'gpt-5.5',
|
||||
'gpt-5.5-pro',
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user