mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
Use parameter properties where possible. (#242)
This commit is contained in:
@@ -23,7 +23,6 @@ import { ReadManyFilesTool } from '../tools/read-many-files.js'; // Import ReadM
|
||||
import { getResponseText } from '../utils/generateContentResponseUtilities.js';
|
||||
|
||||
export class GeminiClient {
|
||||
private config: Config;
|
||||
private client: GoogleGenAI;
|
||||
private model: string;
|
||||
private generateContentConfig: GenerateContentConfig = {
|
||||
@@ -32,9 +31,8 @@ export class GeminiClient {
|
||||
};
|
||||
private readonly MAX_TURNS = 100;
|
||||
|
||||
constructor(config: Config) {
|
||||
constructor(private config: Config) {
|
||||
this.client = new GoogleGenAI({ apiKey: config.getApiKey() });
|
||||
this.config = config;
|
||||
this.model = config.getModel();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ export type ServerGeminiStreamEvent =
|
||||
|
||||
// A turn manages the agentic loop turn within the server context.
|
||||
export class Turn {
|
||||
private readonly chat: Chat;
|
||||
private readonly availableTools: Map<string, ServerTool>; // Use passed-in tools
|
||||
private pendingToolCalls: Array<{
|
||||
callId: string;
|
||||
@@ -95,8 +94,10 @@ export class Turn {
|
||||
private confirmationDetails: ToolCallConfirmationDetails[];
|
||||
private debugResponses: GenerateContentResponse[];
|
||||
|
||||
constructor(chat: Chat, availableTools: ServerTool[]) {
|
||||
this.chat = chat;
|
||||
constructor(
|
||||
private readonly chat: Chat,
|
||||
availableTools: ServerTool[],
|
||||
) {
|
||||
this.availableTools = new Map(availableTools.map((t) => [t.name, t]));
|
||||
this.pendingToolCalls = [];
|
||||
this.fnResponses = [];
|
||||
|
||||
Reference in New Issue
Block a user