tinybird 0.0.1.dev253__tar.gz → 0.0.1.dev255__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 (143) hide show
  1. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/PKG-INFO +1 -1
  2. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/prompts.py +1 -2
  3. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/__cli__.py +2 -2
  4. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/agent.py +90 -29
  5. tinybird-0.0.1.dev255/tinybird/tb/modules/agent/prompts.py +496 -0
  6. tinybird-0.0.1.dev255/tinybird/tb/modules/agent/tools/analyze.py +79 -0
  7. tinybird-0.0.1.dev255/tinybird/tb/modules/agent/tools/append.py +110 -0
  8. tinybird-0.0.1.dev255/tinybird/tb/modules/agent/tools/diff_resource.py +51 -0
  9. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/execute_query.py +5 -4
  10. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +1 -1
  11. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/mock.py +1 -1
  12. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/preview_datafile.py +1 -1
  13. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/request_endpoint.py +4 -4
  14. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/utils.py +8 -2
  15. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/common.py +17 -0
  16. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird.egg-info/PKG-INFO +1 -1
  17. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird.egg-info/SOURCES.txt +2 -1
  18. tinybird-0.0.1.dev253/tinybird/tb/modules/agent/prompts.py +0 -149
  19. tinybird-0.0.1.dev253/tinybird/tb/modules/agent/tools/append.py +0 -47
  20. tinybird-0.0.1.dev253/tinybird/tb/modules/agent/tools/read_fixture_data.py +0 -36
  21. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/setup.cfg +0 -0
  22. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/__cli__.py +0 -0
  23. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/ch_utils/constants.py +0 -0
  24. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/ch_utils/engine.py +0 -0
  25. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/check_pypi.py +0 -0
  26. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/client.py +0 -0
  27. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/config.py +0 -0
  28. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/connectors.py +0 -0
  29. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/context.py +0 -0
  30. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/datafile/common.py +0 -0
  31. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/datafile/exceptions.py +0 -0
  32. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/datafile/parse_connection.py +0 -0
  33. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/datafile/parse_datasource.py +0 -0
  34. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/datafile/parse_pipe.py +0 -0
  35. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/datatypes.py +0 -0
  36. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/feedback_manager.py +0 -0
  37. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/git_settings.py +0 -0
  38. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/sql.py +0 -0
  39. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/sql_template.py +0 -0
  40. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/sql_template_fmt.py +0 -0
  41. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/sql_toolset.py +0 -0
  42. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/syncasync.py +0 -0
  43. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/check_pypi.py +0 -0
  44. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/cli.py +0 -0
  45. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/client.py +0 -0
  46. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/config.py +0 -0
  47. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/__init__.py +0 -0
  48. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/animations.py +0 -0
  49. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/banner.py +0 -0
  50. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/memory.py +0 -0
  51. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/models.py +0 -0
  52. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
  53. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/build.py +0 -0
  54. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/create_datafile.py +0 -0
  55. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
  56. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
  57. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/explore.py +0 -0
  58. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
  59. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/agent/tools/plan.py +0 -0
  60. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/build.py +0 -0
  61. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/build_common.py +0 -0
  62. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/cicd.py +0 -0
  63. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/cli.py +0 -0
  64. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/config.py +0 -0
  65. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/connection.py +0 -0
  66. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/copy.py +0 -0
  67. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/create.py +0 -0
  68. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build.py +0 -0
  69. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build_common.py +0 -0
  70. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
  71. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
  72. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/diff.py +0 -0
  73. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/fixture.py +0 -0
  74. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/format_common.py +0 -0
  75. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
  76. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
  77. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
  78. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/playground.py +0 -0
  79. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datafile/pull.py +0 -0
  80. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/datasource.py +0 -0
  81. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/deployment.py +0 -0
  82. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/deployment_common.py +0 -0
  83. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/deprecations.py +0 -0
  84. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/dev_server.py +0 -0
  85. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/endpoint.py +0 -0
  86. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/exceptions.py +0 -0
  87. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/feedback_manager.py +0 -0
  88. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/info.py +0 -0
  89. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/infra.py +0 -0
  90. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/job.py +0 -0
  91. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/llm.py +0 -0
  92. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/llm_utils.py +0 -0
  93. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/local.py +0 -0
  94. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/local_common.py +0 -0
  95. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/login.py +0 -0
  96. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/login_common.py +0 -0
  97. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/logout.py +0 -0
  98. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/materialization.py +0 -0
  99. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/mock.py +0 -0
  100. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/mock_common.py +0 -0
  101. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/open.py +0 -0
  102. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/pipe.py +0 -0
  103. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/project.py +0 -0
  104. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/regions.py +0 -0
  105. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/secret.py +0 -0
  106. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/secret_common.py +0 -0
  107. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/shell.py +0 -0
  108. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/sink.py +0 -0
  109. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/table.py +0 -0
  110. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/telemetry.py +0 -0
  111. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/test.py +0 -0
  112. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
  113. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
  114. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/token.py +0 -0
  115. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/watch.py +0 -0
  116. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/workspace.py +0 -0
  117. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb/modules/workspace_members.py +0 -0
  118. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli.py +0 -0
  119. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/auth.py +0 -0
  120. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/branch.py +0 -0
  121. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/cicd.py +0 -0
  122. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/cli.py +0 -0
  123. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/common.py +0 -0
  124. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/config.py +0 -0
  125. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/connection.py +0 -0
  126. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/datasource.py +0 -0
  127. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/exceptions.py +0 -0
  128. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/fmt.py +0 -0
  129. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/job.py +0 -0
  130. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/pipe.py +0 -0
  131. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/regions.py +0 -0
  132. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/tag.py +0 -0
  133. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/telemetry.py +0 -0
  134. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/test.py +0 -0
  135. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
  136. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
  137. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/workspace.py +0 -0
  138. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tb_cli_modules/workspace_members.py +0 -0
  139. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird/tornado_template.py +0 -0
  140. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird.egg-info/dependency_links.txt +0 -0
  141. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird.egg-info/entry_points.txt +0 -0
  142. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/tinybird.egg-info/requires.txt +0 -0
  143. {tinybird-0.0.1.dev253 → tinybird-0.0.1.dev255}/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.dev253
3
+ Version: 0.0.1.dev255
4
4
  Summary: Tinybird Command Line Tool
5
5
  Home-page: https://www.tinybird.co/docs/forward/commands
6
6
  Author: Tinybird
@@ -689,7 +689,6 @@ materialized_pipe_instructions = """
689
689
  - TYPE MATERIALIZED is the type of the pipe and it is mandatory for materialized pipes.
690
690
  - The content of the .pipe file must follow the materialized_pipe_content format.
691
691
  - Use State modifier for the aggregated columns in the pipe.
692
- - Keep the SQL query simple and avoid using complex queries with joins, subqueries, etc.
693
692
  </materialized_pipe_instructions>
694
693
  <materialized_pipe_content>
695
694
  NODE daily_sales
@@ -812,11 +811,11 @@ TYPE endpoint
812
811
  """
813
812
 
814
813
  pipe_instructions = """
814
+ Follow these instructions when creating or updating any type of .pipe file:
815
815
  <pipe_file_instructions>
816
816
  - The pipe names must be unique.
817
817
  - Nodes do NOT use the same name as the Pipe they belong to. So if the pipe name is "my_pipe", the nodes must be named different like "my_pipe_node_1", "my_pipe_node_2", etc.
818
818
  - Node names MUST be different from the resource names in the project.
819
- - Avoid more than one node per pipe unless it is really necessary or requested by the user.
820
819
  - No indentation is allowed for property names: DESCRIPTION, NODE, SQL, TYPE, etc.
821
820
  - Allowed TYPE values are: endpoint, copy, materialized, sink.
822
821
  - Add always the output node in the TYPE section or in the last node of the pipe.
@@ -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.dev253'
8
- __revision__ = '3bc2143'
7
+ __version__ = '0.0.1.dev255'
8
+ __revision__ = '208306e'
@@ -30,22 +30,25 @@ from tinybird.tb.modules.agent.memory import clear_history
30
30
  from tinybird.tb.modules.agent.models import create_model, model_costs
31
31
  from tinybird.tb.modules.agent.prompts import (
32
32
  datafile_instructions,
33
+ endpoint_optimization_instructions,
33
34
  plan_instructions,
34
35
  resources_prompt,
36
+ sql_agent_instructions,
35
37
  sql_instructions,
36
38
  )
37
- from tinybird.tb.modules.agent.tools.append import append
39
+ from tinybird.tb.modules.agent.tools.analyze import analyze_file, analyze_url
40
+ from tinybird.tb.modules.agent.tools.append import append_file, append_url
38
41
  from tinybird.tb.modules.agent.tools.build import build
39
42
  from tinybird.tb.modules.agent.tools.create_datafile import create_datafile
40
43
  from tinybird.tb.modules.agent.tools.deploy import deploy
41
44
  from tinybird.tb.modules.agent.tools.deploy_check import deploy_check
45
+ from tinybird.tb.modules.agent.tools.diff_resource import diff_resource
42
46
  from tinybird.tb.modules.agent.tools.execute_query import execute_query
43
47
  from tinybird.tb.modules.agent.tools.get_endpoint_stats import get_endpoint_stats
44
48
  from tinybird.tb.modules.agent.tools.get_openapi_definition import get_openapi_definition
45
49
  from tinybird.tb.modules.agent.tools.mock import mock
46
50
  from tinybird.tb.modules.agent.tools.plan import plan
47
51
  from tinybird.tb.modules.agent.tools.preview_datafile import preview_datafile
48
- from tinybird.tb.modules.agent.tools.read_fixture_data import read_fixture_data
49
52
  from tinybird.tb.modules.agent.tools.request_endpoint import request_endpoint
50
53
  from tinybird.tb.modules.agent.utils import TinybirdAgentContext, show_input
51
54
  from tinybird.tb.modules.build_common import process as build_process
@@ -112,12 +115,15 @@ You have access to the following tools:
112
115
  5. `deploy` - Deploy the project to Tinybird Cloud.
113
116
  6. `deploy_check` - Check if the project can be deployed to Tinybird Cloud before deploying it.
114
117
  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.
118
+ 8. `analyze_file` - Analyze the content of a fixture file present in the project folder.
119
+ 9. `analyze_url` - Analyze the content of an external url.
120
+ 9. `append_file` - Append a file present in the project to a datasource.
121
+ 10. `append_url` - Append an external url to a datasource.
122
+ 11. `get_endpoint_stats` - Get metrics of the requests to an endpoint.
123
+ 12. `get_openapi_definition` - Get the OpenAPI definition for all endpoints that are built/deployed to Tinybird Cloud or Local.
124
+ 13. `execute_query` - Execute a query against Tinybird Cloud or Local.
120
125
  13. `request_endpoint` - Request an endpoint against Tinybird Cloud or Local.
126
+ 14. `diff_resource` - Diff the content of a resource in Tinybird Cloud vs Tinybird Local vs Project local file.
121
127
 
122
128
  # When creating or updating datafiles:
123
129
  1. Use `plan` tool to plan the creation or update of resources.
@@ -133,21 +139,11 @@ You have access to the following tools:
133
139
  - If the user does not specify anything about the desired schema, create a schema like this:
134
140
  SCHEMA >
135
141
  `data` String `json:$`
142
+
136
143
  - Use always json paths with .ndjson files.
137
144
 
138
145
  # When user wants to optimize an endpoint:
139
- First check if the query is optimized. E.g is filtering by a column present in the sorting key.
140
- Avoid when possible to update the landing datasource.
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.
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.
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.
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.
147
- Each approach has its own strengths and use cases:
148
- - Use copy pipes when you need scheduled or on-demand snapshots of your data.
149
- - Use materialized views when you need continuous, real-time transformations.
150
- Finally, update the existing endpoint itself, do not add a new one.
146
+ {endpoint_optimization_instructions}
151
147
 
152
148
  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.
153
149
  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.
@@ -179,6 +175,7 @@ IMPORTANT: Every time you finish a plan and start a new resource creation or upd
179
175
  {copy_pipe_instructions}
180
176
 
181
177
  # Working with SQL queries:
178
+ {sql_agent_instructions}
182
179
  {sql_instructions}
183
180
 
184
181
  # Working with connections files:
@@ -189,6 +186,13 @@ Kafka: {kafka_connection_example}
189
186
  S3: {s3_connection_example}
190
187
  GCS: {gcs_connection_example}
191
188
 
189
+ # When executing a query or requesting an endpoint:
190
+ - You need to be sure that the selected resource is updated to the last version in the environment you are working on.
191
+ - Use `diff_resource` tool to compare the content of the resource to compare the differences between environments.
192
+ - Project local file is the source of truth.
193
+ - If the resource is not present or updated to the last version in Tinybird Local, it means you need to build the project.
194
+ - If the resource is not present or updated to the last version in Tinybird Cloud, it means you need to deploy the project.
195
+
192
196
  # Info
193
197
  Today is {datetime.now().strftime("%Y-%m-%d")}
194
198
  """,
@@ -200,8 +204,10 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
200
204
  Tool(deploy, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
201
205
  Tool(deploy_check, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
202
206
  Tool(mock, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
203
- Tool(read_fixture_data, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
204
- Tool(append, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
207
+ Tool(analyze_file, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
208
+ Tool(analyze_url, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
209
+ Tool(append_file, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
210
+ Tool(append_url, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
205
211
  Tool(
206
212
  get_endpoint_stats, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True
207
213
  ),
@@ -213,6 +219,7 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
213
219
  ),
214
220
  Tool(execute_query, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
215
221
  Tool(request_endpoint, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
222
+ Tool(diff_resource, docstring_format="google", require_parameter_descriptions=True, takes_ctx=True),
216
223
  ],
217
224
  )
218
225
 
@@ -238,10 +245,16 @@ Today is {datetime.now().strftime("%Y-%m-%d")}
238
245
  mock_data=partial(mock_data, project=project, config=config),
239
246
  append_data=partial(append_data, config=config),
240
247
  analyze_fixture=partial(analyze_fixture, config=config),
241
- execute_cloud_query=partial(execute_cloud_query, config=config),
242
- execute_local_query=partial(execute_local_query, config=config),
248
+ execute_query_cloud=partial(execute_query_cloud, config=config),
249
+ execute_query_local=partial(execute_query_local, config=config),
243
250
  request_endpoint_cloud=partial(request_endpoint_cloud, config=config),
244
251
  request_endpoint_local=partial(request_endpoint_local, config=config),
252
+ get_datasource_datafile_cloud=partial(get_datasource_datafile_cloud, config=config),
253
+ get_datasource_datafile_local=partial(get_datasource_datafile_local, config=config),
254
+ get_pipe_datafile_cloud=partial(get_pipe_datafile_cloud, config=config),
255
+ get_pipe_datafile_local=partial(get_pipe_datafile_local, config=config),
256
+ get_connection_datafile_cloud=partial(get_connection_datafile_cloud, config=config),
257
+ get_connection_datafile_local=partial(get_connection_datafile_local, config=config),
245
258
  get_project_files=project.get_project_files,
246
259
  folder=folder,
247
260
  thinking_animation=thinking_animation,
@@ -281,8 +294,8 @@ def run_agent(
281
294
  token = config.get("token", None)
282
295
  host = config.get("host", None)
283
296
  user_token = config.get("user_token", None)
284
- workspace_id = config.get("id", None)
285
- workspace_name = config.get("name", None)
297
+ workspace_id = config.get("id", "")
298
+ workspace_name = config.get("name", "")
286
299
  try:
287
300
  if not token or not host or not workspace_id or not user_token:
288
301
  yes = click.confirm(
@@ -443,18 +456,18 @@ def mock_data(
443
456
  )
444
457
 
445
458
 
446
- def analyze_fixture(config: dict[str, Any], fixture_path: str) -> dict[str, Any]:
459
+ def analyze_fixture(config: dict[str, Any], fixture_path: str, format: str = "json") -> dict[str, Any]:
447
460
  local_client = get_tinybird_local_client(config, test=False, silent=True)
448
- meta, _data = _analyze(fixture_path, local_client, Path(fixture_path).suffix.lstrip("."))
461
+ meta, _data = _analyze(fixture_path, local_client, format)
449
462
  return meta
450
463
 
451
464
 
452
- def execute_cloud_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
465
+ def execute_query_cloud(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
453
466
  client = _get_tb_client(config["token"], config["host"])
454
467
  return client.query(sql=query, pipeline=pipe_name)
455
468
 
456
469
 
457
- def execute_local_query(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
470
+ def execute_query_local(config: dict[str, Any], query: str, pipe_name: Optional[str] = None) -> dict[str, Any]:
458
471
  local_client = get_tinybird_local_client(config, test=False, silent=True)
459
472
  return local_client.query(sql=query, pipeline=pipe_name)
460
473
 
@@ -471,3 +484,51 @@ def request_endpoint_local(
471
484
  ) -> dict[str, Any]:
472
485
  local_client = get_tinybird_local_client(config, test=False, silent=True)
473
486
  return local_client.pipe_data(endpoint_name, format="json", params=params)
487
+
488
+
489
+ def get_datasource_datafile_cloud(config: dict[str, Any], datasource_name: str) -> str:
490
+ try:
491
+ client = _get_tb_client(config["token"], config["host"])
492
+ return client.datasource_file(datasource_name)
493
+ except Exception:
494
+ return "Datasource not found"
495
+
496
+
497
+ def get_datasource_datafile_local(config: dict[str, Any], datasource_name: str) -> str:
498
+ try:
499
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
500
+ return local_client.datasource_file(datasource_name)
501
+ except Exception:
502
+ return "Datasource not found"
503
+
504
+
505
+ def get_pipe_datafile_cloud(config: dict[str, Any], pipe_name: str) -> str:
506
+ try:
507
+ client = _get_tb_client(config["token"], config["host"])
508
+ return client.pipe_file(pipe_name)
509
+ except Exception:
510
+ return "Pipe not found"
511
+
512
+
513
+ def get_pipe_datafile_local(config: dict[str, Any], pipe_name: str) -> str:
514
+ try:
515
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
516
+ return local_client.pipe_file(pipe_name)
517
+ except Exception:
518
+ return "Pipe not found"
519
+
520
+
521
+ def get_connection_datafile_cloud(config: dict[str, Any], connection_name: str) -> str:
522
+ try:
523
+ client = _get_tb_client(config["token"], config["host"])
524
+ return client.connection_file(connection_name)
525
+ except Exception:
526
+ return "Connection not found"
527
+
528
+
529
+ def get_connection_datafile_local(config: dict[str, Any], connection_name: str) -> str:
530
+ try:
531
+ local_client = get_tinybird_local_client(config, test=False, silent=True)
532
+ return local_client.connection_file(connection_name)
533
+ except Exception:
534
+ return "Connection not found"