Files

1 line
4.0 KiB
JSON

{"repo": "balcus/aiplayground", "files": {"AiPlayground.BusinessLogic/AiClient/AiClientFactory.cs": {"f7caf067da95ac7c3a720db6dcc7db748d966e16": {"t": 1785745810.4286036, "n": 1229, "h": "997438fe76575434", "c": "using AiPlayground.BusinessLogic.Enums;\nusing AiPlayground.DataAccess.Entities;\n\nnamespace AiPlayground.BusinessLogic.AiClient;\n\n// TODO: DO NOT PUSH THIS TO GITHUB\n// set the keys as env variables\n// create a rating model for the messgaes\npublic class AiClientFactory : IAiClientFactory\n{\n public IAiClient GenerateClient(Model model)\n {\n return (PlatformType)model.PlatformId switch\n {\n PlatformType.OpenAi => new OpenAiClient(\n model.Name,\n Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\") ?? throw new Exception(\"OPENAI_API_KEY is missing\")\n ),\n \n PlatformType.DeepSeek => new DeepSeekClient(\n model.Name, \n Environment.GetEnvironmentVariable(\"DEEPSEEK_API_KEY\") ?? throw new Exception(\"DEEPSEEK_API_KEY is missing\")\n ),\n \n PlatformType.Gemini => new GeminiClient(\n model.Name, \n Environment.GetEnvironmentVariable(\"GEMINI_API_KEY\") ?? throw new Exception(\"GEMINI_API_KEY is missing\")\n ),\n \n _ => throw new ArgumentException($\"Unsupported platform : {model.PlatformId}\")\n };\n }\n}"}, "bb5212497fcfa29a80f4f45ff2f276511c4329fe": {"t": 1785756760.8938482, "n": 1229, "h": "997438fe76575434", "c": "using AiPlayground.BusinessLogic.Enums;\nusing AiPlayground.DataAccess.Entities;\n\nnamespace AiPlayground.BusinessLogic.AiClient;\n\n// TODO: DO NOT PUSH THIS TO GITHUB\n// set the keys as env variables\n// create a rating model for the messgaes\npublic class AiClientFactory : IAiClientFactory\n{\n public IAiClient GenerateClient(Model model)\n {\n return (PlatformType)model.PlatformId switch\n {\n PlatformType.OpenAi => new OpenAiClient(\n model.Name,\n Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\") ?? throw new Exception(\"OPENAI_API_KEY is missing\")\n ),\n \n PlatformType.DeepSeek => new DeepSeekClient(\n model.Name, \n Environment.GetEnvironmentVariable(\"DEEPSEEK_API_KEY\") ?? throw new Exception(\"DEEPSEEK_API_KEY is missing\")\n ),\n \n PlatformType.Gemini => new GeminiClient(\n model.Name, \n Environment.GetEnvironmentVariable(\"GEMINI_API_KEY\") ?? throw new Exception(\"GEMINI_API_KEY is missing\")\n ),\n \n _ => throw new ArgumentException($\"Unsupported platform : {model.PlatformId}\")\n };\n }\n}"}, "ab31c7624955729100a669f81047d601d6fbfda3": {"t": 1785756762.5403543, "n": 1033, "h": "0a33b166be5db583", "c": "using AiPlayground.BusinessLogic.Enums;\nusing AiPlayground.DataAccess.Entities;\n\nnamespace AiPlayground.BusinessLogic.AiClient;\n\npublic class AiClientFactory : IAiClientFactory\n{\n public IAiClient GenerateClient(Model model)\n {\n return (PlatformType)model.PlatformId switch\n {\n PlatformType.OpenAi => new OpenAiClient(\n model.Name, \n Environment.GetEnvironmentVariable(\"OPENAI_API_KEY\") ?? throw new InvalidOperationException()),\n \n PlatformType.DeepSeek => new DeepSeekClient(\n model.Name, \n Environment.GetEnvironmentVariable(\"DEEPSEEK_API_KEY\") ?? throw new InvalidOperationException()),\n \n PlatformType.Gemini => new GeminiClient(\n model.Name, \n Environment.GetEnvironmentVariable(\"GEMINI_API_KEY\") ?? throw new InvalidOperationException()),\n \n _ => throw new ArgumentException($\"Unsupported platform : {model.PlatformId}\")\n };\n }\n}"}}}}