From 6a488bb0f52a2d22c3496c299b3fbf523316a51e Mon Sep 17 00:00:00 2001 From: Brian Joseph Petro Date: Sat, 7 Dec 2024 22:18:02 -0500 Subject: [PATCH] - Introduced `SmartChatModelCustomRequestAdapter` class extending `SmartChatModelRequestAdapter` to customized request behavior. - Updated `req_adapter` property in `SmartChatModelCustomAdapter` to utilize the new request adapter --- smart-chat-model/adapters/_custom.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/smart-chat-model/adapters/_custom.js b/smart-chat-model/adapters/_custom.js index 7a87c2fc..eebf1cdd 100644 --- a/smart-chat-model/adapters/_custom.js +++ b/smart-chat-model/adapters/_custom.js @@ -1,4 +1,4 @@ -import { SmartChatModelApiAdapter } from './_api.js'; +import { SmartChatModelApiAdapter, SmartChatModelRequestAdapter } from './_api.js'; // Define local platforms const local_platforms = ['custom_local', 'ollama', 'lm_studio']; @@ -9,6 +9,8 @@ export class SmartChatModelCustomAdapter extends SmartChatModelApiAdapter { type: "API" } + req_adapter = SmartChatModelCustomRequestAdapter; + get settings_config() { return { // LOCAL PLATFORM SETTINGS @@ -58,3 +60,9 @@ export class SmartChatModelCustomAdapter extends SmartChatModelApiAdapter { return true; } } + +export class SmartChatModelCustomRequestAdapter extends SmartChatModelRequestAdapter { + get model() { + return this.adapter.model_config.model_name; + } +}