From 1b2bc33e5e8bb435016ec4db740462c81fc9e5ef Mon Sep 17 00:00:00 2001 From: Eduardo Calixto Date: Tue, 16 Jan 2024 11:08:21 -0300 Subject: [PATCH] Remove Flowise requestMode option --- core/llm/llms/Flowise.ts | 16 ---------------- extensions/vscode/config_schema.json | 5 ----- 2 files changed, 21 deletions(-) diff --git a/core/llm/llms/Flowise.ts b/core/llm/llms/Flowise.ts index 3bf0d1219..a1943f9bd 100644 --- a/core/llm/llms/Flowise.ts +++ b/core/llm/llms/Flowise.ts @@ -50,7 +50,6 @@ interface IFlowiseKeyValueProperty { } interface IFlowiseProviderLLMOptions extends LLMOptions { - requestMode?: boolean; timeout?: number; additionalHeaders?: IFlowiseKeyValueProperty[]; additionalFlowiseConfiguration?: IFlowiseKeyValueProperty[]; @@ -66,14 +65,12 @@ class Flowise extends BaseLLM { Assistant: 'apiMessage' }; - protected requestMode: boolean = false; protected additionalFlowiseConfiguration: IFlowiseKeyValueProperty[] = []; protected timeout: number = 5000; protected additionalHeaders: IFlowiseKeyValueProperty[] = []; constructor(options: IFlowiseProviderLLMOptions) { super(options); - this.requestMode = Boolean(options.requestMode); this.timeout = options.timeout ?? 5000; this.additionalHeaders = options.additionalHeaders ?? []; this.additionalFlowiseConfiguration = options.additionalFlowiseConfiguration ?? []; @@ -126,19 +123,6 @@ class Flowise extends BaseLLM { protected async *_streamChat(messages: ChatMessage[], options: CompletionOptions): AsyncGenerator { const requestBody = this._getRequestBody(messages, options); - if (this.requestMode) { - const request = this.fetch(this._getChatUrl(), { - method: "POST", - headers: this._getHeaders(), - body: JSON.stringify(requestBody) - }).then(res => res.json()); - try { - yield { role: 'assistant', content: (await request).text }; - } catch (error: any) { - yield { role: 'assistant', content: (error as Error).message ?? error }; - } - return; - } const { socket, socketInfo } = await this._initializeSocket(); const request = this.fetch(this._getChatUrl(), { method: "POST", diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index bf7f258a4..657e22727 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -704,11 +704,6 @@ "default": 5000, "type": "integer" }, - "requestMode": { - "description": "Whether or not Flowise should run as a http request, instead of using socket.io to stream the response", - "type": "boolean", - "default": false - }, "additionalHeaders": { "description": "A list of additional headers", "type": "array",