@lobehub/lobehub 2.0.0-next.32 → 2.0.0-next.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +1 -0
- package/CHANGELOG.md +33 -0
- package/apps/desktop/package.json +1 -1
- package/changelog/v1.json +12 -0
- package/docker-compose/local/.env.example +3 -0
- package/docs/self-hosting/server-database/docker-compose.mdx +29 -0
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +29 -0
- package/package.json +1 -1
- package/packages/const/src/hotkeys.ts +3 -3
- package/packages/const/src/models.ts +2 -2
- package/packages/const/src/utils/merge.ts +3 -3
- package/packages/conversation-flow/package.json +13 -0
- package/packages/conversation-flow/src/__tests__/fixtures/index.ts +48 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistant-chain-with-followup.json +56 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistant-with-tools.json +144 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/active-index-1.json +131 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-branch.json +96 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/assistant-user-branch.json +123 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/conversation.json +128 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/index.ts +14 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/branch/nested.json +179 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/index.ts +8 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/simple.json +85 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/compare/with-tools.json +169 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/complex-scenario.json +107 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/index.ts +14 -0
- package/packages/conversation-flow/src/__tests__/fixtures/inputs/linear-conversation.json +59 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistant-chain-with-followup.json +135 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistant-with-tools.json +340 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/active-index-1.json +242 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-branch.json +208 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/assistant-user-branch.json +254 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/conversation.json +260 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/index.ts +14 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/branch/nested.json +389 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/index.ts +8 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/simple.json +224 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/compare/with-tools.json +418 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/complex-scenario.json +239 -0
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/linear-conversation.json +138 -0
- package/packages/conversation-flow/src/__tests__/parse.test.ts +97 -0
- package/packages/conversation-flow/src/index.ts +17 -0
- package/packages/conversation-flow/src/indexing.ts +58 -0
- package/packages/conversation-flow/src/parse.ts +53 -0
- package/packages/conversation-flow/src/structuring.ts +38 -0
- package/packages/conversation-flow/src/transformation/BranchResolver.ts +66 -0
- package/packages/conversation-flow/src/transformation/ContextTreeBuilder.ts +292 -0
- package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +421 -0
- package/packages/conversation-flow/src/transformation/MessageCollector.ts +166 -0
- package/packages/conversation-flow/src/transformation/MessageTransformer.ts +177 -0
- package/packages/conversation-flow/src/transformation/__tests__/BranchResolver.test.ts +151 -0
- package/packages/conversation-flow/src/transformation/__tests__/ContextTreeBuilder.test.ts +385 -0
- package/packages/conversation-flow/src/transformation/__tests__/FlatListBuilder.test.ts +511 -0
- package/packages/conversation-flow/src/transformation/__tests__/MessageCollector.test.ts +220 -0
- package/packages/conversation-flow/src/transformation/__tests__/MessageTransformer.test.ts +287 -0
- package/packages/conversation-flow/src/transformation/index.ts +78 -0
- package/packages/conversation-flow/src/types/contextTree.ts +65 -0
- package/packages/conversation-flow/src/types/flatMessageList.ts +66 -0
- package/packages/conversation-flow/src/types/shared.ts +63 -0
- package/packages/conversation-flow/src/types.ts +36 -0
- package/packages/conversation-flow/vitest.config.mts +10 -0
- package/packages/types/src/message/common/metadata.ts +5 -1
- package/src/app/[variants]/(main)/chat/@session/features/SessionListContent/List/Item/index.tsx +3 -4
- package/src/envs/__tests__/app.test.ts +47 -13
- package/src/envs/app.ts +6 -0
- package/src/server/routers/async/__tests__/caller.test.ts +333 -0
- package/src/server/routers/async/caller.ts +2 -1
- package/src/server/routers/lambda/__tests__/integration/message.integration.test.ts +57 -57
- package/src/server/routers/lambda/message.ts +2 -2
- package/src/server/services/message/__tests__/index.test.ts +4 -4
- package/src/server/services/message/index.ts +1 -1
- package/src/services/message/index.ts +2 -3
- package/src/store/chat/slices/aiChat/actions/__tests__/generateAIChat.test.ts +8 -8
- package/src/store/chat/slices/aiChat/actions/__tests__/generateAIChatV2.test.ts +8 -8
- package/src/store/chat/slices/aiChat/actions/__tests__/helpers.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/generateAIChatV2.ts +1 -1
- package/src/store/chat/slices/message/action.test.ts +7 -7
- package/src/store/chat/slices/message/action.ts +2 -2
- package/src/store/chat/slices/plugin/action.test.ts +7 -7
- package/src/store/chat/slices/plugin/action.ts +1 -1
- package/packages/context-engine/ARCHITECTURE.md +0 -425
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 2.0.0-next.33](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.32...v2.0.0-next.33)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-11-06**</sup>
|
|
8
|
+
|
|
9
|
+
#### ♻ Code Refactoring
|
|
10
|
+
|
|
11
|
+
- **misc**: Refactor message create name.
|
|
12
|
+
|
|
13
|
+
#### 🐛 Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **misc**: Model name display in the assistant panel disappears.
|
|
16
|
+
|
|
17
|
+
<br/>
|
|
18
|
+
|
|
19
|
+
<details>
|
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
21
|
+
|
|
22
|
+
#### Code refactoring
|
|
23
|
+
|
|
24
|
+
- **misc**: Refactor message create name, closes [#10074](https://github.com/lobehub/lobe-chat/issues/10074) ([08ec29f](https://github.com/lobehub/lobe-chat/commit/08ec29f))
|
|
25
|
+
|
|
26
|
+
#### What's fixed
|
|
27
|
+
|
|
28
|
+
- **misc**: Model name display in the assistant panel disappears, closes [#9830](https://github.com/lobehub/lobe-chat/issues/9830) ([54f4e18](https://github.com/lobehub/lobe-chat/commit/54f4e18))
|
|
29
|
+
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
<div align="right">
|
|
33
|
+
|
|
34
|
+
[](#readme-top)
|
|
35
|
+
|
|
36
|
+
</div>
|
|
37
|
+
|
|
5
38
|
## [Version 2.0.0-next.32](https://github.com/lobehub/lobe-chat/compare/v2.0.0-next.31...v2.0.0-next.32)
|
|
6
39
|
|
|
7
40
|
<sup>Released on **2025-11-05**</sup>
|
package/changelog/v1.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"children": {
|
|
4
|
+
"improvements": [
|
|
5
|
+
"Refactor message create name."
|
|
6
|
+
],
|
|
7
|
+
"fixes": [
|
|
8
|
+
"Model name display in the assistant panel disappears."
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"date": "2025-11-06",
|
|
12
|
+
"version": "2.0.0-next.33"
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"children": {
|
|
4
16
|
"fixes": [
|
|
@@ -17,6 +17,9 @@ LOBE_PORT=3210
|
|
|
17
17
|
CASDOOR_PORT=8000
|
|
18
18
|
MINIO_PORT=9000
|
|
19
19
|
APP_URL=http://localhost:3210
|
|
20
|
+
# INTERNAL_APP_URL is optional, used for server-to-server calls
|
|
21
|
+
# to bypass CDN/proxy. If not set, defaults to APP_URL.
|
|
22
|
+
# Example: INTERNAL_APP_URL=http://localhost:3210
|
|
20
23
|
AUTH_URL=http://localhost:3210/api/auth
|
|
21
24
|
|
|
22
25
|
# Postgres related, which are the necessary environment variables for DB
|
|
@@ -675,6 +675,35 @@ You first need to access the WebUI for configuration:
|
|
|
675
675
|
|
|
676
676
|
At this point, you have successfully deployed the LobeChat database version, and you can access your LobeChat service at `https://lobe.example.com`.
|
|
677
677
|
|
|
678
|
+
#### Configuring Internal Server Communication with `INTERNAL_APP_URL`
|
|
679
|
+
|
|
680
|
+
<Callout type="info">
|
|
681
|
+
If you are deploying LobeChat behind a CDN (like Cloudflare) or reverse proxy, you may want to configure internal server-to-server communication to bypass the CDN/proxy layer for better performance.
|
|
682
|
+
</Callout>
|
|
683
|
+
|
|
684
|
+
You can configure the `INTERNAL_APP_URL` environment variable:
|
|
685
|
+
|
|
686
|
+
```yaml
|
|
687
|
+
environment:
|
|
688
|
+
- 'APP_URL=https://lobe.example.com' # Public URL for browser access
|
|
689
|
+
- 'INTERNAL_APP_URL=http://localhost:3210' # Internal URL for server-to-server calls
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
**How it works:**
|
|
693
|
+
- `APP_URL`: Used for browser/client access, OAuth callbacks, webhooks, etc. (goes through CDN/proxy)
|
|
694
|
+
- `INTERNAL_APP_URL`: Used for internal server-to-server communication (bypasses CDN/proxy)
|
|
695
|
+
|
|
696
|
+
If `INTERNAL_APP_URL` is not set, it defaults to `APP_URL`.
|
|
697
|
+
|
|
698
|
+
**Configuration options:**
|
|
699
|
+
- `http://localhost:3210` - If using Docker with host network mode
|
|
700
|
+
- `http://lobe:3210` - If using Docker network with service name
|
|
701
|
+
- `http://127.0.0.1:3210` - Alternative localhost address
|
|
702
|
+
|
|
703
|
+
<Callout type="tip">
|
|
704
|
+
For Docker Compose deployments with `network_mode: 'service:network-service'`, use `http://localhost:3210` as the `INTERNAL_APP_URL`.
|
|
705
|
+
</Callout>
|
|
706
|
+
|
|
678
707
|
#### Configuration Files
|
|
679
708
|
|
|
680
709
|
For convenience, here is a summary of example configuration files required for the production deployment using the Casdoor authentication scheme:
|
|
@@ -651,6 +651,35 @@ docker compose up -d # 重新启动
|
|
|
651
651
|
|
|
652
652
|
至此,你已经成功部署了 LobeChat 数据库版本,你可以通过 `https://lobe.example.com` 访问你的 LobeChat 服务。
|
|
653
653
|
|
|
654
|
+
#### 使用 `INTERNAL_APP_URL` 配置内部服务器通信
|
|
655
|
+
|
|
656
|
+
<Callout type="info">
|
|
657
|
+
如果你在 CDN(如 Cloudflare)或反向代理后部署 LobeChat,你可以配置内部服务器到服务器通信以绕过 CDN/代理层,以获得更好的性能。
|
|
658
|
+
</Callout>
|
|
659
|
+
|
|
660
|
+
你可以配置 `INTERNAL_APP_URL` 环境变量:
|
|
661
|
+
|
|
662
|
+
```yaml
|
|
663
|
+
environment:
|
|
664
|
+
- 'APP_URL=https://lobe.example.com' # 浏览器访问的公开 URL
|
|
665
|
+
- 'INTERNAL_APP_URL=http://localhost:3210' # 服务器到服务器调用的内部 URL
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
**工作原理:**
|
|
669
|
+
- `APP_URL`:用于浏览器/客户端访问、OAuth 回调、webhook 等(通过 CDN/代理)
|
|
670
|
+
- `INTERNAL_APP_URL`:用于内部服务器到服务器通信(绕过 CDN/代理)
|
|
671
|
+
|
|
672
|
+
如果未设置 `INTERNAL_APP_URL`,它将默认为 `APP_URL`。
|
|
673
|
+
|
|
674
|
+
**配置选项:**
|
|
675
|
+
- `http://localhost:3210` - 如果使用 Docker 主机网络模式
|
|
676
|
+
- `http://lobe:3210` - 如果使用 Docker 网络与服务名称
|
|
677
|
+
- `http://127.0.0.1:3210` - 备用本地主机地址
|
|
678
|
+
|
|
679
|
+
<Callout type="tip">
|
|
680
|
+
对于使用 `network_mode: 'service:network-service'` 的 Docker Compose 部署,请使用 `http://localhost:3210` 作为 `INTERNAL_APP_URL`。
|
|
681
|
+
</Callout>
|
|
682
|
+
|
|
654
683
|
#### 配置文件
|
|
655
684
|
|
|
656
685
|
为方便一键复制,在此汇总基于 casdoor 鉴权方案的域名方式下生产部署配置服务端数据库所需要的示例配置文件。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/lobehub",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.33",
|
|
4
4
|
"description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -12,7 +12,7 @@ const combineKeys = (keys: string[]) => keys.join('+');
|
|
|
12
12
|
|
|
13
13
|
export type HotkeyRegistration = HotkeyItem[];
|
|
14
14
|
|
|
15
|
-
// mod
|
|
15
|
+
// mod is the command key on Mac, alt is the ctrl key on Windows
|
|
16
16
|
export const HOTKEYS_REGISTRATION: HotkeyRegistration = [
|
|
17
17
|
// basic
|
|
18
18
|
{
|
|
@@ -93,7 +93,7 @@ export const HOTKEYS_REGISTRATION: HotkeyRegistration = [
|
|
|
93
93
|
group: HotkeyGroupEnum.Conversation,
|
|
94
94
|
id: HotkeyEnum.AddUserMessage,
|
|
95
95
|
keys: combineKeys([KeyEnum.Alt, KeyEnum.Enter]),
|
|
96
|
-
//
|
|
96
|
+
// Not activated through Scope mode
|
|
97
97
|
},
|
|
98
98
|
{
|
|
99
99
|
group: HotkeyGroupEnum.Conversation,
|
|
@@ -112,7 +112,7 @@ export const HOTKEYS_REGISTRATION: HotkeyRegistration = [
|
|
|
112
112
|
|
|
113
113
|
type DesktopHotkeyRegistration = DesktopHotkeyItem[];
|
|
114
114
|
|
|
115
|
-
//
|
|
115
|
+
// Desktop hotkey configuration
|
|
116
116
|
export const DESKTOP_HOTKEYS_REGISTRATION: DesktopHotkeyRegistration = [
|
|
117
117
|
{
|
|
118
118
|
id: DesktopHotkeyEnum.ShowApp,
|
|
@@ -5,14 +5,14 @@ export const systemToUserModels = new Set([
|
|
|
5
5
|
'o1-mini-2024-09-12',
|
|
6
6
|
]);
|
|
7
7
|
|
|
8
|
-
// TODO:
|
|
8
|
+
// TODO: temporary implementation, needs to be refactored into model card display configuration
|
|
9
9
|
export const disableStreamModels = new Set([
|
|
10
10
|
'o1',
|
|
11
11
|
'o1-2024-12-17',
|
|
12
12
|
'o1-pro',
|
|
13
13
|
'o1-pro-2025-03-19',
|
|
14
14
|
/*
|
|
15
|
-
|
|
15
|
+
Official documentation shows no support, but actual testing shows Streaming is supported, temporarily commented out
|
|
16
16
|
'o3-pro',
|
|
17
17
|
'o3-pro-2025-06-10',
|
|
18
18
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { merge as _merge, isEmpty, mergeWith } from 'lodash-es';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Used to merge objects. If it's an array, replace directly
|
|
5
5
|
* @param target
|
|
6
6
|
* @param source
|
|
7
7
|
*/
|
|
@@ -24,7 +24,7 @@ export const mergeArrayById = <T extends MergeableItem>(defaultItems: T[], userI
|
|
|
24
24
|
// Create a map of default items for faster lookup
|
|
25
25
|
const defaultItemsMap = new Map(defaultItems.map((item) => [item.id, item]));
|
|
26
26
|
|
|
27
|
-
//
|
|
27
|
+
// Use Map to store merge results, so that later items with duplicate IDs naturally override earlier ones
|
|
28
28
|
const mergedItemsMap = new Map<string, T>();
|
|
29
29
|
|
|
30
30
|
// Process user items with default metadata
|
|
@@ -51,7 +51,7 @@ export const mergeArrayById = <T extends MergeableItem>(defaultItems: T[], userI
|
|
|
51
51
|
mergedItemsMap.set(userItem.id, mergedItem);
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
//
|
|
54
|
+
// Add items that only exist in the default configuration
|
|
55
55
|
defaultItems.forEach((item) => {
|
|
56
56
|
if (!mergedItemsMap.has(item.id)) {
|
|
57
57
|
mergedItemsMap.set(item.id, item);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lobechat/conversation-flow",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Scalable complex conversation flow rendering engine",
|
|
5
|
+
"main": "src/index.ts",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test": "vitest",
|
|
8
|
+
"test:coverage": "vitest --coverage --silent='passed-only'"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@lobechat/types": "workspace:*"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Message, ParseResult } from '../../types';
|
|
2
|
+
// Input fixtures
|
|
3
|
+
import assistantChainWithFollowupInput from './inputs/assistant-chain-with-followup.json';
|
|
4
|
+
import assistantWithToolsInput from './inputs/assistant-with-tools.json';
|
|
5
|
+
import { branch as branchInputs } from './inputs/branch';
|
|
6
|
+
import { compare as compareInputs } from './inputs/compare';
|
|
7
|
+
import complexScenarioInput from './inputs/complex-scenario.json';
|
|
8
|
+
import linearConversationInput from './inputs/linear-conversation.json';
|
|
9
|
+
// Output fixtures
|
|
10
|
+
import assistantChainWithFollowupOutput from './outputs/assistant-chain-with-followup.json';
|
|
11
|
+
import assistantWithToolsOutput from './outputs/assistant-with-tools.json';
|
|
12
|
+
import { branch as branchOutputs } from './outputs/branch';
|
|
13
|
+
import { compare as compareOutputs } from './outputs/compare';
|
|
14
|
+
import complexScenarioOutput from './outputs/complex-scenario.json';
|
|
15
|
+
import linearConversationOutput from './outputs/linear-conversation.json';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Serialized parse result type
|
|
19
|
+
*/
|
|
20
|
+
export interface SerializedParseResult {
|
|
21
|
+
contextTree: ParseResult['contextTree'];
|
|
22
|
+
flatList: ParseResult['flatList'];
|
|
23
|
+
messageMap: Record<string, Message>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Test input fixtures - raw messages from database
|
|
28
|
+
*/
|
|
29
|
+
export const inputs = {
|
|
30
|
+
assistantChainWithFollowup: assistantChainWithFollowupInput as Message[],
|
|
31
|
+
assistantWithTools: assistantWithToolsInput as Message[],
|
|
32
|
+
branch: branchInputs,
|
|
33
|
+
compare: compareInputs,
|
|
34
|
+
complexScenario: complexScenarioInput as Message[],
|
|
35
|
+
linearConversation: linearConversationInput as Message[],
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Test output fixtures - expected parse results
|
|
40
|
+
*/
|
|
41
|
+
export const outputs = {
|
|
42
|
+
assistantChainWithFollowup: assistantChainWithFollowupOutput as unknown as SerializedParseResult,
|
|
43
|
+
assistantWithTools: assistantWithToolsOutput as unknown as SerializedParseResult,
|
|
44
|
+
branch: branchOutputs,
|
|
45
|
+
compare: compareOutputs,
|
|
46
|
+
complexScenario: complexScenarioOutput as unknown as SerializedParseResult,
|
|
47
|
+
linearConversation: linearConversationOutput as unknown as SerializedParseResult,
|
|
48
|
+
};
|
package/packages/conversation-flow/src/__tests__/fixtures/inputs/assistant-chain-with-followup.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "msg-1",
|
|
4
|
+
"role": "user",
|
|
5
|
+
"content": "What's the weather?",
|
|
6
|
+
"createdAt": 1000,
|
|
7
|
+
"updatedAt": 1000,
|
|
8
|
+
"meta": {}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "msg-2",
|
|
12
|
+
"role": "assistant",
|
|
13
|
+
"content": "Let me check the weather for you.",
|
|
14
|
+
"createdAt": 2000,
|
|
15
|
+
"updatedAt": 2000,
|
|
16
|
+
"parentId": "msg-1",
|
|
17
|
+
"meta": {},
|
|
18
|
+
"tools": [
|
|
19
|
+
{
|
|
20
|
+
"id": "tool-1",
|
|
21
|
+
"type": "default",
|
|
22
|
+
"apiName": "getWeather",
|
|
23
|
+
"identifier": "weather",
|
|
24
|
+
"arguments": "{\"location\":\"New York\"}"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "tool-1",
|
|
30
|
+
"role": "tool",
|
|
31
|
+
"content": "{\"temperature\":\"72F\",\"condition\":\"sunny\"}",
|
|
32
|
+
"createdAt": 3000,
|
|
33
|
+
"updatedAt": 3000,
|
|
34
|
+
"parentId": "msg-2",
|
|
35
|
+
"meta": {},
|
|
36
|
+
"tool_call_id": "tool-1"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "msg-3",
|
|
40
|
+
"role": "assistant",
|
|
41
|
+
"content": "The weather in New York is 72F and sunny.",
|
|
42
|
+
"createdAt": 4000,
|
|
43
|
+
"updatedAt": 4000,
|
|
44
|
+
"parentId": "tool-1",
|
|
45
|
+
"meta": {}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "msg-4",
|
|
49
|
+
"role": "user",
|
|
50
|
+
"content": "Thanks! How about tomorrow?",
|
|
51
|
+
"createdAt": 5000,
|
|
52
|
+
"updatedAt": 5000,
|
|
53
|
+
"parentId": "msg-3",
|
|
54
|
+
"meta": {}
|
|
55
|
+
}
|
|
56
|
+
]
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "msg-101",
|
|
4
|
+
"role": "user",
|
|
5
|
+
"content": "What's the weather like in San Francisco and Beijing today?",
|
|
6
|
+
"parentId": null,
|
|
7
|
+
"createdAt": 1704067200000,
|
|
8
|
+
"updatedAt": 1704067200000,
|
|
9
|
+
"meta": {}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"id": "msg-102",
|
|
13
|
+
"role": "assistant",
|
|
14
|
+
"content": "Let me check the current weather conditions in both cities for you.",
|
|
15
|
+
"parentId": "msg-101",
|
|
16
|
+
"tools": [
|
|
17
|
+
{
|
|
18
|
+
"id": "tool-sf",
|
|
19
|
+
"identifier": "weather",
|
|
20
|
+
"apiName": "getWeather",
|
|
21
|
+
"arguments": "{\"city\":\"San Francisco\"}",
|
|
22
|
+
"type": "default"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "tool-bj",
|
|
26
|
+
"identifier": "weather",
|
|
27
|
+
"apiName": "getWeather",
|
|
28
|
+
"arguments": "{\"city\":\"Beijing\"}",
|
|
29
|
+
"type": "default"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"createdAt": 1704067202000,
|
|
33
|
+
"updatedAt": 1704067202000,
|
|
34
|
+
"meta": {},
|
|
35
|
+
"metadata": {
|
|
36
|
+
"totalInputTokens": 28,
|
|
37
|
+
"totalOutputTokens": 45,
|
|
38
|
+
"totalTokens": 73,
|
|
39
|
+
"cost": 0.000219,
|
|
40
|
+
"tps": 48.5,
|
|
41
|
+
"ttft": 245,
|
|
42
|
+
"duration": 928,
|
|
43
|
+
"latency": 1173
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "msg-103",
|
|
48
|
+
"role": "tool",
|
|
49
|
+
"tool_call_id": "tool-sf",
|
|
50
|
+
"content": "{\"location\": \"San Francisco, CA\", \"temperature\": 18, \"conditions\": \"Partly Cloudy\", \"humidity\": 72, \"wind_speed\": 15}",
|
|
51
|
+
"pluginState": { "cached": false, "executionTime": 234 },
|
|
52
|
+
"parentId": "msg-102",
|
|
53
|
+
"createdAt": 1704067203000,
|
|
54
|
+
"updatedAt": 1704067203000,
|
|
55
|
+
"meta": {}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "msg-104",
|
|
59
|
+
"role": "tool",
|
|
60
|
+
"tool_call_id": "tool-bj",
|
|
61
|
+
"content": "{\"location\": \"Beijing, China\", \"temperature\": 12, \"conditions\": \"Clear\", \"humidity\": 45, \"wind_speed\": 8}",
|
|
62
|
+
"pluginState": { "cached": false, "executionTime": 189 },
|
|
63
|
+
"parentId": "msg-102",
|
|
64
|
+
"createdAt": 1704067203100,
|
|
65
|
+
"updatedAt": 1704067203100,
|
|
66
|
+
"meta": {}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "msg-105",
|
|
70
|
+
"role": "assistant",
|
|
71
|
+
"content": "Let me also check the forecast for tomorrow to give you a better comparison.",
|
|
72
|
+
"parentId": "msg-103",
|
|
73
|
+
"tools": [
|
|
74
|
+
{
|
|
75
|
+
"id": "tool-sf-forecast",
|
|
76
|
+
"identifier": "weather",
|
|
77
|
+
"apiName": "getForecast",
|
|
78
|
+
"arguments": "{\"city\":\"San Francisco\",\"days\":1}",
|
|
79
|
+
"type": "default"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"id": "tool-bj-forecast",
|
|
83
|
+
"identifier": "weather",
|
|
84
|
+
"apiName": "getForecast",
|
|
85
|
+
"arguments": "{\"city\":\"Beijing\",\"days\":1}",
|
|
86
|
+
"type": "default"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"createdAt": 1704067205000,
|
|
90
|
+
"updatedAt": 1704067205000,
|
|
91
|
+
"meta": {},
|
|
92
|
+
"metadata": {
|
|
93
|
+
"totalInputTokens": 156,
|
|
94
|
+
"totalOutputTokens": 42,
|
|
95
|
+
"totalTokens": 198,
|
|
96
|
+
"cost": 0.000594,
|
|
97
|
+
"tps": 48,
|
|
98
|
+
"ttft": 178,
|
|
99
|
+
"duration": 875,
|
|
100
|
+
"latency": 1053
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "msg-106",
|
|
105
|
+
"role": "tool",
|
|
106
|
+
"tool_call_id": "tool-sf-forecast",
|
|
107
|
+
"content": "{\"location\": \"San Francisco, CA\", \"date\": \"2024-01-02\", \"high\": 20, \"low\": 14, \"conditions\": \"Sunny\"}",
|
|
108
|
+
"pluginState": { "cached": false, "executionTime": 198 },
|
|
109
|
+
"parentId": "msg-105",
|
|
110
|
+
"createdAt": 1704067206000,
|
|
111
|
+
"updatedAt": 1704067206000,
|
|
112
|
+
"meta": {}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"id": "msg-107",
|
|
116
|
+
"role": "tool",
|
|
117
|
+
"tool_call_id": "tool-bj-forecast",
|
|
118
|
+
"content": "{\"location\": \"Beijing, China\", \"date\": \"2024-01-02\", \"high\": 15, \"low\": 8, \"conditions\": \"Partly Cloudy\"}",
|
|
119
|
+
"pluginState": { "cached": false, "executionTime": 176 },
|
|
120
|
+
"parentId": "msg-105",
|
|
121
|
+
"createdAt": 1704067206100,
|
|
122
|
+
"updatedAt": 1704067206100,
|
|
123
|
+
"meta": {}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "msg-108",
|
|
127
|
+
"role": "assistant",
|
|
128
|
+
"content": "Based on both current weather and tomorrow's forecast:\n\n**Today:**\n- San Francisco: 18°C, partly cloudy\n- Beijing: 12°C, clear\n\n**Tomorrow:**\n- San Francisco: High 20°C / Low 14°C, sunny\n- Beijing: High 15°C / Low 8°C, partly cloudy\n\nSan Francisco will have pleasant sunny weather tomorrow with a slight temperature increase. Beijing will see some clouds moving in but will still be cooler overall.",
|
|
129
|
+
"parentId": "msg-106",
|
|
130
|
+
"createdAt": 1704067208000,
|
|
131
|
+
"updatedAt": 1704067208000,
|
|
132
|
+
"meta": {},
|
|
133
|
+
"metadata": {
|
|
134
|
+
"totalInputTokens": 245,
|
|
135
|
+
"totalOutputTokens": 112,
|
|
136
|
+
"totalTokens": 357,
|
|
137
|
+
"cost": 0.001071,
|
|
138
|
+
"tps": 54,
|
|
139
|
+
"ttft": 165,
|
|
140
|
+
"duration": 2074,
|
|
141
|
+
"latency": 2239
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "msg-201",
|
|
4
|
+
"role": "user",
|
|
5
|
+
"content": "Write a haiku about programming",
|
|
6
|
+
"parentId": null,
|
|
7
|
+
"createdAt": 1704067200000,
|
|
8
|
+
"updatedAt": 1704067200000,
|
|
9
|
+
"meta": {},
|
|
10
|
+
"metadata": {
|
|
11
|
+
"activeBranchIndex": 1
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"id": "msg-202",
|
|
16
|
+
"role": "assistant",
|
|
17
|
+
"content": "Code flows like water,\nBugs hide in silent shadows,\nDebug brings the light.",
|
|
18
|
+
"parentId": "msg-201",
|
|
19
|
+
"createdAt": 1704067203000,
|
|
20
|
+
"updatedAt": 1704067203000,
|
|
21
|
+
"meta": {},
|
|
22
|
+
"metadata": {
|
|
23
|
+
"totalInputTokens": 12,
|
|
24
|
+
"totalOutputTokens": 28,
|
|
25
|
+
"totalTokens": 40,
|
|
26
|
+
"cost": 0.00012
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "msg-203",
|
|
31
|
+
"role": "assistant",
|
|
32
|
+
"content": "Functions compile,\nVariables dance in memory,\nAlgorithm sings.",
|
|
33
|
+
"parentId": "msg-201",
|
|
34
|
+
"createdAt": 1704067203100,
|
|
35
|
+
"updatedAt": 1704067203100,
|
|
36
|
+
"meta": {},
|
|
37
|
+
"metadata": {
|
|
38
|
+
"totalInputTokens": 12,
|
|
39
|
+
"totalOutputTokens": 24,
|
|
40
|
+
"totalTokens": 36,
|
|
41
|
+
"cost": 0.000108
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"id": "msg-204",
|
|
46
|
+
"role": "assistant",
|
|
47
|
+
"content": "Lines of logic flow,\nErrors break the peaceful code,\nTests restore the calm.",
|
|
48
|
+
"parentId": "msg-201",
|
|
49
|
+
"createdAt": 1704067203200,
|
|
50
|
+
"updatedAt": 1704067203200,
|
|
51
|
+
"meta": {},
|
|
52
|
+
"metadata": {
|
|
53
|
+
"totalInputTokens": 12,
|
|
54
|
+
"totalOutputTokens": 26,
|
|
55
|
+
"totalTokens": 38,
|
|
56
|
+
"cost": 0.000114
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"id": "msg-205",
|
|
61
|
+
"role": "user",
|
|
62
|
+
"content": "I like the first one best!",
|
|
63
|
+
"parentId": "msg-202",
|
|
64
|
+
"createdAt": 1704067220000,
|
|
65
|
+
"updatedAt": 1704067220000,
|
|
66
|
+
"meta": {}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "msg-206",
|
|
70
|
+
"role": "assistant",
|
|
71
|
+
"content": "Thank you! I'm glad you enjoyed it. The metaphor of light revealing hidden bugs is one of my favorites. Would you like me to write more haikus on different programming topics?",
|
|
72
|
+
"parentId": "msg-205",
|
|
73
|
+
"createdAt": 1704067222000,
|
|
74
|
+
"updatedAt": 1704067222000,
|
|
75
|
+
"meta": {},
|
|
76
|
+
"metadata": {
|
|
77
|
+
"totalInputTokens": 52,
|
|
78
|
+
"totalOutputTokens": 48,
|
|
79
|
+
"totalTokens": 100,
|
|
80
|
+
"cost": 0.0003
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "msg-207",
|
|
85
|
+
"role": "user",
|
|
86
|
+
"content": "Actually, I prefer the second one with the dancing variables.",
|
|
87
|
+
"parentId": "msg-203",
|
|
88
|
+
"createdAt": 1704067225000,
|
|
89
|
+
"updatedAt": 1704067225000,
|
|
90
|
+
"meta": {}
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"id": "msg-208",
|
|
94
|
+
"role": "assistant",
|
|
95
|
+
"content": "I appreciate your feedback! The imagery of variables dancing in memory really captures the dynamic nature of programming. Would you like me to explore more haikus with that kind of vivid metaphor?",
|
|
96
|
+
"parentId": "msg-207",
|
|
97
|
+
"createdAt": 1704067227000,
|
|
98
|
+
"updatedAt": 1704067227000,
|
|
99
|
+
"meta": {},
|
|
100
|
+
"metadata": {
|
|
101
|
+
"totalInputTokens": 48,
|
|
102
|
+
"totalOutputTokens": 52,
|
|
103
|
+
"totalTokens": 100,
|
|
104
|
+
"cost": 0.0003
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"id": "msg-209",
|
|
109
|
+
"role": "user",
|
|
110
|
+
"content": "Yes, please write one more about debugging!",
|
|
111
|
+
"parentId": "msg-206",
|
|
112
|
+
"createdAt": 1704067230000,
|
|
113
|
+
"updatedAt": 1704067230000,
|
|
114
|
+
"meta": {}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"id": "msg-210",
|
|
118
|
+
"role": "assistant",
|
|
119
|
+
"content": "Console logs cascade,\nBreakpoints pause the racing code,\nTruth emerges clear.",
|
|
120
|
+
"parentId": "msg-209",
|
|
121
|
+
"createdAt": 1704067232000,
|
|
122
|
+
"updatedAt": 1704067232000,
|
|
123
|
+
"meta": {},
|
|
124
|
+
"metadata": {
|
|
125
|
+
"totalInputTokens": 78,
|
|
126
|
+
"totalOutputTokens": 24,
|
|
127
|
+
"totalTokens": 102,
|
|
128
|
+
"cost": 0.000306
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
]
|