MCPcopy Create free account
hub / github.com/QuantiaAI/helm-agents / getForUser

Method getForUser

apps/api/src/engine/engine.service.ts:47–69  ·  view source on GitHub ↗
(userId: string)

Source from the content-addressed store, hash-verified

45 ) {}
46
47 getForUser(userId: string): Engine {
48 let engine = this.cache.get(userId);
49 if (!engine) {
50 const runtime = settingsToRuntime(this.settings.get(userId));
51 const config = resolveConfig({ runtime: runtime as never });
52 let overrides = demoOverrides();
53 if (!overrides) {
54 const env = this.keys.envMap(userId);
55 const base = {
56 provider: config.llmProvider,
57 baseUrl: config.backendUrl ?? undefined,
58 env,
59 };
60 overrides = {
61 quick: createLlmClient({ ...base, model: config.quickThinkLlm }),
62 deep: createLlmClient({ ...base, model: config.deepThinkLlm }),
63 };
64 }
65 engine = createEngine(config, overrides);
66 this.cache.set(userId, engine);
67 }
68 return engine;
69 }
70
71 /** Drop a user's cached engine so their next run picks up new settings/keys. */
72 invalidate(userId: string): void {

Callers 4

analyzeMethod · 0.80
resolveMethod · 0.80
constructorMethod · 0.80

Calls 8

resolveConfigFunction · 0.90
createLlmClientFunction · 0.90
createEngineFunction · 0.90
settingsToRuntimeFunction · 0.85
demoOverridesFunction · 0.85
envMapMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected