Files

1 line
4.2 KiB
JSON

{"repo": "ayush-0117/gpt-cli-tool", "files": {"src/main/java/com/gptcli/Config.java": {"d56846f8d4146d722341f7279294c452b9b42863": {"t": 1785745659.0983865, "n": 1884, "h": "a094628e84481bcd", "c": "package com.gptcli;\n\nimport io.github.cdimascio.dotenv.Dotenv;\n\npublic class Config {\n private static final Dotenv dotenv = Dotenv.configure().ignoreIfMissing().load();\n\n public static String get(String key) {\n String value = System.getenv(key);\n if (value != null && !value.isEmpty()) {\n return value;\n }\n return dotenv.get(key);\n }\n\n public static String get(String key, String defaultValue) {\n // Check system env first (consistent with the single-arg get())\n String value = System.getenv(key);\n if (value != null && !value.isEmpty()) {\n return value;\n }\n return dotenv.get(key, defaultValue);\n }\n\n public static String getOpenAiApiKey() {\n return get(\"OPENAI_API_KEY\");\n }\n\n public static String getGeminiApiKey() {\n return get(\"GEMINI_API_KEY\");\n }\n\n public static String getGrokApiKey() {\n return get(\"GROK_API_KEY\");\n }\n\n public static String getDeepSeekApiKey() {\n return get(\"DEEPSEEK_API_KEY\");\n }\n\n public static String getActiveProvider() {\n return get(\"ACTIVE_PROVIDER\") != null ? get(\"ACTIVE_PROVIDER\") : \"gemini\";\n }\n\n public static String getMongoUri() {\n return get(\"MONGO_URI\", \"mongodb://localhost:27017\");\n }\n\n public static String getModel() {\n String configuredModel = get(\"MODEL\");\n if (configuredModel != null && !configuredModel.isEmpty()) {\n return configuredModel;\n }\n \n // Smart defaults based on provider\n String provider = getActiveProvider();\n return com.gptcli.service.ModelService.getBestModel(provider);\n }\n\n public static String getGoogleSearchApiKey() {\n return get(\"GOOGLE_SEARCH_API_KEY\");\n }\n\n public static String getGoogleSearchCx() {\n return get(\"GOOGLE_SEARCH_CX\");\n }\n}\n"}, "b96a0cb4eb7954db0b6fd925beff9f6694fc8176": {"t": 1785755491.4162924, "n": 1884, "h": "a094628e84481bcd", "c": "package com.gptcli;\n\nimport io.github.cdimascio.dotenv.Dotenv;\n\npublic class Config {\n private static final Dotenv dotenv = Dotenv.configure().ignoreIfMissing().load();\n\n public static String get(String key) {\n String value = System.getenv(key);\n if (value != null && !value.isEmpty()) {\n return value;\n }\n return dotenv.get(key);\n }\n\n public static String get(String key, String defaultValue) {\n // Check system env first (consistent with the single-arg get())\n String value = System.getenv(key);\n if (value != null && !value.isEmpty()) {\n return value;\n }\n return dotenv.get(key, defaultValue);\n }\n\n public static String getOpenAiApiKey() {\n return get(\"OPENAI_API_KEY\");\n }\n\n public static String getGeminiApiKey() {\n return get(\"GEMINI_API_KEY\");\n }\n\n public static String getGrokApiKey() {\n return get(\"GROK_API_KEY\");\n }\n\n public static String getDeepSeekApiKey() {\n return get(\"DEEPSEEK_API_KEY\");\n }\n\n public static String getActiveProvider() {\n return get(\"ACTIVE_PROVIDER\") != null ? get(\"ACTIVE_PROVIDER\") : \"gemini\";\n }\n\n public static String getMongoUri() {\n return get(\"MONGO_URI\", \"mongodb://localhost:27017\");\n }\n\n public static String getModel() {\n String configuredModel = get(\"MODEL\");\n if (configuredModel != null && !configuredModel.isEmpty()) {\n return configuredModel;\n }\n \n // Smart defaults based on provider\n String provider = getActiveProvider();\n return com.gptcli.service.ModelService.getBestModel(provider);\n }\n\n public static String getGoogleSearchApiKey() {\n return get(\"GOOGLE_SEARCH_API_KEY\");\n }\n\n public static String getGoogleSearchCx() {\n return get(\"GOOGLE_SEARCH_CX\");\n }\n}\n"}}}}