MCPcopy Create free account
hub / github.com/echoVic/blade-code / createContextSession

Method createContextSession

src/agent/Agent.ts:608–624  ·  view source on GitHub ↗

* 创建新的上下文会话

(
    userId?: string,
    preferences: Record<string, any> = {},
    configuration: Record<string, any> = {},
    customSessionId?: string
  )

Source from the content-addressed store, hash-verified

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 * 加载现有的上下文会话

Callers 2

agentLlmCommandFunction · 0.95
agentWithContextExampleFunction · 0.95

Calls 2

getContextComponentMethod · 0.95
createSessionMethod · 0.45

Tested by

no test coverage detected