tinybird 0.0.1.dev274__tar.gz → 0.0.1.dev276__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.dev274 → tinybird-0.0.1.dev276}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/feedback_manager.py +6 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/agent.py +50 -2
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/cli.py +1 -1
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/deployment_common.py +21 -5
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/llm.py +5 -1
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/cli.py +9 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/pipe.py +6 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/setup.cfg +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/datafile/common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/client.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/config.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/__init__.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/animations.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/banner.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/command_agent.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/compactor.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/explore_agent.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/memory.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/models.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/prompts.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/testing_agent.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/append.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/build.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/datafile.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/mock.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/plan.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/run_command.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/secret.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/test.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/utils.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/dev_server.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/info.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/mock_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -598,6 +598,12 @@ Ready? """
|
|
|
598
598
|
warning_confirm_delete_branch = prompt_message("Do you want to remove '{branch}' Branch?")
|
|
599
599
|
warning_confirm_delete_release = prompt_message("Do you want to remove Release {semver}?")
|
|
600
600
|
warning_confirm_rollback_release = prompt_message("Do you want to rollback current Release {semver} to {rollback}?")
|
|
601
|
+
warning_confirm_on_demand_compute = warning_message(
|
|
602
|
+
"On-demand compute will incur additional costs beyond your regular usage.\n"
|
|
603
|
+
"This feature uses dedicated compute resources that are billed separately.\n"
|
|
604
|
+
"You can read more about the pricing at https://www.tinybird.co/docs/classic/work-with-data/process-and-copy/materialized-views#compute-compute-separation-for-populates\n\n"
|
|
605
|
+
"Do you want to proceed with on-demand compute?"
|
|
606
|
+
)
|
|
601
607
|
|
|
602
608
|
warning_confirm_delete_token = prompt_message("Do you want to delete Token {token}?")
|
|
603
609
|
warning_confirm_refresh_token = prompt_message("Do you want to refresh Token {token}?")
|
|
@@ -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.dev276'
|
|
8
|
+
__revision__ = '6716ae6'
|
|
@@ -59,6 +59,7 @@ from tinybird.tb.modules.config import CLIConfig
|
|
|
59
59
|
from tinybird.tb.modules.deployment_common import create_deployment
|
|
60
60
|
from tinybird.tb.modules.exceptions import CLIBuildException, CLIDeploymentException, CLIMockException
|
|
61
61
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
62
|
+
from tinybird.tb.modules.llm import LLM
|
|
62
63
|
from tinybird.tb.modules.local_common import get_tinybird_local_client
|
|
63
64
|
from tinybird.tb.modules.login_common import login
|
|
64
65
|
from tinybird.tb.modules.mock_common import append_mock_data, create_mock_data
|
|
@@ -474,9 +475,13 @@ def run_agent(
|
|
|
474
475
|
click.echo(FeedbackManager.info(message="Message history cleared!"))
|
|
475
476
|
clear_messages()
|
|
476
477
|
continue
|
|
477
|
-
elif user_input
|
|
478
|
+
elif not is_natural_language(user_input, user_token, host):
|
|
478
479
|
query = f"SELECT * FROM ({user_input.strip()}) FORMAT JSON"
|
|
479
|
-
|
|
480
|
+
try:
|
|
481
|
+
result = execute_query_local(config, query=query)
|
|
482
|
+
except Exception as e:
|
|
483
|
+
click.echo(FeedbackManager.error(message=f"Error executing query: {e}"))
|
|
484
|
+
continue
|
|
480
485
|
stats = result["statistics"]
|
|
481
486
|
seconds = stats["elapsed"]
|
|
482
487
|
rows_read = humanfriendly.format_number(stats["rows_read"])
|
|
@@ -725,3 +730,46 @@ def get_pipe_data_test(client: TinyB, pipe_name: str, test_params: Optional[dict
|
|
|
725
730
|
"pipeline": pipe_name,
|
|
726
731
|
}
|
|
727
732
|
return client._req_raw(f"""/v0/sql?{urllib.parse.urlencode(params)}&{test_params}""")
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
def is_natural_language(user_input: str, user_token: str, host: str) -> bool:
|
|
736
|
+
stripped_input = user_input.strip().lower()
|
|
737
|
+
sql_keywords = ["select", "with"]
|
|
738
|
+
if not any(stripped_input.startswith(keyword) for keyword in sql_keywords):
|
|
739
|
+
return True
|
|
740
|
+
|
|
741
|
+
prompt = """Analyze the following text and determine if it's natural language or a SQL query.
|
|
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 (like SELECT, WITH, INSERT, UPDATE, DELETE, etc. statements).
|
|
744
|
+
|
|
745
|
+
Examples:
|
|
746
|
+
- "show me all users" -> NATURAL
|
|
747
|
+
- "what are the top products?" -> NATURAL
|
|
748
|
+
- "SELECT * FROM users" -> SQL
|
|
749
|
+
- "WITH cte AS (SELECT...) SELECT..." -> SQL
|
|
750
|
+
- "select count(*) from orders" -> SQL
|
|
751
|
+
- "help me analyze the data" -> NATURAL"""
|
|
752
|
+
|
|
753
|
+
try:
|
|
754
|
+
thinking_animation = ThinkingAnimation()
|
|
755
|
+
thinking_animation.start()
|
|
756
|
+
llm = LLM(user_token=user_token, host=host)
|
|
757
|
+
response_text = llm.ask(
|
|
758
|
+
system_prompt=prompt,
|
|
759
|
+
prompt=f"Text: '{user_input}'",
|
|
760
|
+
feature="tb_agent_is_natural_language",
|
|
761
|
+
model="vertex_ai/gemini-2.0-flash-001",
|
|
762
|
+
)
|
|
763
|
+
thinking_animation.stop()
|
|
764
|
+
if "NATURAL" in response_text:
|
|
765
|
+
return True
|
|
766
|
+
elif "SQL" in response_text:
|
|
767
|
+
return False
|
|
768
|
+
else:
|
|
769
|
+
# If unclear, default to natural language to be safe
|
|
770
|
+
return True
|
|
771
|
+
|
|
772
|
+
except Exception:
|
|
773
|
+
# If the LLM call fails, fall back to simple heuristics
|
|
774
|
+
# Check if it starts with common SQL keywords
|
|
775
|
+
return not any(stripped_input.startswith(keyword) for keyword in sql_keywords)
|
|
@@ -149,7 +149,7 @@ def cli(
|
|
|
149
149
|
if user_token:
|
|
150
150
|
config_temp.set_user_token(user_token)
|
|
151
151
|
if token or host or user_token:
|
|
152
|
-
try_update_config_with_remote(config_temp, auto_persist=
|
|
152
|
+
try_update_config_with_remote(config_temp, auto_persist=True, raise_on_errors=False)
|
|
153
153
|
|
|
154
154
|
# Overwrite token and host with env vars manually, without resorting to click.
|
|
155
155
|
#
|
|
@@ -19,11 +19,24 @@ from tinybird.tb.modules.project import Project
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
# TODO(eclbg): This should eventually end up in client.py, but we're not using it here yet.
|
|
22
|
-
def api_fetch(url: str, headers: dict) -> dict:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
def api_fetch(url: str, headers: dict, max_retries: int = 3, backoff_factor: float = 0.5) -> dict:
|
|
23
|
+
retries = 0
|
|
24
|
+
while retries <= max_retries:
|
|
25
|
+
try:
|
|
26
|
+
r = requests.get(url, headers=headers)
|
|
27
|
+
if r.status_code == 200:
|
|
28
|
+
logging.debug(json.dumps(r.json(), indent=2))
|
|
29
|
+
return r.json()
|
|
30
|
+
else:
|
|
31
|
+
raise Exception(f"Request failed with status code {r.status_code}")
|
|
32
|
+
except Exception:
|
|
33
|
+
retries += 1
|
|
34
|
+
if retries > max_retries:
|
|
35
|
+
break
|
|
36
|
+
|
|
37
|
+
wait_time = backoff_factor * (2 ** (retries - 1))
|
|
38
|
+
time.sleep(wait_time)
|
|
39
|
+
|
|
27
40
|
# Try to parse and print the error from the response
|
|
28
41
|
try:
|
|
29
42
|
result = r.json()
|
|
@@ -35,6 +48,7 @@ def api_fetch(url: str, headers: dict) -> dict:
|
|
|
35
48
|
message = "Error parsing response from API"
|
|
36
49
|
click.echo(FeedbackManager.error(message=message))
|
|
37
50
|
sys_exit("deployment_error", message)
|
|
51
|
+
|
|
38
52
|
return {}
|
|
39
53
|
|
|
40
54
|
|
|
@@ -48,6 +62,7 @@ def api_post(
|
|
|
48
62
|
if r.status_code < 300:
|
|
49
63
|
logging.debug(json.dumps(r.json(), indent=2))
|
|
50
64
|
return r.json()
|
|
65
|
+
|
|
51
66
|
# Try to parse and print the error from the response
|
|
52
67
|
try:
|
|
53
68
|
result = r.json()
|
|
@@ -61,6 +76,7 @@ def api_post(
|
|
|
61
76
|
message = "Error parsing response from API"
|
|
62
77
|
click.echo(FeedbackManager.error(message=message))
|
|
63
78
|
sys_exit("deployment_error", message)
|
|
79
|
+
|
|
64
80
|
return {}
|
|
65
81
|
|
|
66
82
|
|
|
@@ -20,13 +20,15 @@ class LLM:
|
|
|
20
20
|
self.host = host
|
|
21
21
|
self.user_token = user_token
|
|
22
22
|
|
|
23
|
-
def ask(self, system_prompt: str, prompt: str, feature: Optional[str] = None) -> str:
|
|
23
|
+
def ask(self, system_prompt: str, prompt: str, feature: Optional[str] = None, model: Optional[str] = None) -> str:
|
|
24
24
|
"""
|
|
25
25
|
Calls the model with the given prompt and returns the response.
|
|
26
26
|
|
|
27
27
|
Args:
|
|
28
28
|
system_prompt (str): The system prompt to send to the model.
|
|
29
29
|
prompt (str): The user prompt to send to the model.
|
|
30
|
+
feature (Optional[str]): The feature to send to the model.
|
|
31
|
+
model (Optional[str]): The model to use.
|
|
30
32
|
|
|
31
33
|
Returns:
|
|
32
34
|
str: The response from the language model.
|
|
@@ -36,6 +38,8 @@ class LLM:
|
|
|
36
38
|
params = {"origin": "cli"}
|
|
37
39
|
if feature:
|
|
38
40
|
params["feature"] = feature
|
|
41
|
+
if model:
|
|
42
|
+
params["model"] = model
|
|
39
43
|
cli_config = CLIConfig.get_project_config()
|
|
40
44
|
workspace_id = cli_config.get("id")
|
|
41
45
|
params_str = urllib.parse.urlencode(params)
|
|
@@ -643,6 +643,15 @@ async def push(
|
|
|
643
643
|
) -> None:
|
|
644
644
|
"""Push files to Tinybird."""
|
|
645
645
|
|
|
646
|
+
# Prompt for confirmation when on-demand compute is requested with populate
|
|
647
|
+
if (
|
|
648
|
+
populate
|
|
649
|
+
and on_demand_compute
|
|
650
|
+
and not click.confirm(FeedbackManager.warning_confirm_on_demand_compute(), default=False)
|
|
651
|
+
):
|
|
652
|
+
click.echo("Operation cancelled.")
|
|
653
|
+
return
|
|
654
|
+
|
|
646
655
|
ignore_sql_errors = FeatureFlags.ignore_sql_errors()
|
|
647
656
|
context.disable_template_security_validation.set(True)
|
|
648
657
|
|
|
@@ -253,6 +253,12 @@ async def pipe_populate(
|
|
|
253
253
|
on_demand_compute: bool,
|
|
254
254
|
):
|
|
255
255
|
"""Populate the result of a Materialized Node into the target Materialized View"""
|
|
256
|
+
|
|
257
|
+
# Prompt for confirmation when on-demand compute is requested
|
|
258
|
+
if on_demand_compute and not click.confirm(FeedbackManager.warning_confirm_on_demand_compute(), default=False):
|
|
259
|
+
click.echo("Operation cancelled.")
|
|
260
|
+
return
|
|
261
|
+
|
|
256
262
|
cl = create_tb_client(ctx)
|
|
257
263
|
|
|
258
264
|
pipe = await cl.pipe(pipe_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
|
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/deploy_check.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/diff_resource.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/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.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/request_endpoint.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/agent/tools/run_command.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
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/build_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/format_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/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
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/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
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev274 → tinybird-0.0.1.dev276}/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
|