tinybird 0.0.1.dev251__tar.gz → 0.0.1.dev253__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.

Files changed (139) hide show
  1. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/__cli__.py +2 -2
  3. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/agent.py +56 -19
  4. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/append.py +5 -4
  5. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/deploy_check.py +16 -1
  6. tinybird-0.0.1.dev253/tinybird/tb/modules/agent/tools/execute_query.py +61 -0
  7. tinybird-0.0.1.dev253/tinybird/tb/modules/agent/tools/request_endpoint.py +65 -0
  8. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/utils.py +6 -17
  9. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/cli.py +8 -2
  10. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird.egg-info/PKG-INFO +1 -1
  11. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird.egg-info/SOURCES.txt +2 -0
  12. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/setup.cfg +0 -0
  13. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/__cli__.py +0 -0
  14. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/ch_utils/constants.py +0 -0
  15. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/ch_utils/engine.py +0 -0
  16. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/check_pypi.py +0 -0
  17. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/client.py +0 -0
  18. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/config.py +0 -0
  19. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/connectors.py +0 -0
  20. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/context.py +0 -0
  21. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/datafile/common.py +0 -0
  22. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/datafile/exceptions.py +0 -0
  23. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/datafile/parse_connection.py +0 -0
  24. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/datafile/parse_datasource.py +0 -0
  25. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/datafile/parse_pipe.py +0 -0
  26. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/datatypes.py +0 -0
  27. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/feedback_manager.py +0 -0
  28. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/git_settings.py +0 -0
  29. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/prompts.py +0 -0
  30. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/sql.py +0 -0
  31. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/sql_template.py +0 -0
  32. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/sql_template_fmt.py +0 -0
  33. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/sql_toolset.py +0 -0
  34. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/syncasync.py +0 -0
  35. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/check_pypi.py +0 -0
  36. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/cli.py +0 -0
  37. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/client.py +0 -0
  38. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/config.py +0 -0
  39. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/__init__.py +0 -0
  40. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/animations.py +0 -0
  41. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/banner.py +0 -0
  42. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/memory.py +0 -0
  43. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/models.py +0 -0
  44. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/prompts.py +0 -0
  45. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  46. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/build.py +0 -0
  47. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/create_datafile.py +0 -0
  48. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
  49. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/explore.py +0 -0
  50. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
  51. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  52. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/mock.py +0 -0
  53. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  54. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/preview_datafile.py +0 -0
  55. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/agent/tools/read_fixture_data.py +0 -0
  56. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/build.py +0 -0
  57. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/build_common.py +0 -0
  58. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/cicd.py +0 -0
  59. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/common.py +0 -0
  60. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/config.py +0 -0
  61. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/connection.py +0 -0
  62. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/copy.py +0 -0
  63. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/create.py +0 -0
  64. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/build.py +0 -0
  65. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/build_common.py +0 -0
  66. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  67. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  68. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/diff.py +0 -0
  69. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/fixture.py +0 -0
  70. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/format_common.py +0 -0
  71. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  72. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  73. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  74. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/playground.py +0 -0
  75. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datafile/pull.py +0 -0
  76. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/datasource.py +0 -0
  77. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/deployment.py +0 -0
  78. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/deployment_common.py +0 -0
  79. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/deprecations.py +0 -0
  80. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/dev_server.py +0 -0
  81. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/endpoint.py +0 -0
  82. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/exceptions.py +0 -0
  83. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/feedback_manager.py +0 -0
  84. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/info.py +0 -0
  85. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/infra.py +0 -0
  86. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/job.py +0 -0
  87. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/llm.py +0 -0
  88. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/llm_utils.py +0 -0
  89. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/local.py +0 -0
  90. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/local_common.py +0 -0
  91. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/login.py +0 -0
  92. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/login_common.py +0 -0
  93. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/logout.py +0 -0
  94. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/materialization.py +0 -0
  95. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/mock.py +0 -0
  96. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/mock_common.py +0 -0
  97. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/open.py +0 -0
  98. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/pipe.py +0 -0
  99. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/project.py +0 -0
  100. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/regions.py +0 -0
  101. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/secret.py +0 -0
  102. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/secret_common.py +0 -0
  103. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/shell.py +0 -0
  104. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/sink.py +0 -0
  105. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/table.py +0 -0
  106. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/telemetry.py +0 -0
  107. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/test.py +0 -0
  108. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  109. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  110. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/token.py +0 -0
  111. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/watch.py +0 -0
  112. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/workspace.py +0 -0
  113. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb/modules/workspace_members.py +0 -0
  114. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli.py +0 -0
  115. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/auth.py +0 -0
  116. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/branch.py +0 -0
  117. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/cicd.py +0 -0
  118. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/cli.py +0 -0
  119. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/common.py +0 -0
  120. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/config.py +0 -0
  121. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/connection.py +0 -0
  122. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/datasource.py +0 -0
  123. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/exceptions.py +0 -0
  124. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/fmt.py +0 -0
  125. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/job.py +0 -0
  126. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/pipe.py +0 -0
  127. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/regions.py +0 -0
  128. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/tag.py +0 -0
  129. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/telemetry.py +0 -0
  130. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/test.py +0 -0
  131. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  132. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  133. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/workspace.py +0 -0
  134. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  135. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird/tornado_template.py +0 -0
  136. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird.egg-info/dependency_links.txt +0 -0
  137. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird.egg-info/entry_points.txt +0 -0
  138. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird.egg-info/requires.txt +0 -0
  139. {tinybird-0.0.1.dev251 → tinybird-0.0.1.dev253}/tinybird.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev251
3
+ Version: 0.0.1.dev253
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -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.dev251'
8
- __revision__ = 'c11760c'
7
+ __version__ = '0.0.1.dev253'
8
+ __revision__ = '3bc2143'
@@ -39,13 +39,14 @@ from tinybird.tb.modules.agent.tools.build import build
39
39
  from tinybird.tb.modules.agent.tools.create_datafile import create_datafile
40
40
  from tinybird.tb.modules.agent.tools.deploy import deploy
41
41
  from tinybird.tb.modules.agent.tools.deploy_check import deploy_check
42
- from tinybird.tb.modules.agent.tools.explore import explore_data
42
+ from tinybird.tb.modules.agent.tools.execute_query import execute_query
43
43
  from tinybird.tb.modules.agent.tools.get_endpoint_stats import get_endpoint_stats
44
44
  from tinybird.tb.modules.agent.tools.get_openapi_definition import get_openapi_definition
45
45
  from tinybird.tb.modules.agent.tools.mock import mock
46
46
  from tinybird.tb.modules.agent.tools.plan import plan
47
47
  from tinybird.tb.modules.agent.tools.preview_datafile import preview_datafile
48
48
  from tinybird.tb.modules.agent.tools.read_fixture_data import read_fixture_data
49
+ from tinybird.tb.modules.agent.tools.request_endpoint import request_endpoint
49
50
  from tinybird.tb.modules.agent.utils import TinybirdAgentContext, show_input
50
51
  from tinybird.tb.modules.build_common import process as build_process
51
52
  from tinybird.tb.modules.common import _analyze, _get_tb_client
@@ -104,18 +105,19 @@ IMPORTANT: DO NOT ADD ANY COMMENTS unless asked by the user.
104
105
 
105
106
  # Tools
106
107
  You have access to the following tools:
107
- 1. `explore_data` - Explore data in the current workspace
108
- 2. `preview_datafile` - Preview the content of a datafile (datasource, endpoint, materialized, sink, copy, connection).
109
- 3. `create_datafile` - Create a file in the project folder. Confirmation will be asked by the tool before creating the file.
110
- 4. `plan` - Plan the creation or update of resources.
111
- 5. `build` - Build the project.
112
- 6. `deploy` - Deploy the project to Tinybird Cloud.
113
- 7. `deploy_check` - Check if the project can be deployed to Tinybird Cloud before deploying it.
114
- 8. `mock` - Create mock data for a landing datasource.
115
- 9. `read_fixture_data` - Read a fixture data file present in the project folder.
116
- 10. `append` - Append existing fixture to a datasource.
117
- 11. `get_endpoint_stats` - Get metrics of the requests to an endpoint.
118
- 12. `get_openapi_definition` - Get the OpenAPI definition for all endpoints that are built/deployed to Tinybird Cloud or Local.
108
+ 1. `preview_datafile` - Preview the content of a datafile (datasource, endpoint, materialized, sink, copy, connection).
109
+ 2. `create_datafile` - Create a file in the project folder. Confirmation will be asked by the tool before creating the file.
110
+ 3. `plan` - Plan the creation or update of resources.
111
+ 4. `build` - Build the project.
112
+ 5. `deploy` - Deploy the project to Tinybird Cloud.
113
+ 6. `deploy_check` - Check if the project can be deployed to Tinybird Cloud before deploying it.
114
+ 7. `mock` - Create mock data for a landing datasource.
115
+ 8. `read_fixture_data` - Read a fixture data file present in the project folder.
116
+ 9. `append` - Append existing fixture to a datasource.
117
+ 10. `get_endpoint_stats` - Get metrics of the requests to an endpoint.
118
+ 11. `get_openapi_definition` - Get the OpenAPI definition for all endpoints that are built/deployed to Tinybird Cloud or Local.
119
+ 12. `execute_query` - Execute a query against Tinybird Cloud or Local.
120
+ 13. `request_endpoint` - Request an endpoint against Tinybird Cloud or Local.
119
121
 
120
122
  # When creating or updating datafiles:
121
123
  1. Use `plan` tool to plan the creation or update of resources.
@@ -135,8 +137,10 @@ SCHEMA >
135
137
 
136
138
  # When user wants to optimize an endpoint:
137
139
  First check if the query is optimized. E.g is filtering by a column present in the sorting key.
138
- Avoid when possible to not update the landing datasource.
140
+ Avoid when possible to update the landing datasource.
139
141
  Check endpoint stats to analyze how the endpoint is performing. Use `get_endpoint_stats` tool to get the stats.
142
+ You can use `request_endpoint` tool to check if the endpoint is working as expected.
143
+ You can use `execute_query` tool to execute a query against Tinybird Cloud or Local, to test different queries.
140
144
  When your data is in Tinybird, you can create intermediate data sources to preprocess data and make the endpoints faster. This can be done by using materialized views or copy pipes.
141
145
  - Copy pipes capture the result of a pipe at a specific point in time and write it to a target data source. They can run on a schedule or run on demand, making them ideal for event-sourced snapshots, data experimentation, and deduplication with snapshots.
142
146
  - Materialized views continuously re-evaluate a query as new events are inserted, maintaining an always up-to-date derived dataset. Unlike copy pipes which create point-in-time snapshots, materialized views provide real-time transformations of your data.
@@ -148,6 +152,11 @@ Finally, update the existing endpoint itself, do not add a new one.
148
152
  IMPORTANT: If the user cancels some of the steps or there is an error in file creation, DO NOT continue with the plan. Stop the process and wait for the user before using any other tool.
149
153
  IMPORTANT: Every time you finish a plan and start a new resource creation or update process, create a new plan before starting with the changes.
150
154
 
155
+ # Using deployment tools:
156
+ - Use `deploy_check` tool to check if the project can be deployed to Tinybird Cloud before deploying it.
157
+ - Use `deploy` tool to deploy the project to Tinybird Cloud.
158
+ - Only use deployment tools if user explicitly asks for it.
159
+
151
160
  # When planning the creation or update of resources:
152
161
  {plan_instructions}
153
162
  {datafile_instructions}
@@ -184,7 +193,6 @@ GCS: {gcs_connection_example}
184
193
  Today is {datetime.now().strftime("%Y-%m-%d")}
185
194
  """,
186
195
  tools=[
187
- Tool(explore_data, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
188
196
  Tool(preview_datafile, docstring_format="google", require_parameter_descriptions=True, takes_ctx=False),
189
197
  Tool(create_datafile, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
190
198
  Tool(plan, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
@@ -203,6 +211,8 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
203
211
  require_parameter_descriptions=True,
204
212
  takes_ctx=True,
205
213
  ),
214
+ Tool(execute_query, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
215
+ Tool(request_endpoint, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
206
216
  ],
207
217
  )
208
218
 
@@ -230,6 +240,8 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
230
240
  analyze_fixture=partial(analyze_fixture, config=config),
231
241
  execute_cloud_query=partial(execute_cloud_query, config=config),
232
242
  execute_local_query=partial(execute_local_query, config=config),
243
+ request_endpoint_cloud=partial(request_endpoint_cloud, config=config),
244
+ request_endpoint_local=partial(request_endpoint_local, config=config),
233
245
  get_project_files=project.get_project_files,
234
246
  folder=folder,
235
247
  thinking_animation=thinking_animation,
@@ -263,7 +275,9 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
263
275
  click.echo("\n")
264
276
 
265
277
 
266
- def run_agent(config: dict[str, Any], project: Project, dangerously_skip_permissions: bool):
278
+ def run_agent(
279
+ config: dict[str, Any], project: Project, dangerously_skip_permissions: bool, prompt: Optional[str] = None
280
+ ):
267
281
  token = config.get("token", None)
268
282
  host = config.get("host", None)
269
283
  user_token = config.get("user_token", None)
@@ -294,8 +308,17 @@ def run_agent(config: dict[str, Any], project: Project, dangerously_skip_permiss
294
308
  )
295
309
  return
296
310
 
311
+ # In print mode, always skip permissions to avoid interactive prompts
312
+ skip_permissions = dangerously_skip_permissions or (prompt is not None)
313
+ agent = TinybirdAgent(token, user_token, host, workspace_id, project, skip_permissions)
314
+
315
+ # Print mode: run once with the provided prompt and exit
316
+ if prompt:
317
+ agent.run(prompt, config, project)
318
+ return
319
+
320
+ # Interactive mode: show banner and enter interactive loop
297
321
  display_banner()
298
- agent = TinybirdAgent(token, user_token, host, workspace_id, project, dangerously_skip_permissions)
299
322
  click.echo()
300
323
  click.echo(FeedbackManager.info(message="Describe what you want to create and I'll help you build it"))
301
324
  click.echo(FeedbackManager.info(message="Run /help for more commands"))
@@ -426,11 +449,25 @@ def analyze_fixture(config: dict[str, Any], fixture_path: str) -> dict[str, Any]
426
449
  return meta
427
450
 
428
451
 
429
- def execute_cloud_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> str:
452
+ def execute_cloud_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
430
453
  client = _get_tb_client(config["token"], config["host"])
431
454
  return client.query(sql=query, pipeline=pipe_name)
432
455
 
433
456
 
434
- def execute_local_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> str:
457
+ def execute_local_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
435
458
  local_client = get_tinybird_local_client(config, test=False, silent=True)
436
459
  return local_client.query(sql=query, pipeline=pipe_name)
460
+
461
+
462
+ def request_endpoint_cloud(
463
+ config: dict[str, Any], endpoint_name: str, params: Optional[dict[str, str]] = None
464
+ ) -> dict[str, Any]:
465
+ client = _get_tb_client(config["token"], config["host"])
466
+ return client.pipe_data(endpoint_name, format="json", params=params)
467
+
468
+
469
+ def request_endpoint_local(
470
+ config: dict[str, Any], endpoint_name: str, params: Optional[dict[str, str]] = None
471
+ ) -> dict[str, Any]:
472
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
473
+ return local_client.pipe_data(endpoint_name, format="json", params=params)
@@ -22,16 +22,17 @@ def append(ctx: RunContext[TinybirdAgentContext], datasource_name: str, fixture_
22
22
  skip_confirmation=ctx.deps.dangerously_skip_permissions,
23
23
  )
24
24
 
25
- ctx.deps.thinking_animation.start()
26
-
27
25
  if confirmation == "review":
28
26
  click.echo()
29
27
  feedback = show_input(ctx.deps.workspace_name)
30
28
  ctx.deps.thinking_animation.start()
31
- return f"User did not confirm the proposed plan and gave the following feedback: {feedback}"
29
+ return (
30
+ f"User did not confirm appending {fixture_pathname} fixture and gave the following feedback: {feedback}"
31
+ )
32
32
 
33
33
  if confirmation == "cancel":
34
- return "User rejected appending existing fixture. Skipping..."
34
+ ctx.deps.thinking_animation.start()
35
+ return f"User rejected appending {fixture_pathname} fixture. Skip this step"
35
36
 
36
37
  ctx.deps.thinking_animation.stop()
37
38
  click.echo(FeedbackManager.highlight(message=f"\n» Appending {fixture_pathname} to {datasource_name}..."))
@@ -1,7 +1,7 @@
1
1
  import click
2
2
  from pydantic_ai import RunContext
3
3
 
4
- from tinybird.tb.modules.agent.utils import TinybirdAgentContext
4
+ from tinybird.tb.modules.agent.utils import TinybirdAgentContext, show_confirmation, show_input
5
5
  from tinybird.tb.modules.feedback_manager import FeedbackManager
6
6
 
7
7
 
@@ -9,6 +9,21 @@ def deploy_check(ctx: RunContext[TinybirdAgentContext]) -> str:
9
9
  """Check that project can be deployed"""
10
10
  try:
11
11
  ctx.deps.thinking_animation.stop()
12
+ confirmation = show_confirmation(
13
+ title="Check that project can be deployed?",
14
+ skip_confirmation=ctx.deps.dangerously_skip_permissions,
15
+ )
16
+
17
+ if confirmation == "review":
18
+ click.echo()
19
+ feedback = show_input(ctx.deps.workspace_name)
20
+ ctx.deps.thinking_animation.start()
21
+ return f"User did not confirm deployment check and gave the following feedback: {feedback}"
22
+
23
+ if confirmation == "cancel":
24
+ ctx.deps.thinking_animation.start()
25
+ return "User cancelled deployment check. Stop deployment check."
26
+
12
27
  ctx.deps.deploy_check_project()
13
28
  ctx.deps.thinking_animation.start()
14
29
  return "Project can be deployed"
@@ -0,0 +1,61 @@
1
+ import click
2
+ import humanfriendly
3
+ from pydantic_ai import RunContext
4
+
5
+ from tinybird.tb.modules.agent.utils import TinybirdAgentContext
6
+ from tinybird.tb.modules.common import echo_safe_humanfriendly_tables_format_smart_table
7
+ from tinybird.tb.modules.feedback_manager import FeedbackManager
8
+
9
+
10
+ def execute_query(ctx: RunContext[TinybirdAgentContext], query: str, task: str, cloud: bool = True):
11
+ """Execute a query:
12
+
13
+ Args:
14
+ query (str): The query to execute. Required.
15
+ task (str): The purpose of the query. Required.
16
+ cloud (bool): Whether to execute the query on cloud or local. Optional.
17
+
18
+ Returns:
19
+ str: The result of the query.
20
+ """
21
+ try:
22
+ cloud_or_local = "cloud" if cloud else "local"
23
+ ctx.deps.thinking_animation.stop()
24
+
25
+ click.echo(FeedbackManager.highlight(message=f"» Executing query to {cloud_or_local}:\n{query}\n"))
26
+
27
+ is_templating = query.strip().startswith("%")
28
+ query_format = "FORMAT JSON"
29
+ if is_templating:
30
+ query = query.strip()
31
+ query = f"%\nSELECT * FROM ({query}) {query_format}"
32
+ else:
33
+ query = f"SELECT * FROM ({query}) {query_format}"
34
+
35
+ execute_query = ctx.deps.execute_cloud_query if cloud else ctx.deps.execute_local_query
36
+ result = execute_query(query=query)
37
+ stats = result["statistics"]
38
+ seconds = stats["elapsed"]
39
+ rows_read = humanfriendly.format_number(stats["rows_read"])
40
+ bytes_read = humanfriendly.format_size(stats["bytes_read"])
41
+
42
+ click.echo(FeedbackManager.info_query_stats(seconds=seconds, rows=rows_read, bytes=bytes_read))
43
+
44
+ if not result["data"]:
45
+ click.echo(FeedbackManager.info_no_rows())
46
+ else:
47
+ echo_safe_humanfriendly_tables_format_smart_table(
48
+ data=[d.values() for d in result["data"]], column_names=result["data"][0].keys()
49
+ )
50
+ ctx.deps.thinking_animation.start()
51
+ result["data"] = result["data"][:10]
52
+ return f"Result for task '{task}' in {cloud_or_local} environment: {result}. The user is being shown the full result in the console but this message only contains the first 10 rows."
53
+ except Exception as e:
54
+ error = str(e)
55
+ ctx.deps.thinking_animation.stop()
56
+ click.echo(FeedbackManager.error(message=error))
57
+ ctx.deps.thinking_animation.start()
58
+ if "not found" in error.lower() and cloud:
59
+ return f"Error executing query: {error}. Please run the query against Tinybird local instead of cloud."
60
+ else:
61
+ return f"Error executing query: {error}. Please try again."
@@ -0,0 +1,65 @@
1
+ from typing import Optional
2
+
3
+ import click
4
+ import humanfriendly
5
+ from pydantic_ai import RunContext
6
+
7
+ from tinybird.tb.modules.agent.utils import TinybirdAgentContext
8
+ from tinybird.tb.modules.common import echo_safe_humanfriendly_tables_format_smart_table
9
+ from tinybird.tb.modules.feedback_manager import FeedbackManager
10
+
11
+
12
+ def request_endpoint(
13
+ ctx: RunContext[TinybirdAgentContext],
14
+ endpoint_name: str,
15
+ params: Optional[dict[str, str]] = None,
16
+ cloud: bool = True,
17
+ ):
18
+ """Request an endpoint:
19
+
20
+ Args:
21
+ endpoint_name (str): The name of the endpoint to request. Required.
22
+ params (dict): The parameters to pass to the endpoint. Optional.
23
+ cloud (bool): Whether to request the endpoint on cloud or local. Optional.
24
+
25
+ Returns:
26
+ str: The result of the query.
27
+ """
28
+ try:
29
+ cloud_or_local = "cloud" if cloud else "local"
30
+ ctx.deps.thinking_animation.stop()
31
+
32
+ click.echo(
33
+ FeedbackManager.highlight(
34
+ message=f"» Calling endpoint {endpoint_name} in {cloud_or_local} environment with params {params}"
35
+ )
36
+ )
37
+
38
+ request_endpoint = ctx.deps.request_endpoint_cloud if cloud else ctx.deps.request_endpoint_local
39
+ result = request_endpoint(endpoint_name=endpoint_name, params=params)
40
+ stats = result["statistics"]
41
+ seconds = stats["elapsed"]
42
+ rows_read = humanfriendly.format_number(stats["rows_read"])
43
+ bytes_read = humanfriendly.format_size(stats["bytes_read"])
44
+
45
+ click.echo(FeedbackManager.success_print_pipe(pipe=endpoint_name))
46
+ click.echo(FeedbackManager.info_query_stats(seconds=seconds, rows=rows_read, bytes=bytes_read))
47
+
48
+ if not result["data"]:
49
+ click.echo(FeedbackManager.info_no_rows())
50
+ else:
51
+ echo_safe_humanfriendly_tables_format_smart_table(
52
+ data=[d.values() for d in result["data"][:5]], column_names=result["data"][0].keys()
53
+ )
54
+ click.echo("Showing first 5 results\n")
55
+ ctx.deps.thinking_animation.start()
56
+ return f"Result for endpoint {endpoint_name} with params {params} in {cloud_or_local} environment: {result}. Do not show result is already shown in the console."
57
+ except Exception as e:
58
+ error = str(e)
59
+ ctx.deps.thinking_animation.stop()
60
+ click.echo(FeedbackManager.error(message=error))
61
+ ctx.deps.thinking_animation.start()
62
+ if "not found" in error.lower() and cloud:
63
+ return f"Error executing query: {error}. Please run the query against Tinybird local instead of cloud."
64
+ else:
65
+ return f"Error executing query: {error}. Please try again."
@@ -13,7 +13,6 @@ from prompt_toolkit.layout import Layout
13
13
  from prompt_toolkit.layout.containers import ConditionalContainer, HSplit, Window
14
14
  from prompt_toolkit.layout.controls import FormattedTextControl
15
15
  from prompt_toolkit.layout.dimension import LayoutDimension as D
16
- from prompt_toolkit.mouse_events import MouseEventType
17
16
  from prompt_toolkit.patch_stdout import patch_stdout as pt_patch_stdout
18
17
  from prompt_toolkit.shortcuts import PromptSession
19
18
  from prompt_toolkit.styles import Style as PromptStyle
@@ -42,8 +41,10 @@ class TinybirdAgentContext(BaseModel):
42
41
  mock_data: Callable[..., list[dict[str, Any]]]
43
42
  append_data: Callable[..., None]
44
43
  analyze_fixture: Callable[..., dict[str, Any]]
45
- execute_cloud_query: Callable[..., str]
46
- execute_local_query: Callable[..., str]
44
+ execute_cloud_query: Callable[..., dict[str, Any]]
45
+ execute_local_query: Callable[..., dict[str, Any]]
46
+ request_endpoint_cloud: Callable[..., dict[str, Any]]
47
+ request_endpoint_local: Callable[..., dict[str, Any]]
47
48
  dangerously_skip_permissions: bool
48
49
  token: str
49
50
  user_token: str
@@ -63,16 +64,6 @@ default_style = PromptStyle.from_dict(
63
64
  )
64
65
 
65
66
 
66
- def if_mousedown(handler):
67
- def handle_if_mouse_down(mouse_event):
68
- if mouse_event.event_type == MouseEventType.MOUSE_DOWN:
69
- return handler(mouse_event)
70
- else:
71
- return NotImplemented
72
-
73
- return handle_if_mouse_down
74
-
75
-
76
67
  class Separator:
77
68
  line = "-" * 15
78
69
 
@@ -133,9 +124,7 @@ class InquirerControl(FormattedTextControl):
133
124
  def append(index, choice):
134
125
  selected = index == self.selected_option_index
135
126
 
136
- @if_mousedown
137
- def select_item(mouse_event):
138
- # bind option with this index to mouse event
127
+ def select_item():
139
128
  self.selected_option_index = index
140
129
  self.answered = True
141
130
  get_app().exit(result=self.get_selection()[0])
@@ -248,7 +237,7 @@ def prompt_question(message, **kwargs):
248
237
  ic.answered = True
249
238
  event.app.exit(result=ic.get_selection()[1])
250
239
 
251
- return Application(layout=Layout(layout), key_bindings=kb, mouse_support=True, style=style)
240
+ return Application(layout=Layout(layout), key_bindings=kb, mouse_support=False, style=style)
252
241
 
253
242
 
254
243
  def prompt(questions, answers=None, **kwargs):
@@ -86,6 +86,10 @@ agent_mode_flag = os.environ.get("TB_AGENT_MODE", "false") == "true"
86
86
  help="Skip permissions check in agent mode.",
87
87
  hidden=True,
88
88
  )
89
+ @click.option(
90
+ "--p",
91
+ help="Run agent in print mode with the provided prompt and exit.",
92
+ )
89
93
  @click.version_option(version=VERSION)
90
94
  @click.pass_context
91
95
  def cli(
@@ -101,6 +105,7 @@ def cli(
101
105
  output: str,
102
106
  max_depth: int,
103
107
  dangerously_skip_permissions: bool,
108
+ p: Optional[str],
104
109
  ) -> None:
105
110
  """
106
111
  Use `OBFUSCATE_REGEX_PATTERN` and `OBFUSCATE_PATTERN_SEPARATOR` environment variables to define a regex pattern and a separator (in case of a single string with multiple regex) to obfuscate secrets in the CLI output.
@@ -202,9 +207,10 @@ def cli(
202
207
  ctx.ensure_object(dict)["output"] = output
203
208
 
204
209
  is_agent_mode = agent_mode_flag and ctx.invoked_subcommand is None
210
+ is_print_mode = p is not None
205
211
 
206
- if is_agent_mode:
207
- run_agent(config, project, dangerously_skip_permissions)
212
+ if is_agent_mode or is_print_mode:
213
+ run_agent(config, project, dangerously_skip_permissions, prompt=p)
208
214
 
209
215
 
210
216
  @cli.command(hidden=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinybird
3
- Version: 0.0.1.dev251
3
+ Version: 0.0.1.dev253
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -92,6 +92,7 @@ tinybird/tb/modules/agent/tools/build.py
92
92
  tinybird/tb/modules/agent/tools/create_datafile.py
93
93
  tinybird/tb/modules/agent/tools/deploy.py
94
94
  tinybird/tb/modules/agent/tools/deploy_check.py
95
+ tinybird/tb/modules/agent/tools/execute_query.py
95
96
  tinybird/tb/modules/agent/tools/explore.py
96
97
  tinybird/tb/modules/agent/tools/get_endpoint_stats.py
97
98
  tinybird/tb/modules/agent/tools/get_openapi_definition.py
@@ -99,6 +100,7 @@ tinybird/tb/modules/agent/tools/mock.py
99
100
  tinybird/tb/modules/agent/tools/plan.py
100
101
  tinybird/tb/modules/agent/tools/preview_datafile.py
101
102
  tinybird/tb/modules/agent/tools/read_fixture_data.py
103
+ tinybird/tb/modules/agent/tools/request_endpoint.py
102
104
  tinybird/tb/modules/datafile/build.py
103
105
  tinybird/tb/modules/datafile/build_common.py
104
106
  tinybird/tb/modules/datafile/build_datasource.py