Skip to content

Commit 8f1933d

Browse files
author
linyuan.yang
committed
openai 模型改为原生代码,移除 voyage
1 parent fe4fffa commit 8f1933d

28 files changed

Lines changed: 760 additions & 251 deletions

File tree

packages/apps/admin/src/i18n/en.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export default {
334334
empty: 'No embedding configurations',
335335
add_title: 'Add Embedding',
336336
edit_title: 'Edit Embedding',
337-
name_placeholder: 'e.g. openai-ada, gemini-004, voyage-3',
337+
name_placeholder: 'e.g. openai-ada, gemini-004',
338338
confirm_delete: 'Delete embedding "{name}"?',
339339
},
340340
savers: {

packages/apps/admin/src/i18n/zh.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export default {
334334
empty: '暂无向量模型配置',
335335
add_title: '添加向量模型',
336336
edit_title: '编辑向量模型',
337-
name_placeholder: '如 openai-ada、gemini-004、voyage-3',
337+
name_placeholder: '如 openai-ada、gemini-004',
338338
confirm_delete: '确定要删除向量模型 "{name}" 吗?',
339339
},
340340
savers: {

packages/apps/docs/guide/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- **Multi-agent orchestration** — Single, ReAct (recursive task decomposition), and Generative (multimodal) modes; agents can be nested and composed
88
- **ACP agent support** — Agent Client Protocol integration with persistent and transient agent modes
99
- **Knowledge base** — Pluggable wiki data sources (local files, Google Drive, and third-party providers) with keyword + optional semantic search
10-
- **Long-term memory** — Vector-embedding semantic search for persistent context recall (OpenAI, Google, Ollama, Cohere, VoyageAI)
10+
- **Long-term memory** — Vector-embedding semantic search for persistent context recall (OpenAI, Google, Ollama, Cohere)
1111
- **Conversation compaction** — Automatic conversation summarization when token usage exceeds threshold, preserving continuity while reducing consumption
1212
- **Memory** — Per-agent automatic long-term memory: a background MemoryLLM extracts durable knowledge after each conversation idles; the agent reads it back via `search_memory` / `read_memory`, with consolidate/reconcile maintenance
1313
- **Agenda** — Conversation-driven reminders, schedules, and routines with absolute / interval / cron triggers; optionally synced from the conversation after every turn and delivered to any session or channel

packages/apps/docs/guide/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ Any endpoint that implements the OpenAI chat completions API can be used as a pr
3636

3737
Sidebar → **Embedding Models** → New
3838

39-
Embeddings are required for vector-based features ([Notes](./note), [Wiki](./wiki) semantic search, [Memory](./memory) hybrid search). Supported: OpenAI, Google, Ollama, Cohere, VoyageAI.
39+
Embeddings are required for vector-based features ([Notes](./note), [Wiki](./wiki) semantic search, [Memory](./memory) hybrid search). Supported: OpenAI, Google, Ollama, Cohere.

packages/apps/docs/guide/note.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ An embedding model is required first: sidebar → **Embedding Models** → New.
1313
| Field | Description |
1414
|-------|-------------|
1515
| Name | Display name for this notebook |
16-
| Embedding | Embedding model used for semantic search (OpenAI, Google, Ollama, Cohere, VoyageAI) |
16+
| Embedding | Embedding model used for semantic search (OpenAI, Google, Ollama, Cohere) |
1717

1818
## How It Works
1919

packages/apps/docs/zh/guide/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- **多 Agent 编排** —— Single、ReAct(递归任务分解)、Generative(多模态)三种模式,Agent 可嵌套组合
88
- **ACP Agent 支持** —— Agent Client Protocol 集成,支持持久化与临时两种 Agent 模式
99
- **知识库** —— 可插拔 Wiki 数据源(本地文件、Google Drive 与第三方来源),支持关键词与可选语义检索
10-
- **长期记忆** —— 基于向量 Embedding 的语义检索,持久化上下文召回(OpenAI、Gemini、Ollama、Cohere、VoyageAI
10+
- **长期记忆** —— 基于向量 Embedding 的语义检索,持久化上下文召回(OpenAI、Gemini、Ollama、Cohere)
1111
- **对话压缩** —— Token 用量超阈值时自动摘要早期消息,保持上下文连续性同时降低消耗
1212
- **记忆(Memory)** —— Agent 级自动长期记忆:会话空闲后由后台 MemoryLLM 提炼持久知识,主 Agent 通过 `search_memory` / `read_memory` 召回,并有 consolidate / reconcile 维护任务
1313
- **日程(Agenda)** —— 由对话驱动的提醒、日程与周期任务,支持 absolute / interval / cron 触发器;可每轮对话后从对话自动同步,并投递到任意会话或渠道

packages/apps/docs/zh/guide/models.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636

3737
侧栏 → **向量模型** → 新建
3838

39-
向量模型是基于向量的功能([Notes](./note)[Wiki](./wiki) 语义检索、[Memory](./memory) 混合检索)的前置依赖。支持:OpenAI、Gemini、Ollama、Cohere、VoyageAI
39+
向量模型是基于向量的功能([Notes](./note)[Wiki](./wiki) 语义检索、[Memory](./memory) 混合检索)的前置依赖。支持:OpenAI、Gemini、Ollama、Cohere。

packages/apps/docs/zh/guide/note.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Note 仓库是供 Agent 召回的人工维护知识库。你可以在 Web UI 中
1313
| 字段 | 说明 |
1414
|-------|-------------|
1515
| 名称 | 该笔记本的显示名称 |
16-
| 向量模型 | 用于语义检索的模型(OpenAI、Google、Ollama、Cohere、VoyageAI|
16+
| 向量模型 | 用于语义检索的模型(OpenAI、Google、Ollama、Cohere) |
1717

1818
## 工作原理
1919

packages/backend/llm/scorpio.llm.anthropic/src/AnthropicModelService.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ChatAnthropic } from "@langchain/anthropic";
22
import { createFunctionCallingParser } from "@langchain/core/language_models/structured_output";
33
import { AIMessageChunk, BaseMessage, SystemMessage } from "@langchain/core/messages";
4+
import type { AgentTool } from "scorpio.llm";
45
import { toJsonSchema } from "@langchain/core/utils/json_schema";
56
import {
67
type ChatMessage,
@@ -53,14 +54,19 @@ export class AnthropicModelService extends ModelServiceBase<ChatAnthropic> {
5354
return typeof input === "string" ? input : this.applyCache(toBaseMessages(input));
5455
}
5556

56-
bindTools(tools: any[]): void {
57-
if (this.cacheControl && tools.length > 0) {
58-
const formatted = (this.model! as any).formatStructuredToolToAnthropic(tools);
57+
bindTools(tools: AgentTool[]): void {
58+
// AgentTool 的 schema 已是 JSON Schema,直接构造 Anthropic 原生工具格式
59+
// (等价于 ChatAnthropic.formatStructuredToolToAnthropic 的输出形态)
60+
const formatted: Array<{ name: string; description?: string; input_schema: Record<string, any>; cache_control?: any }> =
61+
tools.map(tool => ({
62+
name: tool.name,
63+
description: tool.description,
64+
input_schema: tool.schema,
65+
}));
66+
if (this.cacheControl && formatted.length > 0) {
5967
formatted[formatted.length - 1].cache_control = this.cacheControl;
60-
this.boundModel = (this.model! as any).withConfig({ tools: formatted });
61-
} else {
62-
this.boundModel = this.model!.bindTools(tools);
6368
}
69+
this.boundModel = (this.model! as any).withConfig({ tools: formatted });
6470
}
6571

6672
async invokeStructured<T = any>(schema: any, prompt: string | ChatMessage[], options?: StructuredInvokeOptions): Promise<T> {

packages/backend/llm/scorpio.llm.gemini/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"types": "dist/index.d.ts",
77
"scripts": { "build": "rimraf dist && tsc -b --force" },
88
"dependencies": {
9+
"@langchain/core": "catalog:",
910
"@langchain/google-genai": "^2.1.31",
1011
"scorpio.llm": "workspace:*"
1112
},

0 commit comments

Comments
 (0)