get the IQEngine configuration
()
| 13 | |
| 14 | @router.get("/api/config", status_code=200, response_model=Configuration) |
| 15 | async def get_config(): |
| 16 | """ |
| 17 | get the IQEngine configuration |
| 18 | """ |
| 19 | configuration: Configuration | None = await get() |
| 20 | |
| 21 | if configuration is None: |
| 22 | configuration = Configuration() |
| 23 | |
| 24 | connection_info = os.getenv("IQENGINE_CONNECTION_INFO", None) |
| 25 | |
| 26 | if connection_info: |
| 27 | configuration.connection_info = json.loads(connection_info) |
| 28 | |
| 29 | configuration.google_analytics_key = os.getenv( |
| 30 | "IQENGINE_GOOGLE_ANALYTICS_KEY", configuration.google_analytics_key |
| 31 | ) |
| 32 | configuration.UPLOAD_PAGE_BLOB_SAS_URL = os.getenv( |
| 33 | "IQENGINE_UPLOAD_PAGE_BLOB_SAS_URL", configuration.UPLOAD_PAGE_BLOB_SAS_URL |
| 34 | ) |
| 35 | configuration.internal_branding = os.getenv( |
| 36 | "IQENGINE_INTERNAL_BRANDING", configuration.internal_branding |
| 37 | ) |
| 38 | configuration.app_id = os.getenv("IQENGINE_APP_ID", configuration.app_id) |
| 39 | configuration.app_authority = os.getenv( |
| 40 | "IQENGINE_APP_AUTHORITY", configuration.app_authority |
| 41 | ) |
| 42 | |
| 43 | configuration.has_ai_query = aiquery.is_open_ai_available() |
| 44 | |
| 45 | return configuration |
| 46 | |
| 47 | |
| 48 | @router.put("/api/config", status_code=200) |
nothing calls this directly
no test coverage detected