tinybird 0.0.1.dev226__tar.gz → 0.0.1.dev228__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.
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/PKG-INFO +1 -1
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/__cli__.py +2 -2
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/cicd.py +1 -1
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/create.py +10 -8
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datasource.py +2 -1
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/feedback_manager.py +3 -3
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/llm.py +17 -4
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/mock.py +4 -2
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/test.py +1 -1
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird.egg-info/PKG-INFO +1 -1
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/setup.cfg +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/__cli__.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/ch_utils/constants.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/ch_utils/engine.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/check_pypi.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/client.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/config.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/connectors.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/context.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/datafile/common.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/datafile/exceptions.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/datafile/parse_connection.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/datafile/parse_datasource.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/datafile/parse_pipe.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/datatypes.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/feedback_manager.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/git_settings.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/prompts.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/sql.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/sql_template.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/sql_template_fmt.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/sql_toolset.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/syncasync.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/check_pypi.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/cli.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/client.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/config.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/build.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/cli.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/common.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/config.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/connection.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/copy.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/build.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/build_common.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/build_datasource.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/build_pipe.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/diff.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/fixture.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/format_common.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/format_datasource.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/format_pipe.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/pipe_checker.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/playground.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/pull.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/deployment.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/deprecations.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/dev_server.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/endpoint.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/info.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/infra.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/job.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/llm_utils.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/local.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/local_common.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/login.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/logout.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/materialization.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/open.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/pipe.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/project.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/regions.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/secret.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/shell.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/sink.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/table.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/token.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/watch.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/workspace.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/auth.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/branch.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/cicd.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/cli.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/common.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/config.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/connection.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/datasource.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/exceptions.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/fmt.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/job.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/pipe.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/regions.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/tag.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/telemetry.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/test.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/tinyunit/tinyunit.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/workspace.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/workspace_members.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tornado_template.py +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird.egg-info/SOURCES.txt +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird.egg-info/dependency_links.txt +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird.egg-info/entry_points.txt +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird.egg-info/requires.txt +0 -0
- {tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/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.dev228'
|
|
8
|
+
__revision__ = '1a9e75c'
|
|
@@ -177,7 +177,7 @@ class CICDGeneratorBase:
|
|
|
177
177
|
continue
|
|
178
178
|
with open(f"{path}/{cicd_file.full_path}", "wb") as f:
|
|
179
179
|
f.write(content)
|
|
180
|
-
click.echo(FeedbackManager.
|
|
180
|
+
click.echo(FeedbackManager.info_file_created(file=cicd_file.full_path.replace("./.", ".")))
|
|
181
181
|
if cicd_file.warning_message is not None:
|
|
182
182
|
return FeedbackManager.warning_for_cicd_file(
|
|
183
183
|
file_name=cicd_file.file_name, warning_message=cicd_file.warning_message.format(**params)
|
|
@@ -116,10 +116,11 @@ async def create(
|
|
|
116
116
|
readme_path.read_text(), tb_client.host, "$TB_ADMIN_TOKEN", all_resources_xml
|
|
117
117
|
),
|
|
118
118
|
prompt=readme_user_prompt,
|
|
119
|
+
feature="tb_create_readme",
|
|
119
120
|
)
|
|
120
121
|
readme_result = extract_xml(readme_response, "readme")
|
|
121
122
|
readme_path.write_text(readme_result)
|
|
122
|
-
click.echo(FeedbackManager.
|
|
123
|
+
click.echo(FeedbackManager.info_file_created(file="README.md"))
|
|
123
124
|
created_something = True
|
|
124
125
|
|
|
125
126
|
if data or prompt:
|
|
@@ -141,14 +142,14 @@ async def create(
|
|
|
141
142
|
if not already_has_cursor_rules(root_folder):
|
|
142
143
|
click.echo(FeedbackManager.highlight(message="\n» Creating rules..."))
|
|
143
144
|
create_rules(root_folder, "tb", agent)
|
|
144
|
-
click.echo(FeedbackManager.
|
|
145
|
+
click.echo(FeedbackManager.info_file_created(file=".cursorrules"))
|
|
145
146
|
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
146
147
|
created_something = True
|
|
147
148
|
|
|
148
149
|
if not already_has_claude_rules(root_folder):
|
|
149
150
|
click.echo(FeedbackManager.highlight(message="\n» Creating Claude Code rules..."))
|
|
150
151
|
create_claude_rules(root_folder, "tb")
|
|
151
|
-
click.echo(FeedbackManager.
|
|
152
|
+
click.echo(FeedbackManager.info_file_created(file="CLAUDE.md"))
|
|
152
153
|
click.echo(FeedbackManager.success(message="✓ Done!\n"))
|
|
153
154
|
created_something = True
|
|
154
155
|
|
|
@@ -169,7 +170,7 @@ async def create(
|
|
|
169
170
|
|
|
170
171
|
ds_name = ds_path.stem
|
|
171
172
|
datasource_path = Path(folder) / "datasources" / f"{ds_name}.datasource"
|
|
172
|
-
click.echo(FeedbackManager.
|
|
173
|
+
click.echo(FeedbackManager.info_file_created(file=f"fixtures/{ds_name}.{data_format}"))
|
|
173
174
|
persist_fixture(ds_name, data_content, folder, format=data_format)
|
|
174
175
|
click.echo(FeedbackManager.success(message="✓ Done!"))
|
|
175
176
|
created_something = True
|
|
@@ -195,7 +196,7 @@ async def create(
|
|
|
195
196
|
)
|
|
196
197
|
if mock_data:
|
|
197
198
|
persist_fixture(datasource_name, mock_data, folder, format="ndjson")
|
|
198
|
-
click.echo(FeedbackManager.
|
|
199
|
+
click.echo(FeedbackManager.info_file_created(file=f"fixtures/{datasource_name}.ndjson"))
|
|
199
200
|
click.echo(FeedbackManager.success(message="✓ Done!"))
|
|
200
201
|
created_something = True
|
|
201
202
|
|
|
@@ -284,7 +285,7 @@ def create_project_structure(folder: str):
|
|
|
284
285
|
f = folder_path / path
|
|
285
286
|
f.mkdir()
|
|
286
287
|
click.echo(
|
|
287
|
-
FeedbackManager.info(message=f"
|
|
288
|
+
FeedbackManager.info(message=f"./{x} ") + FeedbackManager.gray(message=PROJECT_PATHS_DESCRIPTIONS[x])
|
|
288
289
|
)
|
|
289
290
|
except FileExistsError:
|
|
290
291
|
pass
|
|
@@ -295,6 +296,7 @@ async def create_resources_from_prompt(
|
|
|
295
296
|
user_token: str,
|
|
296
297
|
prompt: str,
|
|
297
298
|
project: Project,
|
|
299
|
+
feature: str = "tb_create_resources",
|
|
298
300
|
) -> List[Path]:
|
|
299
301
|
result: List[Path] = []
|
|
300
302
|
datasource_paths = [Path(ds_file) for ds_file in project.get_datasource_files()]
|
|
@@ -325,7 +327,7 @@ async def create_resources_from_prompt(
|
|
|
325
327
|
]
|
|
326
328
|
)
|
|
327
329
|
llm = LLM(user_token=user_token, host=tb_client.host)
|
|
328
|
-
prompt_result = llm.ask(system_prompt=create_prompt(resources_xml), prompt=prompt)
|
|
330
|
+
prompt_result = llm.ask(system_prompt=create_prompt(resources_xml), prompt=prompt, feature=feature)
|
|
329
331
|
prompt_result = extract_xml(prompt_result, "response")
|
|
330
332
|
resources = parse_xml(prompt_result, "resource")
|
|
331
333
|
datasources = []
|
|
@@ -384,7 +386,7 @@ def init_git(folder: str):
|
|
|
384
386
|
else:
|
|
385
387
|
gitignore_file.write_text(".tinyb\n.terraform\n")
|
|
386
388
|
|
|
387
|
-
click.echo(FeedbackManager.
|
|
389
|
+
click.echo(FeedbackManager.info_file_created(file=".gitignore"))
|
|
388
390
|
except Exception as e:
|
|
389
391
|
raise Exception(f"Error initializing Git: {e}")
|
|
390
392
|
|
|
@@ -781,7 +781,7 @@ async def datasource_create(
|
|
|
781
781
|
raise Exception("This action requires authentication. Run 'tb login' first.")
|
|
782
782
|
project_config = CLIConfig.get_project_config()
|
|
783
783
|
tb_client: TinyB = project_config.get_client(token=config.get("token"), host=config.get("host"))
|
|
784
|
-
await create_resources_from_prompt(tb_client, user_token, prompt, project)
|
|
784
|
+
await create_resources_from_prompt(tb_client, user_token, prompt, project, feature="tb_datasource_create")
|
|
785
785
|
click.echo(FeedbackManager.success(message="✓ .datasource created!"))
|
|
786
786
|
return
|
|
787
787
|
|
|
@@ -1023,6 +1023,7 @@ async def analyze_quarantine(datasource_name: str, project: Project, client: Tin
|
|
|
1023
1023
|
response_llm = llm.ask(
|
|
1024
1024
|
system_prompt=quarantine_prompt(datasource_definition),
|
|
1025
1025
|
prompt=f"The quarantine errors are:\n{json.dumps(quarantine_data)}",
|
|
1026
|
+
feature="tb_datasource_append_analyze_quarantine",
|
|
1026
1027
|
)
|
|
1027
1028
|
response = extract_xml(response_llm, "quarantine_errors")
|
|
1028
1029
|
error_message += "\n" + response
|
|
@@ -895,9 +895,9 @@ STEP 3: ADD KEY TO SERVICE ACCOUNT
|
|
|
895
895
|
info_removing_pipe = info_message("** Removing pipe {pipe}")
|
|
896
896
|
info_removing_pipe_not_found = info_message("** {pipe} not found")
|
|
897
897
|
info_dry_removing_pipe = info_message("** [DRY RUN] Removing pipe {pipe}")
|
|
898
|
-
info_path_created = info_message("
|
|
899
|
-
info_file_created = info_message("
|
|
900
|
-
info_path_already_exists = info_message("
|
|
898
|
+
info_path_created = info_message("./{path}")
|
|
899
|
+
info_file_created = info_message("./{file}")
|
|
900
|
+
info_path_already_exists = info_message("./{path} already exists, skipping")
|
|
901
901
|
info_dottinyb_already_ignored = info_message("** - '.tinyb' already in .gitignore, skipping")
|
|
902
902
|
info_dotdifftemp_already_ignored = info_message("** - '.diff_tmp' not found or already in .gitignore, skipping")
|
|
903
903
|
info_dottinyenv_already_exists = info_message("** - '.tinyenv' already exists, skipping")
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import urllib.parse
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
1
4
|
import requests
|
|
2
5
|
|
|
6
|
+
from tinybird.tb.modules.cli import CLIConfig
|
|
3
7
|
from tinybird.tb.modules.feedback_manager import FeedbackManager
|
|
4
8
|
|
|
5
9
|
|
|
@@ -16,7 +20,7 @@ class LLM:
|
|
|
16
20
|
self.host = host
|
|
17
21
|
self.user_token = user_token
|
|
18
22
|
|
|
19
|
-
def ask(self, system_prompt: str, prompt: str) -> str:
|
|
23
|
+
def ask(self, system_prompt: str, prompt: str, feature: Optional[str] = None) -> str:
|
|
20
24
|
"""
|
|
21
25
|
Calls the model with the given prompt and returns the response.
|
|
22
26
|
|
|
@@ -29,14 +33,23 @@ class LLM:
|
|
|
29
33
|
"""
|
|
30
34
|
|
|
31
35
|
data = {"system": system_prompt, "prompt": prompt}
|
|
32
|
-
|
|
36
|
+
params = {"origin": "cli"}
|
|
37
|
+
if feature:
|
|
38
|
+
params["feature"] = feature
|
|
39
|
+
cli_config = CLIConfig.get_project_config()
|
|
40
|
+
workspace_id = cli_config.get("id")
|
|
41
|
+
params_str = urllib.parse.urlencode(params)
|
|
42
|
+
if workspace_id:
|
|
43
|
+
llm_url = f"{self.host}/v0/llm/{workspace_id}?{params_str}"
|
|
44
|
+
else:
|
|
45
|
+
llm_url = f"{self.host}/v0/llm?{params_str}"
|
|
33
46
|
response = requests.post(
|
|
34
|
-
|
|
47
|
+
llm_url,
|
|
35
48
|
headers={"Authorization": f"Bearer {self.user_token}"},
|
|
36
49
|
data=data,
|
|
37
50
|
)
|
|
38
51
|
|
|
39
52
|
if not response.ok:
|
|
40
|
-
raise LLMException(FeedbackManager.
|
|
53
|
+
raise LLMException(FeedbackManager.error(message=response.text))
|
|
41
54
|
|
|
42
55
|
return response.json().get("result", "")
|
|
@@ -132,7 +132,7 @@ async def create_mock_data(
|
|
|
132
132
|
sql_path = None
|
|
133
133
|
while True:
|
|
134
134
|
try:
|
|
135
|
-
response = llm.ask(system_prompt=mock_prompt(rows, error), prompt=prompt)
|
|
135
|
+
response = llm.ask(system_prompt=mock_prompt(rows, error), prompt=prompt, feature="tb_mock")
|
|
136
136
|
sql = extract_xml(response, "sql")
|
|
137
137
|
sql_path = persist_fixture_sql(datasource_name, sql, folder)
|
|
138
138
|
sql_format = "JSON" if format_ == "ndjson" else "CSV"
|
|
@@ -149,7 +149,9 @@ async def create_mock_data(
|
|
|
149
149
|
error = str(e)
|
|
150
150
|
attempts += 1
|
|
151
151
|
if attempts > 5:
|
|
152
|
-
raise Exception(
|
|
152
|
+
raise Exception(
|
|
153
|
+
f"Failed to generate a valid solution. Check {str(sql_path or '.sql path')} and try again."
|
|
154
|
+
)
|
|
153
155
|
else:
|
|
154
156
|
continue
|
|
155
157
|
return data
|
|
@@ -102,7 +102,7 @@ def test_create(ctx: click.Context, name_or_filename: str, prompt: str) -> None:
|
|
|
102
102
|
raise Exception("No user token found")
|
|
103
103
|
|
|
104
104
|
llm = LLM(user_token=user_token, host=config.get_client().host)
|
|
105
|
-
response_llm = llm.ask(system_prompt=system_prompt, prompt=prompt)
|
|
105
|
+
response_llm = llm.ask(system_prompt=system_prompt, prompt=prompt, feature="tb_test_create")
|
|
106
106
|
response_xml = extract_xml(response_llm, "response")
|
|
107
107
|
tests_content = parse_xml(response_xml, "test")
|
|
108
108
|
|
|
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.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/build_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/build_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/format_common.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/datafile/format_datasource.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/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
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb/modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/tinyunit/tinyunit.py
RENAMED
|
File without changes
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/tinybird/tb_cli_modules/tinyunit/tinyunit_lib.py
RENAMED
|
File without changes
|
|
File without changes
|
{tinybird-0.0.1.dev226 → tinybird-0.0.1.dev228}/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
|