feat: add multi-project semantic layer tools#660
Draft
DevonFulcher wants to merge 8 commits intodf/multiproject-phase1-corefrom
Draft
feat: add multi-project semantic layer tools#660DevonFulcher wants to merge 8 commits intodf/multiproject-phase1-corefrom
DevonFulcher wants to merge 8 commits intodf/multiproject-phase1-corefrom
Conversation
3a4bf94 to
70b2a82
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove get_config_for_project() from all config providers. Each multiproject semantic layer tool now calls _resolve_sl_config_for_project() which fetches credentials, builds the platform URL/headers, calls get_environments_for_project() directly, and returns the config via DefaultSemanticLayerConfigProvider._build_config(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add multi_project_only_toolsets set to toolsets.py and update generate_docs.py to skip those toolsets when generating README and diagram documentation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
diagram.d2 is already correct (multi-project toolset excluded). Restoring d2.png to match the unchanged diagram source. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5439df1 to
1fe558d
Compare
…ools Multi-project server cannot run alongside single-project server, so tools share the same names (list_metrics, not list_metrics_for_project) and are controlled by the same env vars (DISABLE_SEMANTIC_LAYER). Remove MULTI_PROJECT_SEMANTIC_LAYER toolset, multi_project_only_toolsets, and multi_project_tools variables. Remove disable/enable_multi_project_semantic_layer settings fields. Remove multi_project_only_toolsets filtering from generate_docs.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Why
To support multi-project scenarios where an AI assistant needs to query metrics across different dbt projects, we need semantic layer tools that accept a
project_idparameter to dynamically resolve the correct environment configuration.What
Adds 6 multi-project semantic layer tools that mirror the existing single-project tools but accept
project_idas a required first parameter:list_metrics_for_projectlist_saved_queries_for_projectget_dimensions_for_projectget_entities_for_projectquery_metrics_for_projectget_metrics_compiled_sql_for_projectEach tool resolves the project's production environment via
get_config_for_project()(from Phase 1) and passes the resulting config as aconfig_overrideto the existingSemanticLayerFetchermethods.Key changes:
client.py: Addedconfig_overrideparameter to allSemanticLayerFetchermethods and a_resolve_client()helper for SDK-based operationstools_multiproject.py: New file with the 6 multi-project tool definitions and registration functiontool_names.py/toolsets.py: NewToolNameentries andMULTI_PROJECT_SEMANTIC_LAYERtoolsetconfig.py/settings.py: Enable/disable configuration for the new toolset (disabled by default)Notes
Drafted by Claude Opus 4.6 under the direction of @DevonFulcher