Set default API base to apis-imp.cogsol.ai#9
Merged
luciabouza merged 7 commits intomainfrom Feb 20, 2026
Merged
Conversation
Provide default COGSOL_API_BASE and COGSOL_CONTENT_API_BASE values across the project and update docs/.env examples to use https://apis-imp.cogsol.ai. Code changes add fallbacks for the API and Content API base URLs in core client, agents, content, and management commands (chat, importagent, ingest, migrate, startproject, topics) so the app won't fail when env vars are missing. README and documentation examples were updated accordingly, and typing-extensions was added to pyproject.toml dependencies.
Reformat long environment variable and default URL assignments into multi-line, parenthesized expressions across multiple modules (cogsol/agents, cogsol/content, cogsol/core/api.py, and management commands: importagent, ingest, migrate, topics) to improve readability and line-length compliance. These changes are stylistic only and do not alter runtime behavior.
Import os at module level and read COGSOL_API_BASE and COGSOL_CONTENT_API_BASE via os.environ.get with provided fallback URLs, instead of calling self._env for those values. Keep api_key retrieval via _env. Remove the redundant import inside the _env helper. This provides sensible defaults for running migrations when those env vars are not set.
nsuruguay05
reviewed
Feb 18, 2026
Contributor
nsuruguay05
left a comment
There was a problem hiding this comment.
Great. A couple of suggestions:
- Maybe add a
constants.pyfile that contains the two URLs as constants, and use those constants everywhere instead of hardcoding the URLs directly (since they’re repeated a lot, and it’ll be easier to change them if we ever need to). - In the file
management/commands/startproject.py(line 198), the.env.examplefor the scaffolding is created withlocalhostinCOGSOL_API_BASEandCOGSOL_CONTENT_API_BASE. I’d remove those two directly from the.env.example, since most people will use the default ones anyway (maybe I’d do the same in the documentation: remove them from the example.envfiles).
Add cogsol/core/constants.py to centralize resolving CogSol API base URLs (cognitive and content) and environment handling (COGSOL_ENV). Replace scattered hardcoded default URLs with helper functions (get_cognitive_api_base_url, get_content_api_base_url) across client, agents, content, and management commands. Update startproject .env.example and docs to remove embedded default base URLs and simplify configuration examples. Also remove several ad-hoc settings/import fallbacks in CLI commands in favor of the unified environment-based resolution.
nsuruguay05
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Brief description of changes.
Type of Change
Related Issues
Fixes #6
Changes Made
Provide default COGSOL_API_BASE and COGSOL_CONTENT_API_BASE values across the project and update docs/.env examples to use https://apis-imp.cogsol.ai. Code changes add fallbacks for the API and Content API base URLs in core client, agents, content, and management commands (chat, importagent, ingest, migrate, startproject, topics) so the app won't fail when env vars are missing. README and documentation examples were updated accordingly, and typing-extensions was added to pyproject.toml dependencies.
Testing Done
Checklist