mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 12:40:44 +00:00
refactor: Centralize session ID generation and propagation
This commit is contained in:
parent
95fdc66e7d
commit
d1e23b7c71
20 changed files with 96 additions and 71 deletions
|
|
@ -55,6 +55,7 @@ export class MCPServerConfig {
|
|||
}
|
||||
|
||||
export interface ConfigParameters {
|
||||
sessionId: string;
|
||||
contentGeneratorConfig: ContentGeneratorConfig;
|
||||
embeddingModel: string;
|
||||
sandbox?: boolean | string;
|
||||
|
|
@ -83,6 +84,7 @@ export interface ConfigParameters {
|
|||
|
||||
export class Config {
|
||||
private toolRegistry: Promise<ToolRegistry>;
|
||||
private readonly sessionId: string;
|
||||
private readonly contentGeneratorConfig: ContentGeneratorConfig;
|
||||
private readonly embeddingModel: string;
|
||||
private readonly sandbox: boolean | string | undefined;
|
||||
|
|
@ -111,6 +113,7 @@ export class Config {
|
|||
private fileDiscoveryService: FileDiscoveryService | null = null;
|
||||
|
||||
constructor(params: ConfigParameters) {
|
||||
this.sessionId = params.sessionId;
|
||||
this.contentGeneratorConfig = params.contentGeneratorConfig;
|
||||
this.embeddingModel = params.embeddingModel;
|
||||
this.sandbox = params.sandbox;
|
||||
|
|
@ -155,6 +158,10 @@ export class Config {
|
|||
}
|
||||
}
|
||||
|
||||
getSessionId(): string {
|
||||
return this.sessionId;
|
||||
}
|
||||
|
||||
getContentGeneratorConfig(): ContentGeneratorConfig {
|
||||
return this.contentGeneratorConfig;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue