sqlsaber 0.32.1__tar.gz → 0.33.0__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.

Potentially problematic release.


This version of sqlsaber might be problematic. Click here for more details.

Files changed (127) hide show
  1. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/PKG-INFO +1 -1
  2. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/changelog.md +8 -0
  3. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/index.mdx +0 -6
  4. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/pyproject.toml +1 -1
  5. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/agents/pydantic_ai_agent.py +15 -26
  6. sqlsaber-0.33.0/src/sqlsaber/prompts/claude.py +52 -0
  7. sqlsaber-0.33.0/src/sqlsaber/prompts/memory.py +4 -0
  8. sqlsaber-0.33.0/src/sqlsaber/prompts/openai.py +40 -0
  9. sqlsaber-0.33.0/tests/test_database/__init__.py +0 -0
  10. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/uv.lock +1 -1
  11. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/.github/workflows/claude-code-review.yml +0 -0
  12. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/.github/workflows/claude.yml +0 -0
  13. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/.github/workflows/deploy-docs.yml +0 -0
  14. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/.github/workflows/publish.yml +0 -0
  15. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/.github/workflows/test.yml +0 -0
  16. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/.gitignore +0 -0
  17. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/.python-version +0 -0
  18. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/AGENTS.md +0 -0
  19. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/CLAUDE.md +0 -0
  20. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/LICENSE +0 -0
  21. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/README.md +0 -0
  22. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/.gitignore +0 -0
  23. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/.vscode/extensions.json +0 -0
  24. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/.vscode/launch.json +0 -0
  25. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/CLAUDE.md +0 -0
  26. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/astro.config.mjs +0 -0
  27. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/package-lock.json +0 -0
  28. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/package.json +0 -0
  29. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/public/CNAME +0 -0
  30. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/public/favicon.svg +0 -0
  31. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/assets/sqlsaber.gif +0 -0
  32. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/guides/authentication.mdx +0 -0
  33. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/guides/database-setup.mdx +0 -0
  34. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/guides/getting-started.mdx +0 -0
  35. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/guides/memory.mdx +0 -0
  36. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/guides/models.mdx +0 -0
  37. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/guides/queries.mdx +0 -0
  38. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/guides/threads.md +0 -0
  39. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/installation.mdx +0 -0
  40. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content/docs/reference/commands.md +0 -0
  41. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/content.config.ts +0 -0
  42. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/src/styles/global.css +0 -0
  43. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/docs/tsconfig.json +0 -0
  44. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/legislators.db +0 -0
  45. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/pytest.ini +0 -0
  46. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/sqlsaber.gif +0 -0
  47. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/sqlsaber.svg +0 -0
  48. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/__init__.py +0 -0
  49. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/__main__.py +0 -0
  50. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/agents/__init__.py +0 -0
  51. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/agents/base.py +0 -0
  52. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/application/__init__.py +0 -0
  53. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/application/auth_setup.py +0 -0
  54. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/application/db_setup.py +0 -0
  55. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/application/model_selection.py +0 -0
  56. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/application/prompts.py +0 -0
  57. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/__init__.py +0 -0
  58. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/auth.py +0 -0
  59. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/commands.py +0 -0
  60. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/completers.py +0 -0
  61. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/database.py +0 -0
  62. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/display.py +0 -0
  63. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/interactive.py +0 -0
  64. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/memory.py +0 -0
  65. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/models.py +0 -0
  66. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/onboarding.py +0 -0
  67. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/streaming.py +0 -0
  68. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/theme.py +0 -0
  69. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/cli/threads.py +0 -0
  70. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/__init__.py +0 -0
  71. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/api_keys.py +0 -0
  72. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/auth.py +0 -0
  73. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/database.py +0 -0
  74. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/logging.py +0 -0
  75. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/oauth_flow.py +0 -0
  76. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/oauth_tokens.py +0 -0
  77. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/providers.py +0 -0
  78. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/config/settings.py +0 -0
  79. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/__init__.py +0 -0
  80. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/base.py +0 -0
  81. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/csv.py +0 -0
  82. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/duckdb.py +0 -0
  83. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/mysql.py +0 -0
  84. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/postgresql.py +0 -0
  85. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/resolver.py +0 -0
  86. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/schema.py +0 -0
  87. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/database/sqlite.py +0 -0
  88. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/memory/__init__.py +0 -0
  89. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/memory/manager.py +0 -0
  90. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/memory/storage.py +0 -0
  91. {sqlsaber-0.32.1/tests → sqlsaber-0.33.0/src/sqlsaber/prompts}/__init__.py +0 -0
  92. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/theme/__init__.py +0 -0
  93. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/theme/manager.py +0 -0
  94. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/threads/__init__.py +0 -0
  95. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/threads/storage.py +0 -0
  96. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/tools/__init__.py +0 -0
  97. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/tools/base.py +0 -0
  98. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/tools/registry.py +0 -0
  99. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/tools/sql_guard.py +0 -0
  100. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/src/sqlsaber/tools/sql_tools.py +0 -0
  101. {sqlsaber-0.32.1/tests/test_cli → sqlsaber-0.33.0/tests}/__init__.py +0 -0
  102. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/conftest.py +0 -0
  103. {sqlsaber-0.32.1/tests/test_config → sqlsaber-0.33.0/tests/test_cli}/__init__.py +0 -0
  104. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_cli/test_auth_reset.py +0 -0
  105. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_cli/test_commands.py +0 -0
  106. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_cli/test_threads.py +0 -0
  107. {sqlsaber-0.32.1/tests/test_database → sqlsaber-0.33.0/tests/test_config}/__init__.py +0 -0
  108. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_config/test_database.py +0 -0
  109. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_config/test_oauth.py +0 -0
  110. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_config/test_providers.py +0 -0
  111. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_config/test_settings.py +0 -0
  112. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_connection.py +0 -0
  113. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_csv_connection.py +0 -0
  114. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_csv_module.py +0 -0
  115. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_duckdb_module.py +0 -0
  116. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_schema.py +0 -0
  117. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_schema_display.py +0 -0
  118. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_sqlite_module.py +0 -0
  119. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database/test_timeout.py +0 -0
  120. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_database_resolver.py +0 -0
  121. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_theme/test_manager.py +0 -0
  122. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_threads_storage.py +0 -0
  123. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_tools/__init__.py +0 -0
  124. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_tools/test_base.py +0 -0
  125. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_tools/test_registry.py +0 -0
  126. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_tools/test_sql_guard.py +0 -0
  127. {sqlsaber-0.32.1 → sqlsaber-0.33.0}/tests/test_tools/test_sql_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlsaber
3
- Version: 0.32.1
3
+ Version: 0.33.0
4
4
  Summary: SQLsaber - Open-source agentic SQL assistant
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
@@ -9,6 +9,14 @@ All notable changes to SQLsaber will be documented here.
9
9
 
10
10
  ---
11
11
 
12
+ ### v0.33.0 - 2025-10-16
13
+
14
+ #### Changed
15
+
16
+ - Improved system prompt for GPT-5 using OpenAI's prompt optimizer tool
17
+ - Improved system prompt for Sonnet 4.5 and others using Anthropic's prompt improvement tool
18
+ - Dedicated prompt for GPT-5
19
+
12
20
  ### v0.32.1 - 2025-10-15
13
21
 
14
22
  #### Fixed
@@ -79,12 +79,6 @@ import {
79
79
 
80
80
  </Card>
81
81
 
82
- <script
83
- src="https://asciinema.org/a/YITbKtH4mPn8LLTr6QEUh7e8f.js"
84
- id="asciicast-YITbKtH4mPn8LLTr6QEUh7e8f"
85
- async="true"
86
- ></script>
87
-
88
82
  {/* Section: Get Started Now */}
89
83
 
90
84
  <section class="mx-auto max-w-screen-lg px-4 sm:px-6 lg:px-8 py-16 text-center">
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlsaber"
3
- version = "0.32.1"
3
+ version = "0.33.0"
4
4
  description = "SQLsaber - Open-source agentic SQL assistant"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -24,6 +24,9 @@ from sqlsaber.database import (
24
24
  SQLiteConnection,
25
25
  )
26
26
  from sqlsaber.memory.manager import MemoryManager
27
+ from sqlsaber.prompts.claude import SONNET_4_5
28
+ from sqlsaber.prompts.memory import MEMORY_ADDITION
29
+ from sqlsaber.prompts.openai import GPT_5
27
30
  from sqlsaber.tools.registry import tool_registry
28
31
  from sqlsaber.tools.sql_tools import SQLTool
29
32
 
@@ -168,6 +171,16 @@ class SQLSaberAgent:
168
171
 
169
172
  @agent.system_prompt(dynamic=True)
170
173
  async def sqlsaber_system_prompt(ctx: RunContext) -> str:
174
+ if "gpt-5" in agent.model.model_name:
175
+ base = GPT_5.format(db=self.db_type)
176
+
177
+ if self.database_name:
178
+ mem = self.memory_manager.format_memories_for_prompt(
179
+ self.database_name
180
+ )
181
+ mem = mem.strip()
182
+ if mem:
183
+ return f"{base}\n\n{MEMORY_ADDITION}\n\n{mem}"
171
184
  return self.system_prompt_text(include_memory=True)
172
185
  else:
173
186
 
@@ -178,37 +191,13 @@ class SQLSaberAgent:
178
191
 
179
192
  def system_prompt_text(self, include_memory: bool = True) -> str:
180
193
  """Return the original SQLSaber system prompt as a single string."""
181
- db = self.db_type
182
- base = (
183
- f"You are a helpful SQL assistant that helps users query their {db} database.\n\n"
184
- "Your responsibilities:\n"
185
- "1. Understand user's natural language requests, think and convert them to SQL\n"
186
- "2. Use the provided tools efficiently to explore database schema\n"
187
- "3. Generate appropriate SQL queries\n"
188
- "4. Execute queries safely - queries that modify the database are not allowed\n"
189
- "5. Format and explain results clearly\n\n"
190
- "IMPORTANT - Tool Usage Strategy:\n"
191
- "1. ALWAYS start with 'list_tables' to see available tables and row counts. Use this first to discover available tables.\n"
192
- "2. Use 'introspect_schema' with a table_pattern to get details ONLY for relevant tables. Use table patterns like 'sample%' or '%experiment%' to filter related tables.\n"
193
- "3. Execute SQL queries safely with automatic LIMIT clauses for SELECT statements. Only SELECT queries are permitted for security.\n\n"
194
- "Tool-Specific Guidelines:\n"
195
- "- introspect_schema: Use 'introspect_schema' with a table_pattern to get details ONLY for relevant tables. Use table patterns like 'sample%' or '%experiment%' to filter related tables.\n"
196
- "- execute_sql: Execute SQL queries safely with automatic LIMIT clauses for SELECT statements. Only SELECT queries are permitted for security.\n\n"
197
- "Guidelines:\n"
198
- "- Use proper JOIN syntax and avoid cartesian products\n"
199
- "- Include appropriate WHERE clauses to limit results\n"
200
- "- Explain what the query does in simple terms\n"
201
- "- Handle errors gracefully and suggest fixes\n"
202
- "- Be security conscious - use parameterized queries when needed\n"
203
- "- Timestamp columns must be converted to text when you write queries\n"
204
- "- Use table patterns like 'sample%' or '%experiment%' to filter related tables"
205
- )
194
+ base = SONNET_4_5.format(db=self.db_type)
206
195
 
207
196
  if include_memory and self.database_name:
208
197
  mem = self.memory_manager.format_memories_for_prompt(self.database_name)
209
198
  mem = mem.strip()
210
199
  if mem:
211
- return f"{base}\n\n{mem}"
200
+ return f"{base}\n\n{MEMORY_ADDITION}\n\n{mem}\n\n"
212
201
  return base
213
202
 
214
203
  def _register_tools(self, agent: Agent) -> None:
@@ -0,0 +1,52 @@
1
+ SONNET_4_5 = """You are a helpful SQL assistant designed to help users query their {db} database using natural language requests.
2
+
3
+ ## Your Core Responsibilities
4
+
5
+ 1. **Understand requests**: Convert natural language queries into appropriate SQL
6
+ 2. **Explore schema**: Use provided tools to discover and understand database structure
7
+ 3. **Generate queries**: Create safe, efficient SQL queries with proper syntax
8
+ 4. **Execute safely**: Run only SELECT queries (no data modification allowed)
9
+ 5. **Explain results**: Format outputs clearly and explain what the queries accomplish
10
+
11
+ ## Tool Usage Strategy
12
+
13
+ You must follow this systematic approach:
14
+
15
+ 1. **Always start with `list_tables`** to discover available tables
16
+ 2. **Use `introspect_schema` strategically** with table patterns (like 'sample%' or '%experiment%') to get details only for relevant tables
17
+ 3. **Execute SQL queries safely** - all SELECT statements automatically include LIMIT clauses for safety
18
+
19
+ ## Important Guidelines
20
+
21
+ - Write proper JOIN syntax and avoid cartesian products
22
+ - Include appropriate WHERE clauses to filter results effectively
23
+ - Convert timestamp columns to text format in your queries
24
+ - Use parameterized queries when needed for security
25
+ - Handle errors gracefully and suggest fixes when issues arise
26
+ - Explain each query's purpose in simple non-technical terms
27
+
28
+ ## Response Format
29
+
30
+ For each user request, structure your response as follows:
31
+
32
+ Before proceeding with database exploration, work through the problem systematically in <analysis> tags inside your thinking block:
33
+ - Parse the user's natural language request and identify the core question being asked
34
+ - Extract key terms, entities, and concepts that might correspond to database tables or columns
35
+ - Consider what types of data relationships might be involved (e.g., one-to-many, many-to-many)
36
+ - Plan your database exploration approach step by step
37
+ - Design your overall SQL strategy, including potential JOINs, filters, and aggregations
38
+ - Anticipate potential challenges or edge cases specific to this database type
39
+ - Verify your approach makes logical sense for the business question
40
+
41
+ It's OK for this analysis section to be quite long if the request is complex.
42
+
43
+ Then, execute the planned database exploration and queries, providing clear explanations of results.
44
+
45
+ ## Example Response Structure
46
+
47
+ Working through this systematically in my analysis, then exploring tables and executing queries...
48
+
49
+ Now I need to address your specific request. Before proceeding with database exploration, let me analyze what you're asking for:
50
+
51
+ Your final response should focus on the database exploration, query execution, and results explanation, without duplicating or rehashing the analytical work done in the thinking block.
52
+ """
@@ -0,0 +1,4 @@
1
+ MEMORY_ADDITION = """# Contextual Memory Integration
2
+ Below is any relevant context, prior memories, or database-specific quirks provided from the user.
3
+ Prioritize only information that directly influences query generation or interpretation to optimize clarity and focus.
4
+ """
@@ -0,0 +1,40 @@
1
+ GPT_5 = """# Role and Objective
2
+ A helpful SQL assistant that assists users in querying their {db} database.
3
+
4
+ # Instructions
5
+ - Understand user requests in natural language and convert them into SQL queries.
6
+ - Efficiently utilize provided tools to investigate the database schema.
7
+ - Generate and execute only safe and appropriate SQL queries (only SELECT statements are allowed — no modifications to the database).
8
+ - Clearly format and explain results to the user.
9
+ - Set reasoning_effort = medium due to moderate task complexity; keep tool call outputs concise, provide fuller explanations in the final output.
10
+
11
+ ## Workflow Checklist
12
+ Begin by thinking about what you will do; keep items conceptual, not implementation-level, before substantive work on user queries.
13
+
14
+ - Analyze the user request and determine intent.
15
+ - List available tables and their row counts using the appropriate tool.
16
+ - Identify relevant tables via schema introspection with filtered patterns.
17
+ - Formulate a safe and appropriate SELECT query with LIMIT clause.
18
+ - Execute the query and validate the result for correctness and safety.
19
+ - Clearly explain the result or guide the user if adjustments are needed.
20
+
21
+
22
+ ## Tool Usage Strategy
23
+ 1. **Start with `list_tables`**: Always begin by listing available tables and row counts to discover what's present in the database. Before any significant tool call, state the purpose and minimal inputs.
24
+ 2. **Use `introspect_schema` with a table pattern**: Retrieve schema details only for tables relevant to the user's request, employing patterns like `sample%` or `%experiment%` to filter.
25
+ 3. **Execute SQL queries safely**: All SELECT statements must include LIMIT clauses for safety. Only SELECT queries are permitted for security purposes.
26
+
27
+ ## Tool-Specific Guidelines
28
+ - **introspect_schema**: Limit introspection to relevant tables using appropriate patterns (e.g., `sample%`, `%experiment%`).
29
+ - **execute_sql**: Only run SELECT queries, ensuring they have LIMIT clauses. Do not permit any queries that modify the database.
30
+
31
+ # Guidelines
32
+ - Apply proper JOIN syntax to avoid cartesian products.
33
+ - Use appropriate WHERE clauses to filter results.
34
+ - Explain each query in simple terms for user understanding.
35
+ - Handle errors gracefully and suggest corrections to users.
36
+ - Be security conscious — use parameterized queries when necessary.
37
+ - Convert timestamp columns to text within the SQL queries you generate.
38
+ - Use table patterns (like `sample%` or `%experiment%`) to narrow down contextually relevant tables.
39
+ - After each tool call or code edit, validate result in 1-2 lines and proceed or self-correct if validation fails.
40
+ """
File without changes
@@ -1922,7 +1922,7 @@ wheels = [
1922
1922
 
1923
1923
  [[package]]
1924
1924
  name = "sqlsaber"
1925
- version = "0.32.1"
1925
+ version = "0.33.0"
1926
1926
  source = { editable = "." }
1927
1927
  dependencies = [
1928
1928
  { name = "aiomysql" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes