fix: add _init method to register FakeChatService as a provider

Added _init method to FakeChatService to register itself as a provider with AIChatService, ensuring that the service and its models are properly recognized by the system.

ai: true
This commit is contained in:
KernelDeimos
2025-03-24 15:34:31 -04:00
committed by Eric Dubé
parent 42c6f92048
commit 7a2851d2cc
@@ -29,6 +29,19 @@ const BaseService = require("../../services/BaseService");
* Implements the 'puter-chat-completion' interface with list() and complete() methods.
*/
class FakeChatService extends BaseService {
/**
* Initializes the service and registers it as a provider with AIChatService
* @private
* @returns {Promise<void>}
*/
async _init() {
const svc_aiChat = this.services.get('ai-chat');
svc_aiChat.register_provider({
service_name: this.service_name,
alias: true,
});
}
get_default_model () {
return 'fake';
}