rename core-module environment to twenty-config (#11445)
closes https://github.com/twentyhq/core-team-issues/issues/759
This commit is contained in:
@ -1,19 +1,19 @@
|
||||
import { LLMTracingDriver } from 'src/engine/core-modules/llm-tracing/interfaces/llm-tracing.interface';
|
||||
|
||||
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
|
||||
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
|
||||
|
||||
export const llmTracingModuleFactory = (
|
||||
environmentService: EnvironmentService,
|
||||
twentyConfigService: TwentyConfigService,
|
||||
) => {
|
||||
const driver = environmentService.get('LLM_TRACING_DRIVER');
|
||||
const driver = twentyConfigService.get('LLM_TRACING_DRIVER');
|
||||
|
||||
switch (driver) {
|
||||
case LLMTracingDriver.Console: {
|
||||
return { type: LLMTracingDriver.Console as const };
|
||||
}
|
||||
case LLMTracingDriver.Langfuse: {
|
||||
const secretKey = environmentService.get('LANGFUSE_SECRET_KEY');
|
||||
const publicKey = environmentService.get('LANGFUSE_PUBLIC_KEY');
|
||||
const secretKey = twentyConfigService.get('LANGFUSE_SECRET_KEY');
|
||||
const publicKey = twentyConfigService.get('LANGFUSE_PUBLIC_KEY');
|
||||
|
||||
if (!(secretKey && publicKey)) {
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user