* 创建新的上下文会话
(
userId?: string,
preferences: Record<string, any> = {},
configuration: Record<string, any> = {},
customSessionId?: string
)
| 606 | * 创建新的上下文会话 |
| 607 | */ |
| 608 | public async createContextSession( |
| 609 | userId?: string, |
| 610 | preferences: Record<string, any> = {}, |
| 611 | configuration: Record<string, any> = {}, |
| 612 | customSessionId?: string |
| 613 | ): Promise<string> { |
| 614 | const contextComponent = this.getContextComponent(); |
| 615 | if (!contextComponent) { |
| 616 | throw new Error('上下文组件未启用'); |
| 617 | } |
| 618 | return await contextComponent.createSession( |
| 619 | userId, |
| 620 | preferences, |
| 621 | configuration, |
| 622 | customSessionId |
| 623 | ); |
| 624 | } |
| 625 | |
| 626 | /** |
| 627 | * 加载现有的上下文会话 |
no test coverage detected