tinybird 0.0.1.dev275__tar.gz → 0.0.1.dev277__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.dev275 → tinybird-0.0.1.dev277}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/agent.py +50 -2
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/llm.py +5 -1
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/workspace.py +1 -7
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/setup.cfg +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/datafile/common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/client.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/config.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/__init__.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/animations.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/banner.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/command_agent.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/compactor.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/explore_agent.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/memory.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/models.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/prompts.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/testing_agent.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/__init__.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/analyze.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/append.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/build.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/datafile.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/deploy.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/deploy_check.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/diff_resource.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/execute_query.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/get_endpoint_stats.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/get_openapi_definition.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/mock.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/plan.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/request_endpoint.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/run_command.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/secret.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/test.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/utils.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/build_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/cicd.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/create.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datasource.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/deployment_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/dev_server.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/info.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/login_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/mock.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/mock_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/secret_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/test.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/test_common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird.egg-info/top_level.txt +0 -0
|
@@ -4,5 +4,5 @@ __description__ = 'Tinybird Command Line Tool'
|
|
|
4
4
|
__url__ = 'https://www.tinybird.co/docs/forward/commands'
|
|
5
5
|
__author__ = 'Tinybird'
|
|
6
6
|
__author_email__ = 'support@tinybird.co'
|
|
7
|
-
__version__ = '0.0.1.
|
|
8
|
-
__revision__ = '
|
|
7
|
+
__version__ = '0.0.1.dev277'
|
|
8
|
+
__revision__ = 'f19b52a'
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -134,12 +134,6 @@ def workspace_current(ctx: Context):
|
|
|
134
134
|
|
|
135
135
|
@workspace.command(name="create", short_help="Create a new Workspace for your Tinybird user")
|
|
136
136
|
@click.argument("workspace_name", required=False)
|
|
137
|
-
@click.option(
|
|
138
|
-
"--fork",
|
|
139
|
-
is_flag=True,
|
|
140
|
-
default=False,
|
|
141
|
-
help="When enabled, tb will share all data sources from the current workspace with the new one",
|
|
142
|
-
)
|
|
143
137
|
@click.option(
|
|
144
138
|
"--organization-id",
|
|
145
139
|
"organization_id",
|
|
@@ -151,7 +145,6 @@ def workspace_current(ctx: Context):
|
|
|
151
145
|
def create_workspace(
|
|
152
146
|
ctx: Context,
|
|
153
147
|
workspace_name: str,
|
|
154
|
-
fork: bool,
|
|
155
148
|
organization_id: Optional[str],
|
|
156
149
|
) -> None:
|
|
157
150
|
config = CLIConfig.get_project_config()
|
|
@@ -165,6 +158,7 @@ def create_workspace(
|
|
|
165
158
|
|
|
166
159
|
config = CLIConfig.get_project_config()
|
|
167
160
|
user_token = config.get_user_token()
|
|
161
|
+
fork = False
|
|
168
162
|
|
|
169
163
|
if not user_token:
|
|
170
164
|
raise CLIWorkspaceException(
|
|
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
|
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/deploy_check.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/diff_resource.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/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.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/agent/tools/request_endpoint.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/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
|
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/build_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/format_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/datafile/pipe_checker.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb/modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev275 → tinybird-0.0.1.dev277}/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
|