mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-29 12:50:59 +00:00
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:
@@ -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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user