Skip to content

Commit b2d75bf

Browse files
committed
feat: 기본 url제거 -> 반드시 환경변수 지정 강제
1 parent dfc5472 commit b2d75bf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ProjectVG.Infrastructure/InfrastructureServiceCollectionExtensions.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ private static void AddDatabaseServices(IServiceCollection services, IConfigurat
6565
/// </summary>
6666
private static void AddExternalApiClients(IServiceCollection services, IConfiguration configuration)
6767
{
68-
var llmBaseUrl = configuration.GetValue<string>("LLM:BaseUrl") ?? Environment.GetEnvironmentVariable("LLM_BASE_URL") ?? "http://localhost:5601";
69-
var memoryBaseUrl = configuration.GetValue<string>("MEMORY:BaseUrl") ?? Environment.GetEnvironmentVariable("MEMORY_BASE_URL") ?? "http://localhost:5602";
68+
var llmBaseUrl = configuration.GetValue<string>("LLM:BaseUrl") ?? Environment.GetEnvironmentVariable("LLM_BASE_URL")
69+
?? throw new InvalidOperationException("LLM_BASE_URL environment variable or LLM:BaseUrl configuration is required");
70+
var memoryBaseUrl = configuration.GetValue<string>("MEMORY:BaseUrl") ?? Environment.GetEnvironmentVariable("MEMORY_BASE_URL")
71+
?? throw new InvalidOperationException("MEMORY_BASE_URL environment variable or MEMORY:BaseUrl configuration is required");
7072

7173
services.AddHttpClient<ILLMClient, LLMClient>(client => {
7274
client.BaseAddress = new Uri(llmBaseUrl);
@@ -76,7 +78,8 @@ private static void AddExternalApiClients(IServiceCollection services, IConfigur
7678
client.BaseAddress = new Uri(memoryBaseUrl);
7779
});
7880

79-
var ttsBaseUrl = configuration.GetValue<string>("TTS:BaseUrl") ?? Environment.GetEnvironmentVariable("TTS_BASE_URL") ?? "https://supertoneapi.com";
81+
var ttsBaseUrl = configuration.GetValue<string>("TTS:BaseUrl") ?? Environment.GetEnvironmentVariable("TTS_BASE_URL")
82+
?? throw new InvalidOperationException("TTS_BASE_URL environment variable or TTS:BaseUrl configuration is required");
8083

8184
services.AddHttpClient<ITextToSpeechClient, TextToSpeechClient>((sp, client) => {
8285
client.BaseAddress = new Uri(ttsBaseUrl);

0 commit comments

Comments
 (0)