google-cloud-db-context-engineering 0.7.0__tar.gz → 0.7.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {google_cloud_db_context_engineering-0.7.0/src/google_cloud_db_context_engineering.egg-info → google_cloud_db_context_engineering-0.7.1}/PKG-INFO +13 -1
  2. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/README.md +12 -0
  3. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/pyproject.toml +2 -2
  4. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/db_generators/alloydb.py +17 -19
  5. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/db_generators/base.py +9 -15
  6. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/db_generators/mysql.py +17 -19
  7. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/db_generators/postgres.py +17 -19
  8. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/db_generators/spanner.py +18 -18
  9. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1/src/google_cloud_db_context_engineering.egg-info}/PKG-INFO +13 -1
  10. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/LICENSE +0 -0
  11. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/setup.cfg +0 -0
  12. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/__init__.py +0 -0
  13. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/common/__init__.py +0 -0
  14. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/common/config.py +0 -0
  15. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/common/context_mutator.py +0 -0
  16. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/common/context_store_client.py +0 -0
  17. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/dataset/__init__.py +0 -0
  18. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/dataset/dataset_generator.py +0 -0
  19. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/__init__.py +0 -0
  20. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/db_generators/__init__.py +0 -0
  21. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/evaluate_generator.py +0 -0
  22. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/evaluate/result_reader.py +0 -0
  23. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/main.py +0 -0
  24. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/model/__init__.py +0 -0
  25. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google/cloud/db_context_enrichment/model/context.py +0 -0
  26. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google_cloud_db_context_engineering.egg-info/SOURCES.txt +0 -0
  27. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google_cloud_db_context_engineering.egg-info/dependency_links.txt +0 -0
  28. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google_cloud_db_context_engineering.egg-info/entry_points.txt +0 -0
  29. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google_cloud_db_context_engineering.egg-info/requires.txt +0 -0
  30. {google_cloud_db_context_engineering-0.7.0 → google_cloud_db_context_engineering-0.7.1}/src/google_cloud_db_context_engineering.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-db-context-engineering
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: A FastMCP server for generating natural language to SQL templates from database schemas.
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -95,6 +95,18 @@ You can provide business artifacts directly to the agent from local filesystems
95
95
 
96
96
  ---
97
97
 
98
+ ## Installing via a compatible Agent Plugins client
99
+
100
+ This repository ships a valid [Agent Plugins](https://github.com/agentplugins/agent-plugins-spec) (v1) plugin under [`plugin/`](plugin/), bundling both agent skills and its MCP servers. Any [Agent Plugins–compatible client](https://agent-plugins.org/compatible-clients) (VS Code, Cursor, GitHub Copilot, Kiro, and others) can install it directly using its own built-in plugin command — no extra tooling required — by pointing at this repository:
101
+
102
+ ```
103
+ https://github.com/GoogleCloudPlatform/db-context-enrichment
104
+ ```
105
+
106
+ See your agent's documentation for its exact install command.
107
+
108
+ ---
109
+
98
110
  ## How to Use
99
111
 
100
112
  Launch your agent harness (Gemini CLI, Claude Code, or Antigravity) in your workspace directory and interact in natural language:
@@ -77,6 +77,18 @@ You can provide business artifacts directly to the agent from local filesystems
77
77
 
78
78
  ---
79
79
 
80
+ ## Installing via a compatible Agent Plugins client
81
+
82
+ This repository ships a valid [Agent Plugins](https://github.com/agentplugins/agent-plugins-spec) (v1) plugin under [`plugin/`](plugin/), bundling both agent skills and its MCP servers. Any [Agent Plugins–compatible client](https://agent-plugins.org/compatible-clients) (VS Code, Cursor, GitHub Copilot, Kiro, and others) can install it directly using its own built-in plugin command — no extra tooling required — by pointing at this repository:
83
+
84
+ ```
85
+ https://github.com/GoogleCloudPlatform/db-context-enrichment
86
+ ```
87
+
88
+ See your agent's documentation for its exact install command.
89
+
90
+ ---
91
+
80
92
  ## How to Use
81
93
 
82
94
  Launch your agent harness (Gemini CLI, Claude Code, or Antigravity) in your workspace directory and interact in natural language:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "google-cloud-db-context-engineering"
3
- version = "0.7.0"
3
+ version = "0.7.1"
4
4
  description = "A FastMCP server for generating natural language to SQL templates from database schemas."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -46,7 +46,7 @@ dev = [
46
46
 
47
47
  [tool.db-context-engineering]
48
48
  toolbox_version = "1.4.0"
49
- evalbench_version = "1.9.0"
49
+ evalbench_version = "1.12.0"
50
50
 
51
51
  [tool.ruff]
52
52
  line-length = 88
@@ -1,6 +1,5 @@
1
1
  from typing import Any
2
2
 
3
- import google.cloud.geminidataanalytics_v1beta as gda
4
3
  import yaml
5
4
 
6
5
  from .base import BaseDBConfigGenerator
@@ -52,21 +51,20 @@ class AlloyDBConfigGenerator(BaseDBConfigGenerator):
52
51
  db_config, sort_keys=False, default_flow_style=False
53
52
  ).strip()
54
53
 
55
- def build_datasource_reference(
56
- self, context_set_id: str
57
- ) -> gda.DatasourceReferences:
58
- datasource_ref = gda.DatasourceReferences()
59
-
60
- datasource_ref.alloydb = gda.AlloyDbReference(
61
- database_reference=gda.AlloyDbDatabaseReference(
62
- project_id=self.project,
63
- region=self.region,
64
- cluster_id=self.cluster,
65
- instance_id=self.instance,
66
- database_id=self.database,
67
- ),
68
- agent_context_reference=gda.AgentContextReference(
69
- context_set_id=context_set_id
70
- ),
71
- )
72
- return datasource_ref
54
+ def build_datasource_reference(self, context_set_id: str) -> dict[str, Any]:
55
+ ref: dict[str, Any] = {
56
+ "alloydb": {
57
+ "database_reference": {
58
+ "project_id": self.project,
59
+ "region": self.region,
60
+ "cluster_id": self.cluster,
61
+ "instance_id": self.instance,
62
+ "database_id": self.database,
63
+ }
64
+ }
65
+ }
66
+ if context_set_id:
67
+ ref["alloydb"]["agent_context_reference"] = {
68
+ "context_set_id": context_set_id
69
+ }
70
+ return ref
@@ -1,16 +1,14 @@
1
1
  from abc import ABC, abstractmethod
2
2
  from typing import Any
3
3
 
4
- import google.cloud.geminidataanalytics_v1beta as gda
5
4
  import yaml
6
- from google.protobuf.json_format import MessageToDict
7
5
 
8
6
 
9
7
  class BaseDBConfigGenerator(ABC):
10
8
  """
11
9
  Abstract Base Class enforcing the construction contract for Evalbench database topologies.
12
10
  Each distinct DB type (Spanner, Postgres, AlloyDB, MySQL) must inherit and implement
13
- the mappings required by both the standard EvalBench framework and the GDA SDK model.
11
+ the mappings required by both the standard EvalBench framework and the GDA REST API.
14
12
  """
15
13
 
16
14
  SOURCE_TYPE = "unknown"
@@ -29,11 +27,9 @@ class BaseDBConfigGenerator(ABC):
29
27
  raise NotImplementedError("Subclasses must implement generate_db_config")
30
28
 
31
29
  @abstractmethod
32
- def build_datasource_reference(
33
- self, context_set_id: str
34
- ) -> gda.DatasourceReferences:
30
+ def build_datasource_reference(self, context_set_id: str) -> dict[str, Any]:
35
31
  """
36
- Constructs the strict Protocol Buffer DatasourceReference required by the QueryDataAPI
32
+ Constructs the REST datasource_references dictionary required by the QueryDataAPI
37
33
  context generation flow.
38
34
  """
39
35
  raise NotImplementedError(
@@ -54,23 +50,21 @@ class BaseDBConfigGenerator(ABC):
54
50
 
55
51
  def generate_model_config(self, context_set_id: str) -> str:
56
52
  """
57
- Standardized Model Builder converting the strictly typed GDA object into an EvalBench model dict.
53
+ Standardized Model Builder converting the datasource reference dict into an EvalBench model dict.
58
54
  """
59
55
  datasource_ref = self.build_datasource_reference(context_set_id)
60
56
 
61
- query_context = gda.QueryDataContext(datasource_references=datasource_ref)
62
-
63
- query_context_dict = MessageToDict(
64
- query_context._pb, preserving_proto_field_name=True
65
- )
66
-
67
57
  model_config = {
68
58
  "generator": "query_data_api",
69
59
  "project_id": self.params.get("project"),
70
60
  "location": self.params.get("region") or "global",
71
- "context": query_context_dict,
61
+ "use_rest_api": True,
62
+ "context": {"datasource_references": datasource_ref},
72
63
  }
73
64
 
65
+ if self.params.get("api_endpoint"):
66
+ model_config["api_endpoint"] = self.params.get("api_endpoint")
67
+
74
68
  return yaml.safe_dump(
75
69
  model_config, sort_keys=False, default_flow_style=False
76
70
  ).strip()
@@ -1,6 +1,5 @@
1
1
  from typing import Any
2
2
 
3
- import google.cloud.geminidataanalytics_v1beta as gda
4
3
  import yaml
5
4
 
6
5
  from .base import BaseDBConfigGenerator
@@ -49,21 +48,20 @@ class MySQLConfigGenerator(BaseDBConfigGenerator):
49
48
  db_config, sort_keys=False, default_flow_style=False
50
49
  ).strip()
51
50
 
52
- def build_datasource_reference(
53
- self, context_set_id: str
54
- ) -> gda.DatasourceReferences:
55
- datasource_ref = gda.DatasourceReferences()
56
-
57
- datasource_ref.cloud_sql_reference = gda.CloudSqlReference(
58
- database_reference=gda.CloudSqlDatabaseReference(
59
- engine=gda.CloudSqlDatabaseReference.Engine.MYSQL,
60
- project_id=self.project,
61
- region=self.region,
62
- instance_id=self.instance,
63
- database_id=self.database,
64
- ),
65
- agent_context_reference=gda.AgentContextReference(
66
- context_set_id=context_set_id
67
- ),
68
- )
69
- return datasource_ref
51
+ def build_datasource_reference(self, context_set_id: str) -> dict[str, Any]:
52
+ ref: dict[str, Any] = {
53
+ "cloud_sql_reference": {
54
+ "database_reference": {
55
+ "engine": "MYSQL",
56
+ "project_id": self.project,
57
+ "region": self.region,
58
+ "instance_id": self.instance,
59
+ "database_id": self.database,
60
+ }
61
+ }
62
+ }
63
+ if context_set_id:
64
+ ref["cloud_sql_reference"]["agent_context_reference"] = {
65
+ "context_set_id": context_set_id
66
+ }
67
+ return ref
@@ -1,6 +1,5 @@
1
1
  from typing import Any
2
2
 
3
- import google.cloud.geminidataanalytics_v1beta as gda
4
3
  import yaml
5
4
 
6
5
  from .base import BaseDBConfigGenerator
@@ -49,21 +48,20 @@ class PostgresConfigGenerator(BaseDBConfigGenerator):
49
48
  db_config, sort_keys=False, default_flow_style=False
50
49
  ).strip()
51
50
 
52
- def build_datasource_reference(
53
- self, context_set_id: str
54
- ) -> gda.DatasourceReferences:
55
- datasource_ref = gda.DatasourceReferences()
56
-
57
- datasource_ref.cloud_sql_reference = gda.CloudSqlReference(
58
- database_reference=gda.CloudSqlDatabaseReference(
59
- engine=gda.CloudSqlDatabaseReference.Engine.POSTGRESQL,
60
- project_id=self.project,
61
- region=self.region,
62
- instance_id=self.instance,
63
- database_id=self.database,
64
- ),
65
- agent_context_reference=gda.AgentContextReference(
66
- context_set_id=context_set_id
67
- ),
68
- )
69
- return datasource_ref
51
+ def build_datasource_reference(self, context_set_id: str) -> dict[str, Any]:
52
+ ref: dict[str, Any] = {
53
+ "cloud_sql_reference": {
54
+ "database_reference": {
55
+ "engine": "POSTGRESQL",
56
+ "project_id": self.project,
57
+ "region": self.region,
58
+ "instance_id": self.instance,
59
+ "database_id": self.database,
60
+ }
61
+ }
62
+ }
63
+ if context_set_id:
64
+ ref["cloud_sql_reference"]["agent_context_reference"] = {
65
+ "context_set_id": context_set_id
66
+ }
67
+ return ref
@@ -1,6 +1,5 @@
1
1
  from typing import Any
2
2
 
3
- import google.cloud.geminidataanalytics_v1beta as gda
4
3
  import yaml
5
4
 
6
5
  from .base import BaseDBConfigGenerator
@@ -43,20 +42,21 @@ class SpannerConfigGenerator(BaseDBConfigGenerator):
43
42
  db_config, sort_keys=False, default_flow_style=False
44
43
  ).strip()
45
44
 
46
- def build_datasource_reference(
47
- self, context_set_id: str
48
- ) -> gda.DatasourceReferences:
49
- datasource_ref = gda.DatasourceReferences()
50
-
51
- datasource_ref.spanner_reference = gda.SpannerReference(
52
- database_reference=gda.SpannerDatabaseReference(
53
- engine=gda.SpannerDatabaseReference.Engine.GOOGLE_SQL,
54
- project_id=self.project,
55
- instance_id=self.instance,
56
- database_id=self.database,
57
- ),
58
- agent_context_reference=gda.AgentContextReference(
59
- context_set_id=context_set_id
60
- ),
61
- )
62
- return datasource_ref
45
+ def build_datasource_reference(self, context_set_id: str) -> dict[str, Any]:
46
+ database_ref: dict[str, Any] = {
47
+ "engine": "GOOGLE_SQL",
48
+ "project_id": self.project,
49
+ "instance_id": self.instance,
50
+ "database_id": self.database,
51
+ }
52
+ if graph_ids := self.params.get("graph_ids"):
53
+ if not isinstance(graph_ids, list) or not all(
54
+ isinstance(g, str) for g in graph_ids
55
+ ):
56
+ raise ValueError("graph_ids must be a list of strings")
57
+ database_ref["graph_ids"] = graph_ids
58
+
59
+ spanner_ref: dict[str, Any] = {"database_reference": database_ref}
60
+ if context_set_id:
61
+ spanner_ref["agent_context_reference"] = {"context_set_id": context_set_id}
62
+ return {"spanner_reference": spanner_ref}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: google-cloud-db-context-engineering
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: A FastMCP server for generating natural language to SQL templates from database schemas.
5
5
  Requires-Python: >=3.12
6
6
  Description-Content-Type: text/markdown
@@ -95,6 +95,18 @@ You can provide business artifacts directly to the agent from local filesystems
95
95
 
96
96
  ---
97
97
 
98
+ ## Installing via a compatible Agent Plugins client
99
+
100
+ This repository ships a valid [Agent Plugins](https://github.com/agentplugins/agent-plugins-spec) (v1) plugin under [`plugin/`](plugin/), bundling both agent skills and its MCP servers. Any [Agent Plugins–compatible client](https://agent-plugins.org/compatible-clients) (VS Code, Cursor, GitHub Copilot, Kiro, and others) can install it directly using its own built-in plugin command — no extra tooling required — by pointing at this repository:
101
+
102
+ ```
103
+ https://github.com/GoogleCloudPlatform/db-context-enrichment
104
+ ```
105
+
106
+ See your agent's documentation for its exact install command.
107
+
108
+ ---
109
+
98
110
  ## How to Use
99
111
 
100
112
  Launch your agent harness (Gemini CLI, Claude Code, or Antigravity) in your workspace directory and interact in natural language: