移除对 copilot 的兼容。更新示例和文档,统一使用 session_id 代替 conversationId
This commit is contained in:
@@ -18,7 +18,7 @@ export class ChatSessionBridge {
|
||||
) {}
|
||||
|
||||
async resolve(context: {
|
||||
conversationId?: string;
|
||||
clientSessionId?: string;
|
||||
accessToken?: string;
|
||||
projectId?: string;
|
||||
traceId?: string;
|
||||
@@ -28,7 +28,8 @@ export class ChatSessionBridge {
|
||||
created: boolean;
|
||||
}> {
|
||||
const requestContext: ChatRequestContext = {
|
||||
conversationId: context.conversationId?.trim() || `conv-${randomUUID().slice(0, 12)}`,
|
||||
clientSessionId:
|
||||
context.clientSessionId?.trim() || `agent-${randomUUID().slice(0, 12)}`,
|
||||
accessToken: context.accessToken,
|
||||
projectId: context.projectId,
|
||||
traceId: context.traceId?.trim() || `trace-${randomUUID().slice(0, 12)}`,
|
||||
@@ -46,7 +47,7 @@ export class ChatSessionBridge {
|
||||
} catch (error) {
|
||||
logger.warn(
|
||||
{
|
||||
conversationId: requestContext.conversationId,
|
||||
clientSessionId: requestContext.clientSessionId,
|
||||
sessionId: current.sessionId,
|
||||
err: error,
|
||||
},
|
||||
@@ -55,7 +56,7 @@ export class ChatSessionBridge {
|
||||
}
|
||||
}
|
||||
|
||||
const session = await this.runtime.createSession(requestContext.conversationId);
|
||||
const session = await this.runtime.createSession(requestContext.clientSessionId);
|
||||
const binding = this.registry.upsert(requestContext, session.id);
|
||||
this.sessionContexts.set(binding.sessionId, requestContext);
|
||||
return { binding, requestContext, created: true };
|
||||
|
||||
Reference in New Issue
Block a user