tinybird 0.0.1.dev277__tar.gz → 0.0.1.dev278__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 tinybird might be problematic. Click here for more details.
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/agent.py +7 -4
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/command_agent.py +6 -2
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/prompts.py +68 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/run_command.py +2 -2
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datasource.py +2 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/setup.cfg +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/datafile/common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/client.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/config.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/__init__.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/animations.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/banner.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/compactor.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/explore_agent.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/memory.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/models.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/testing_agent.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/append.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/build.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/datafile.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/mock.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/plan.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/secret.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/test.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/utils.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/deployment_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/dev_server.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/info.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/llm.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/mock_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/forward/commands'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev278'
|
|
8
|
+
__revision__ = '422553e'
|
|
@@ -95,7 +95,7 @@ class TinybirdAgent:
|
|
|
95
95
|
self.agent = Agent(
|
|
96
96
|
model=create_model(user_token, host, workspace_id),
|
|
97
97
|
deps_type=TinybirdAgentContext,
|
|
98
|
-
|
|
98
|
+
instructions=[agent_system_prompt],
|
|
99
99
|
tools=[
|
|
100
100
|
Tool(create_datafile, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
|
|
101
101
|
Tool(remove_file, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
|
|
@@ -193,7 +193,7 @@ class TinybirdAgent:
|
|
|
193
193
|
str: The result of the command.
|
|
194
194
|
"""
|
|
195
195
|
result = self.command_agent.run(task, deps=ctx.deps, usage=ctx.usage)
|
|
196
|
-
return result.output
|
|
196
|
+
return f"Result: {result.output}\nDo not repeat in your response the result again, because it is already displayed in the terminal."
|
|
197
197
|
|
|
198
198
|
@self.agent.tool
|
|
199
199
|
def explore_data(ctx: RunContext[TinybirdAgentContext], task: str) -> str:
|
|
@@ -740,7 +740,7 @@ def is_natural_language(user_input: str, user_token: str, host: str) -> bool:
|
|
|
740
740
|
|
|
741
741
|
prompt = """Analyze the following text and determine if it's natural language or a SQL query.
|
|
742
742
|
|
|
743
|
-
Respond with only "NATURAL" if it's natural language (like a question, request, or conversational text), or "SQL" if it's a SQL query
|
|
743
|
+
Respond with only "NATURAL" if it's natural language (like a question, request, or conversational text), or "SQL" if it's a SQL query starting with SELECT or WITH statements.
|
|
744
744
|
|
|
745
745
|
Examples:
|
|
746
746
|
- "show me all users" -> NATURAL
|
|
@@ -748,8 +748,11 @@ Examples:
|
|
|
748
748
|
- "SELECT * FROM users" -> SQL
|
|
749
749
|
- "WITH cte AS (SELECT...) SELECT..." -> SQL
|
|
750
750
|
- "select count(*) from orders" -> SQL
|
|
751
|
-
- "help me analyze the data" -> NATURAL
|
|
751
|
+
- "help me analyze the data" -> NATURAL
|
|
752
|
+
- "select some page hits from analytics_events that happened yesterday" -> NATURAL
|
|
752
753
|
|
|
754
|
+
IMPORTANT: If you're not sure, default to NATURAL.
|
|
755
|
+
"""
|
|
753
756
|
try:
|
|
754
757
|
thinking_animation = ThinkingAnimation()
|
|
755
758
|
thinking_animation.start()
|
|
@@ -4,7 +4,7 @@ from pydantic_ai.usage import Usage
|
|
|
4
4
|
|
|
5
5
|
from tinybird.tb.modules.agent.animations import ThinkingAnimation
|
|
6
6
|
from tinybird.tb.modules.agent.models import create_model
|
|
7
|
-
from tinybird.tb.modules.agent.prompts import tests_files_prompt
|
|
7
|
+
from tinybird.tb.modules.agent.prompts import available_commands, tests_files_prompt
|
|
8
8
|
from tinybird.tb.modules.agent.tools.run_command import run_command
|
|
9
9
|
from tinybird.tb.modules.agent.utils import TinybirdAgentContext
|
|
10
10
|
from tinybird.tb.modules.project import Project
|
|
@@ -34,13 +34,17 @@ class CommandAgent:
|
|
|
34
34
|
model=create_model(user_token, host, workspace_id),
|
|
35
35
|
deps_type=TinybirdAgentContext,
|
|
36
36
|
instructions=[
|
|
37
|
-
"""
|
|
37
|
+
f"""
|
|
38
38
|
You are part of Tinybird Code, an agentic CLI that can help users to work with Tinybird.
|
|
39
39
|
You are a sub-agent of the main Tinybird Code agent. You are responsible for running commands on the user's machine.
|
|
40
40
|
You will be given a task to perform and you will use `run_command` tool to complete it.
|
|
41
41
|
If you do not find a command that can solve the task, just say that there is no command that can solve the task.
|
|
42
42
|
You can run `-h` in every level of the command to get help. E.g. `tb -h`, `tb datasource -h`, `tb datasource ls -h`.
|
|
43
43
|
When you need to access Tinybird Cloud, add the `--cloud` flag. E.g. `tb --cloud datasource ls`.
|
|
44
|
+
Available commands:
|
|
45
|
+
{available_commands}
|
|
46
|
+
IMPORTANT: Do NOT use any command that is not in the list above.
|
|
47
|
+
IMPORTANT: If you don't have the proper command to solve the task, just answer that you cannot solve the task.
|
|
44
48
|
Token and host are not required to add to the commands.
|
|
45
49
|
Always run first help commands to be sure that the commands you are running is not interactive.
|
|
46
50
|
""",
|
|
@@ -15,6 +15,28 @@ from tinybird.prompts import (
|
|
|
15
15
|
)
|
|
16
16
|
from tinybird.tb.modules.project import Project
|
|
17
17
|
|
|
18
|
+
available_commands = [
|
|
19
|
+
"`tb connection ls`: List all connections",
|
|
20
|
+
"`tb copy ls`: List all copy pipes",
|
|
21
|
+
"`tb copy run [pipe_name] --mode [mode] --param [param]`: Run a copy pipe",
|
|
22
|
+
"`tb datasource ls`: List all datasources",
|
|
23
|
+
"`tb datasource sync [datasource_name] --yes`: Sync a datasource with an s3 or gcs connection",
|
|
24
|
+
"`tb datasource truncate [datasource_name] --yes`: Truncate a datasource",
|
|
25
|
+
"`tb endpoint ls`: List all endpoints",
|
|
26
|
+
"`tb open`: Open the dashboard in the browser",
|
|
27
|
+
"`tb info`: Show information about the project",
|
|
28
|
+
"`tb job ls`: List all jobs",
|
|
29
|
+
"`tb job cancel [job_id]`: Cancel a job",
|
|
30
|
+
"`tb deployment ls`: List all deployments (if user does not specify use tb --cloud)",
|
|
31
|
+
"`tb deployment discard`: Discard a deployment (if user does not specify use tb --cloud)",
|
|
32
|
+
"`tb token ls`: List all tokens",
|
|
33
|
+
"`tb materialization ls`: List all materializations",
|
|
34
|
+
"`tb pipe ls`: List all pipes",
|
|
35
|
+
"`tb sink ls`: List all sinks",
|
|
36
|
+
"`tb workspace current`: Show the current workspace",
|
|
37
|
+
"`tb workspace clear --yes`: Delete all resources in the workspace (Only available in Tinybird Local)",
|
|
38
|
+
]
|
|
39
|
+
|
|
18
40
|
plan_instructions = """
|
|
19
41
|
When asked to create a plan, you MUST respond with this EXACT format and NOTHING ELSE:
|
|
20
42
|
|
|
@@ -118,6 +140,32 @@ datafile_instructions = """
|
|
|
118
140
|
</datafile_instructions>
|
|
119
141
|
"""
|
|
120
142
|
|
|
143
|
+
datasource_example_with_token = """
|
|
144
|
+
<datasource_example_with_token>
|
|
145
|
+
TOKEN app_read READ
|
|
146
|
+
TOKEN landing_read READ
|
|
147
|
+
TOKEN landing_append APPEND
|
|
148
|
+
|
|
149
|
+
DESCRIPTION >
|
|
150
|
+
...
|
|
151
|
+
|
|
152
|
+
SCHEMA >
|
|
153
|
+
...
|
|
154
|
+
</datasource_example_with_token>
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
pipe_example_with_token = """
|
|
158
|
+
<pipe_example_with_token>
|
|
159
|
+
TOKEN app_read READ
|
|
160
|
+
|
|
161
|
+
NODE node_1
|
|
162
|
+
SQL >
|
|
163
|
+
%
|
|
164
|
+
SELECT
|
|
165
|
+
..
|
|
166
|
+
</pipe_example_with_token>
|
|
167
|
+
"""
|
|
168
|
+
|
|
121
169
|
|
|
122
170
|
def resources_prompt(project: Project) -> str:
|
|
123
171
|
files = project.get_project_files()
|
|
@@ -796,6 +844,22 @@ IMPORTANT: Every time you finish a plan and start a new resource creation or upd
|
|
|
796
844
|
{pipe_instructions}
|
|
797
845
|
{pipe_example}
|
|
798
846
|
|
|
847
|
+
# When working with tokens:
|
|
848
|
+
- Resource-scoped tokens are created and updated through datafiles.
|
|
849
|
+
- Tinybird will keep track of which ones to create or destroy based on all the tokens defined within the data files in your project.
|
|
850
|
+
- Scopes available are:
|
|
851
|
+
- DATASOURCES:READ:datasource_name => `TOKEN <token_name> READ` in .datasource files
|
|
852
|
+
- DATASOURCES:APPEND:datasource_name => `TOKEN <token_name> APPEND` in .datasource files
|
|
853
|
+
- PIPES:READ:pipe_name => `TOKEN <token_name> READ` in .pipe files
|
|
854
|
+
- Examples:
|
|
855
|
+
{datasource_example_with_token}
|
|
856
|
+
{pipe_example_with_token}
|
|
857
|
+
- For operational tokens that are not tied to specific resources. Run the following command in the CLI:
|
|
858
|
+
```
|
|
859
|
+
tb token create static new_admin_token --scope <scope>
|
|
860
|
+
```
|
|
861
|
+
where <scope> is one of the following: `TOKENS`, `ADMIN`, `ORG_DATASOURCES:READ`
|
|
862
|
+
|
|
799
863
|
# Working with materialized pipe files:
|
|
800
864
|
{materialized_pipe_instructions}
|
|
801
865
|
|
|
@@ -844,6 +908,10 @@ IMPORTANT: Every time you finish a plan and start a new resource creation or upd
|
|
|
844
908
|
|
|
845
909
|
# Working with commands:
|
|
846
910
|
- If you dont have a tool that can solve the task, use `run_command` tool to check if the task can be solved with a normal tinybird cli command.
|
|
911
|
+
- Available commands: {available_commands}
|
|
912
|
+
|
|
913
|
+
# When asked about the files in the project:
|
|
914
|
+
- You can rely in your own context to answer the question.
|
|
847
915
|
|
|
848
916
|
# Info
|
|
849
917
|
Today is {datetime.now().strftime("%Y-%m-%d")}
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/run_command.py
RENAMED
|
@@ -15,10 +15,10 @@ def run_command(ctx: RunContext[TinybirdAgentContext], command: str):
|
|
|
15
15
|
"""
|
|
16
16
|
try:
|
|
17
17
|
ctx.deps.thinking_animation.stop()
|
|
18
|
-
|
|
18
|
+
force_confirmation = " deploy" in command.lower() or " truncate" in command.lower()
|
|
19
19
|
confirmation = show_confirmation(
|
|
20
20
|
title=f"Run command: {command}?",
|
|
21
|
-
skip_confirmation=ctx.deps.dangerously_skip_permissions and not
|
|
21
|
+
skip_confirmation=ctx.deps.dangerously_skip_permissions and not force_confirmation,
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
if confirmation == "review":
|
|
@@ -629,6 +629,8 @@ def datasource_export(
|
|
|
629
629
|
@click.option("--yes", is_flag=True, default=False, help="Do not ask for confirmation")
|
|
630
630
|
@click.pass_context
|
|
631
631
|
def datasource_sync(ctx: Context, datasource_name: str, yes: bool):
|
|
632
|
+
"""Sync from a GCS or S3 connection defined in .datasource file"""
|
|
633
|
+
|
|
632
634
|
try:
|
|
633
635
|
client: TinyB = ctx.obj["client"]
|
|
634
636
|
ds = client.get_datasource(datasource_name)
|
|
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
|
|
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
|
|
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
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/deploy_check.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/diff_resource.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/execute_query.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/agent/tools/request_endpoint.py
RENAMED
|
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
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/build_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/format_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/datafile/pipe_checker.py
RENAMED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb/modules/tinyunit/tinyunit_lib.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev277 → tinybird-0.0.1.dev278}/tinybird/tb_cli_modules/workspace_members.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|