@difizen/magent-au
Version:
32 lines • 1.06 kB
JavaScript
import { ManaModule } from '@difizen/mana-app';
import { LLMManager } from "./llm-manager.js";
import { LLMModel, LLMProvider } from "./llm-model.js";
import { LLMProviderManager } from "./llm-provider-manager.js";
import { LLMProviderFactory, LLMProviderOption } from "./protocol.js";
import { LLMModelOption } from "./protocol.js";
import { LLMModelFactory } from "./protocol.js";
export var ModelModule = ManaModule.create().register(LLMProvider, LLMProviderManager, LLMModel, LLMManager, {
token: LLMModelFactory,
useFactory: function useFactory(ctx) {
return function (meta) {
var child = ctx.container.createChild();
child.register({
token: LLMModelOption,
useValue: meta
});
return child.get(LLMModel);
};
}
}, {
token: LLMProviderFactory,
useFactory: function useFactory(ctx) {
return function (meta) {
var child = ctx.container.createChild();
child.register({
token: LLMProviderOption,
useValue: meta
});
return child.get(LLMProvider);
};
}
});