@marimo-team/islands 0.23.9-dev20 → 0.23.9-dev22
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.
- package/dist/{chat-ui-s5fKbcIr.js → chat-ui-BW28GQUq.js} +2 -2
- package/dist/{code-visibility-DvMXzzJz.js → code-visibility-smy6VSJ-.js} +2 -2
- package/dist/{html-to-image-CTU_-PnW.js → html-to-image-Bi7maU1p.js} +6 -1
- package/dist/main.js +5 -5
- package/dist/{process-output-CVDHJqo6.js → process-output-BimQ_hG4.js} +1 -1
- package/dist/{reveal-component-Dskn4JVk.js → reveal-component-B0ZyILyK.js} +2 -2
- package/package.json +1 -1
- package/src/components/ai/__tests__/ai-utils.test.ts +43 -38
- package/src/components/ai/ai-model-dropdown.tsx +2 -2
- package/src/components/app-config/ai-config.tsx +1 -1
- package/src/components/databases/display.tsx +2 -0
- package/src/components/datasources/__tests__/utils.test.ts +82 -0
- package/src/components/datasources/utils.ts +16 -15
- package/src/core/ai/__tests__/model-registry.test.ts +72 -60
- package/src/core/ai/model-registry.ts +33 -28
- package/src/core/codemirror/format.ts +1 -0
- package/src/core/codemirror/language/languages/sql/sql.ts +1 -0
- package/src/core/codemirror/language/languages/sql/utils.ts +2 -0
|
@@ -6,13 +6,13 @@ import { _ as Logger, c as Objects, g as cn, l as useEventListener, t as Button
|
|
|
6
6
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
7
7
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
8
8
|
import { r as toast } from "./copy-BuQpJEzp.js";
|
|
9
|
-
import { C as AccordionContent, D as ChatBubbleIcon, En as Trash2, Ft as jotaiJsonStorage, G as cellErrorsAtom, Ht as allTablesAtom, In as ExternalLink, It as variablesAtom, Kt as getRequestClient, Lt as PluralWord, Nn as Info, Ot as moveToEndOfEditor, P as base64ToDataURL, Pn as FileText, S as Accordion, T as AccordionTrigger, Tn as Wrench, Tt as createVariableInfoElement, Ut as dataSourceConnectionsAtom, V as renderHTML, Wt as getTableType, Xt as singleFacet, Y as notebookAtom, _ as Boosts, _n as atomWithStorage, b as AIContextProvider, c as Popover, d as PopoverTrigger, f as isOutputEmpty, h as DatasourceContextProvider, jn as LoaderCircle, jt as generateUUID, n as Spinner, on as CellOutputId, r as MarkdownRenderer, t as toPng, tn as ZodLocalStorage, u as PopoverContent, v as Sections, vt as displayCellName, w as AccordionItem, x as AIContextRegistry, y as contextToXml, yn as Anchor2, zn as CircleX } from "./html-to-image-
|
|
9
|
+
import { C as AccordionContent, D as ChatBubbleIcon, En as Trash2, Ft as jotaiJsonStorage, G as cellErrorsAtom, Ht as allTablesAtom, In as ExternalLink, It as variablesAtom, Kt as getRequestClient, Lt as PluralWord, Nn as Info, Ot as moveToEndOfEditor, P as base64ToDataURL, Pn as FileText, S as Accordion, T as AccordionTrigger, Tn as Wrench, Tt as createVariableInfoElement, Ut as dataSourceConnectionsAtom, V as renderHTML, Wt as getTableType, Xt as singleFacet, Y as notebookAtom, _ as Boosts, _n as atomWithStorage, b as AIContextProvider, c as Popover, d as PopoverTrigger, f as isOutputEmpty, h as DatasourceContextProvider, jn as LoaderCircle, jt as generateUUID, n as Spinner, on as CellOutputId, r as MarkdownRenderer, t as toPng, tn as ZodLocalStorage, u as PopoverContent, v as Sections, vt as displayCellName, w as AccordionItem, x as AIContextRegistry, y as contextToXml, yn as Anchor2, zn as CircleX } from "./html-to-image-Bi7maU1p.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
11
11
|
import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
12
12
|
import { F as X, L as ChevronDown, S as logNever, t as Strings } from "./strings-Bu3vlb6W.js";
|
|
13
13
|
import { a as NumberField, b as DropdownMenuTrigger, d as DropdownMenuContent, p as DropdownMenuItem, r as Input, u as DropdownMenu } from "./input-BwcGY_X1.js";
|
|
14
14
|
import { p as isUrl, v as CircleQuestionMark } from "./toDate-DNWCUEQp.js";
|
|
15
|
-
import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-
|
|
15
|
+
import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-BimQ_hG4.js";
|
|
16
16
|
import "./react-dom-BTJzcVJ9.js";
|
|
17
17
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
18
18
|
import { A as looseObject, B as union, C as any, D as discriminatedUnion, E as custom, H as safeParseAsync, I as record, L as strictObject, M as never, N as number, O as lazy, P as object$1, R as string, S as _null, T as boolean, V as unknown, W as toJSONSchema, b as _enum, k as literal, w as array$1, x as _instanceof } from "./zod-CoBiJ5v4.js";
|
|
@@ -6,7 +6,7 @@ import { _ as Logger, c as Objects, g as cn, h as Events, m as useComposedRefs,
|
|
|
6
6
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
7
7
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
8
8
|
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BuQpJEzp.js";
|
|
9
|
-
import { $ as useCellActions, $t as getTracebackInfo, A as ChevronRightIcon, An as Minus, C as AccordionContent, En as Trash2, Ft as jotaiJsonStorage, Hn as esm_default, I as base64ToUint8Array, In as ExternalLink, Jt as useRequestClient, Kt as getRequestClient, Lt as PluralWord, M as PinLeftIcon, Mt as useChromeActions, N as PinRightIcon, Nn as Info, O as CheckIcon, Pn as FileText, Pt as adaptForLocalStorage, Qt as extractAllTracebackInfo, R as extractBase64FromDataURL, S as Accordion, St as Checkbox, T as AccordionTrigger, Tn as Wrench, Un as import_lib, V as renderHTML, Vn as Braces, Y as notebookAtom, Zt as elementContainsMarimoCellFile, _n as atomWithStorage, _t as getCellDomProps, at as AnsiUp, bn as Close$1, c as Popover, cn as SCRATCH_CELL_ID, ct as kioskModeAtom, d as PopoverTrigger, dt as outputIsLoading, et as useCellIds, g as getDatasourceContext, gt as DATA_CELL_ID, hn as jsonToTSV, ht as sanitizeHtml, j as DotFilledIcon, jn as LoaderCircle, kn as NotebookPen, kt as goToCellLine, l as PopoverClose, lt as useInstallAllowed, m as useExpandedOutput, mn as jsonToMarkdown, n as Spinner, nn as filenameAtom, on as CellOutputId, pn as jsonParseWithSpecialChar, q as getCellEditorView, r as MarkdownRenderer, sn as HTMLCellId, t as toPng, tt as useCellNames, u as PopoverContent, ut as viewStateAtom, vt as displayCellName, w as AccordionItem, z as isDataURLString, zn as CircleX, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-
|
|
9
|
+
import { $ as useCellActions, $t as getTracebackInfo, A as ChevronRightIcon, An as Minus, C as AccordionContent, En as Trash2, Ft as jotaiJsonStorage, Hn as esm_default, I as base64ToUint8Array, In as ExternalLink, Jt as useRequestClient, Kt as getRequestClient, Lt as PluralWord, M as PinLeftIcon, Mt as useChromeActions, N as PinRightIcon, Nn as Info, O as CheckIcon, Pn as FileText, Pt as adaptForLocalStorage, Qt as extractAllTracebackInfo, R as extractBase64FromDataURL, S as Accordion, St as Checkbox, T as AccordionTrigger, Tn as Wrench, Un as import_lib, V as renderHTML, Vn as Braces, Y as notebookAtom, Zt as elementContainsMarimoCellFile, _n as atomWithStorage, _t as getCellDomProps, at as AnsiUp, bn as Close$1, c as Popover, cn as SCRATCH_CELL_ID, ct as kioskModeAtom, d as PopoverTrigger, dt as outputIsLoading, et as useCellIds, g as getDatasourceContext, gt as DATA_CELL_ID, hn as jsonToTSV, ht as sanitizeHtml, j as DotFilledIcon, jn as LoaderCircle, kn as NotebookPen, kt as goToCellLine, l as PopoverClose, lt as useInstallAllowed, m as useExpandedOutput, mn as jsonToMarkdown, n as Spinner, nn as filenameAtom, on as CellOutputId, pn as jsonParseWithSpecialChar, q as getCellEditorView, r as MarkdownRenderer, sn as HTMLCellId, t as toPng, tt as useCellNames, u as PopoverContent, ut as viewStateAtom, vt as displayCellName, w as AccordionItem, z as isDataURLString, zn as CircleX, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-Bi7maU1p.js";
|
|
10
10
|
import { o as useSize, u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
11
11
|
import { c as Calendar, i as createReducerAndAtoms, r as Badge } from "./useLifecycle-B81PFEja.js";
|
|
12
12
|
import { a as ListFilter, i as Table$1, n as $fb18d541ea1ad717$export$ad991b66133851cf, o as ChartPie, r as $5a387cc49350e6db$export$722debc0e56fea39, t as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from "./useDateFormatter-BA4FCquG.js";
|
|
@@ -34996,7 +34996,7 @@ ${d}`,
|
|
|
34996
34996
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
34997
34997
|
}
|
|
34998
34998
|
}
|
|
34999
|
-
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.9-
|
|
34999
|
+
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.9-dev22");
|
|
35000
35000
|
showCodeInRunModeAtom = atom(true);
|
|
35001
35001
|
atom(null);
|
|
35002
35002
|
var import_compiler_runtime = require_compiler_runtime();
|
|
@@ -7673,7 +7673,7 @@ ${r.join("\n")}`;
|
|
|
7673
7673
|
keywords: "percentile_cont row_number rank dense_rank rank_dense percent_rank cume_dist ntile lag lead first_value last_value nth_value !__postfix !~~ !~~* % & && * ** + - ->> / // <-> << <=> <@ >> @ @> Calendar JSON TimeZone ^ ^@ abort abs absolute access access_mode acos acosh action add add_parquet_key admin after age aggregate alias all all_profiling_output allow_community_extensions allow_extensions_metadata_mismatch allow_persistent_secrets allow_unredacted_secrets allow_unsigned_extensions allowed_directories allowed_paths also alter always analyse analyze and anti any any_value apply approx_count_distinct approx_quantile approx_top_k arbitrary arg_max arg_max_null arg_min arg_min_null argmax argmin array array_agg array_aggr array_aggregate array_append array_apply array_cat array_concat array_contains array_cosine_distance array_cosine_similarity array_cross_product array_distance array_distinct array_dot_product array_extract array_filter array_grade_up array_has array_has_all array_has_any array_indexof array_inner_product array_intersect array_length array_negative_dot_product array_negative_inner_product array_pop_back array_pop_front array_position array_prepend array_push_back array_push_front array_reduce array_resize array_reverse array_reverse_sort array_select array_slice array_sort array_to_json array_to_string array_to_string_comma_default array_transform array_unique array_value array_where array_zip arrow_large_buffer_size arrow_lossless_conversion arrow_output_list_view arrow_output_version arrow_scan arrow_scan_dumb as asc ascii asin asinh asof asof_loop_join_threshold assertion assignment asymmetric at atan atan2 atanh attach attribute authorization autoinstall_extension_repository autoinstall_known_extensions autoload_known_extensions avg backward bar base64 before begin between bigint bin binary binary_as_string bit bit_and bit_count bit_length bit_or bit_position bit_xor bitstring bitstring_agg blob bool bool_and bool_or boolean both bpchar by bytea cache call called can_cast_implicitly cardinality cascade cascaded case cast cast_to_type catalog catalog_error_max_schemas cbrt ceil ceiling centuries century chain char char_length character character_length characteristics check checkpoint checkpoint_threshold chr class close cluster coalesce col_description collate collation collations column columns combine comment comments commit committed compression concat concat_ws concurrently configuration conflict connection constant_or_null constraint constraints contains content continue conversion copy copy_database corr cos cosh cost cot count count_if count_star countif covar_pop covar_samp create create_sort_key cross csv cube current current_catalog current_connection_id current_database current_date current_localtime current_localtimestamp current_query current_query_id current_role current_schema current_schemas current_setting current_transaction_id current_user currval cursor custom_extension_repository custom_profiling_settings custom_user_agent cycle damerau_levenshtein data database database_list database_size date date_add date_diff date_part date_sub date_trunc datediff datepart datesub datetime datetrunc day dayname dayofmonth dayofweek dayofyear days deallocate debug_asof_iejoin debug_checkpoint_abort debug_force_external debug_force_no_cross_product debug_skip_checkpoint_on_commit debug_verify_vector debug_window_mode dec decade decades decimal declare decode default default_block_size default_collation default_null_order default_order default_secret_storage defaults deferrable deferred definer degrees delete delimiter delimiters depends desc describe detach dictionary disable disable_checkpoint_on_shutdown disable_logging disable_object_cache disable_optimizer disable_parquet_prefetching disable_print_progress_bar disable_profile disable_profiling disable_progress_bar disable_timestamptz_casts disable_verification disable_verify_external disable_verify_fetch_row disable_verify_parallelism disable_verify_serializer disabled_compression_methods disabled_filesystems disabled_log_types disabled_optimizers discard distinct divide do document domain double drop duckdb_api duckdb_columns duckdb_constraints duckdb_databases duckdb_dependencies duckdb_extensions duckdb_external_file_cache duckdb_functions duckdb_indexes duckdb_keywords duckdb_log_contexts duckdb_logs duckdb_logs_parsed duckdb_memory duckdb_optimizers duckdb_prepared_statements duckdb_schemas duckdb_secret_types duckdb_secrets duckdb_sequences duckdb_settings duckdb_table_sample duckdb_tables duckdb_temporary_files duckdb_types duckdb_variables duckdb_views dynamic_or_filter_threshold each editdist3 element_at else enable enable_checkpoint_on_shutdown enable_external_access enable_external_file_cache enable_fsst_vectors enable_geoparquet_conversion enable_http_logging enable_http_metadata_cache enable_logging enable_macro_dependencies enable_object_cache enable_optimizer enable_print_progress_bar enable_profile enable_profiling enable_progress_bar enable_progress_bar_print enable_verification enable_view_dependencies enabled_log_types encode encoding encrypted end ends_with entropy enum enum_code enum_first enum_last enum_range enum_range_boundary epoch epoch_ms epoch_ns epoch_us equi_width_bins era error errors_as_json escape even event except exclude excluding exclusive execute exists exp explain explain_output export export_state extension extension_directory extension_versions extensions external external_threads extract factorial false family favg fdiv fetch file_search_path filter finalize first flatten float float4 float8 floor fmod following for force force_bitpacking_mode force_checkpoint force_compression foreign format formatReadableDecimalSize formatReadableSize format_bytes format_pg_type format_type forward freeze from from_base64 from_binary from_hex from_json from_json_strict fsum full function functions gamma gcd gen_random_uuid generate_series generate_subscripts generated geomean geometric_mean get_bit get_block_size get_current_time get_current_timestamp getvariable glob global grade_up grant granted greatest greatest_common_divisor group group_concat grouping grouping_id groups guid hamming handler having header hex histogram histogram_exact histogram_values hold home_directory hour hours http_logging_output http_proxy http_proxy_password http_proxy_username hugeint identity ieee_floating_point_ops if ignore ilike ilike_escape immediate immediate_transaction_mode immutable implicit import import_database in in_search_path include including increment index index_scan_max_count index_scan_percentage indexes inet_client_addr inet_client_port inet_server_addr inet_server_port inherit inherits initially inline inner inout input insensitive insert install instead instr int int1 int128 int16 int2 int32 int4 int64 int8 integer integer_division integral intersect interval into invoker is is_histogram_other_bin isfinite isinf isnan isnull isodow isolation isoyear jaccard jaro_similarity jaro_winkler_similarity join json json_array json_array_length json_contains json_deserialize_sql json_each json_execute_serialized_sql json_exists json_extract json_extract_path json_extract_path_text json_extract_string json_group_array json_group_object json_group_structure json_keys json_merge_patch json_object json_pretty json_quote json_serialize_plan json_serialize_sql json_structure json_transform json_transform_strict json_tree json_type json_valid json_value julian kahan_sum key kurtosis kurtosis_pop label lambda lambda_syntax language large last last_day late_materialization_max_rows lateral lcase lcm leading leakproof least least_common_multiple left left_grapheme len length length_grapheme level levenshtein lgamma like like_escape limit list list_aggr list_aggregate list_any_value list_append list_apply list_approx_count_distinct list_avg list_bit_and list_bit_or list_bit_xor list_bool_and list_bool_or list_cat list_concat list_contains list_cosine_distance list_cosine_similarity list_count list_distance list_distinct list_dot_product list_element list_entropy list_extract list_filter list_first list_grade_up list_has list_has_all list_has_any list_histogram list_indexof list_inner_product list_intersect list_kurtosis list_kurtosis_pop list_last list_mad list_max list_median list_min list_mode list_negative_dot_product list_negative_inner_product list_pack list_position list_prepend list_product list_reduce list_resize list_reverse list_reverse_sort list_select list_sem list_skewness list_slice list_sort list_stddev_pop list_stddev_samp list_string_agg list_sum list_transform list_unique list_value list_var_pop list_var_samp list_where list_zip listagg listen ln load local location lock lock_configuration locked log log10 log2 log_query_path logged logging_level logging_mode logging_storage logical long lower lpad ltrim macro mad make_date make_time make_timestamp make_timestamp_ns make_timestamptz map map_concat map_contains map_contains_entry map_contains_value map_entries map_extract map_extract_value map_from_entries map_keys map_to_pg_oid map_values mapping match materialized max max_by max_expression_depth max_memory max_temp_directory_size max_vacuum_tasks maxvalue md5 md5_number md5_number_lower md5_number_upper mean median memory_limit merge_join_threshold metadata_info method microsecond microseconds millennia millennium millisecond milliseconds min min_by minute minutes minvalue mismatches mod mode month monthname months move multiply name names nanosecond national natural nchar nested_loop_join_threshold new next nextafter nextval nfc_normalize no none normalized_interval not not_ilike_escape not_like_escape nothing notify notnull now nowait null null_order nullif nulls numeric nvarchar obj_description object octet_length of off offset oid oids old old_implicit_casting on only operator option options or ord order order_by_non_integer_literal ordered_aggregate_threshold ordinality others out outer over overlaps overlay overriding owned owner pandas_analyze_sample pandas_scan parallel parquet_bloom_probe parquet_file_metadata parquet_kv_metadata parquet_metadata parquet_metadata_cache parquet_scan parquet_schema parse_dirname parse_dirpath parse_duckdb_log_message parse_filename parse_path parser partial partition partitioned partitioned_write_flush_threshold partitioned_write_max_open_files passing password percent perfect_ht_threshold persistent pi pivot pivot_filter_threshold pivot_limit pivot_longer pivot_wider placing plans platform policy position positional pow power pragma pragma_collations pragma_database_size pragma_metadata_info pragma_platform pragma_show pragma_storage_info pragma_table_info pragma_user_agent pragma_version preceding precision prefer_range_joins prefetch_all_parquet_files prefix prepare prepared preserve preserve_identifier_case preserve_insertion_order primary printf prior privileges procedural procedure produce_arrow_string_view product profile_output profiling_mode profiling_output program progress_bar_time publication python_enable_replacements python_map_function python_scan_all_frames qualify quantile quantile_cont quantile_disc quarter quarters query query_table quote radians random range read read_blob read_csv read_csv_auto read_json read_json_auto read_json_objects read_json_objects_auto read_ndjson read_ndjson_auto read_ndjson_objects read_parquet read_text real reassign recheck recursive reduce ref references referencing refresh regexp_escape regexp_extract regexp_extract_all regexp_full_match regexp_matches regexp_replace regexp_split_to_array regexp_split_to_table regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release remap_struct rename repeat repeat_row repeatable replace replica reservoir_quantile reset respect restart restrict returning returns reverse revoke right right_grapheme role rollback rollup round round_even roundbankers row row_to_json rows rpad rtrim rule sample savepoint scalar_subquery_error_on_multiple_rows scheduler_process_partial schema schemas scope scroll search search_path second seconds secret secret_directory security select sem semi seq_scan sequence sequences serializable server session session_user set set_bit setof sets setseed sha1 sha256 share shobj_description short show show_databases show_tables show_tables_expanded sign signbit signed similar simple sin sinh skewness skip smallint snapshot sniff_csv some sorted split split_part sql sqrt stable standalone start starts_with statement statistics stats stddev stddev_pop stddev_samp stdin stdout storage storage_compatibility_version storage_info stored str_split str_split_regex streaming_buffer_size strftime strict string string_agg string_split string_split_regex string_to_array strip strip_accents strlen strpos strptime struct struct_concat struct_extract struct_extract_at struct_insert struct_pack subscription substr substring substring_grapheme subtract suffix sum sum_no_overflow sumkahan summarize summary symmetric sysid system table table_info tables tablesample tablespace tan tanh temp temp_directory template temporary test_all_types test_vector_types text then threads ties time time_bucket timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz timetz_byte_comparable timezone timezone_hour timezone_minute tinyint to to_base to_base64 to_binary to_centuries to_days to_decades to_hex to_hours to_json to_microseconds to_millennia to_milliseconds to_minutes to_months to_quarters to_seconds to_timestamp to_weeks to_years today trailing transaction transaction_timestamp transform translate treat trigger trim true trunc truncate truncate_duckdb_logs trusted try_cast try_strptime txid_current type typeof types ubigint ucase uhugeint uint128 uint16 uint32 uint64 uint8 uinteger unbin unbounded uncommitted unencrypted unhex unicode union union_extract union_tag union_value unique unknown unlisten unlogged unnest unpack unpivot unpivot_list until update upper url_decode url_encode use user user_agent username using usmallint utinyint uuid uuid_extract_timestamp uuid_extract_version uuidv4 uuidv7 vacuum valid validate validator value values var_pop var_samp varbinary varchar variable variadic variance varint varying vector_type verbose verify_external verify_fetch_row verify_parallelism verify_serializer version view views virtual volatile wal_autocheckpoint wavg week weekday weekofyear weeks weighted_avg when where which_secret whitespace window with within without work worker_threads wrapper write write_log xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlnamespaces xmlparse xmlpi xmlroot xmlserialize xmltable xor year years yearweek yes zone zstd_min_string_length | || ~ ~~ ~~* ~~~",
|
|
7674
7674
|
types: "JSON bigint binary bit bitstring blob bool boolean bpchar bytea char date datetime dec decimal double enum float float4 float8 guid hugeint int int1 int128 int16 int2 int32 int4 int64 int8 integer integral interval list logical long map null numeric nvarchar oid real row short signed smallint string struct text time timestamp timestamp_ms timestamp_ns timestamp_s timestamp_us timestamptz timetz tinyint ubigint uhugeint uint128 uint16 uint32 uint64 uint8 uinteger union usmallint utinyint uuid varbinary varchar varint"
|
|
7675
7675
|
});
|
|
7676
|
-
var KNOWN_DIALECTS = new Set("postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server".split("."));
|
|
7676
|
+
var KNOWN_DIALECTS = new Set("postgresql.postgres.couchbase.db2.db2i.tidb.mysql.sqlite.mssql.sqlserver.duckdb.mariadb.cassandra.noql.spark.awsathena.athena.bigquery.hive.redshift.snowflake.flink.mongodb.trino.oracle.oracledb.singlestoredb.timescaledb.databricks.datafusion.microsoft sql server.dremio".split("."));
|
|
7677
7677
|
function isKnownDialect(e) {
|
|
7678
7678
|
return KNOWN_DIALECTS.has(e);
|
|
7679
7679
|
}
|
|
@@ -7724,6 +7724,7 @@ ${r.join("\n")}`;
|
|
|
7724
7724
|
case "spark":
|
|
7725
7725
|
case "databricks":
|
|
7726
7726
|
case "datafusion":
|
|
7727
|
+
case "dremio":
|
|
7727
7728
|
return Logger.debug("Unsupported dialect", {
|
|
7728
7729
|
dialect: t
|
|
7729
7730
|
}), ModifiedStandardSQL;
|
|
@@ -16329,6 +16330,8 @@ ${r.join("\n")}`;
|
|
|
16329
16330
|
return "MongoDB";
|
|
16330
16331
|
case "iceberg":
|
|
16331
16332
|
return "Apache Iceberg";
|
|
16333
|
+
case "dremio":
|
|
16334
|
+
return "Dremio";
|
|
16332
16335
|
default:
|
|
16333
16336
|
return e;
|
|
16334
16337
|
}
|
|
@@ -17265,6 +17268,7 @@ ${r.join("\n")}`;
|
|
|
17265
17268
|
case "mongodb":
|
|
17266
17269
|
case "timescaledb":
|
|
17267
17270
|
case "datafusion":
|
|
17271
|
+
case "dremio":
|
|
17268
17272
|
return h;
|
|
17269
17273
|
case "databricks":
|
|
17270
17274
|
return p;
|
|
@@ -23787,6 +23791,7 @@ ${n.sqlString}
|
|
|
23787
23791
|
case "spark":
|
|
23788
23792
|
case "databricks":
|
|
23789
23793
|
case "datafusion":
|
|
23794
|
+
case "dremio":
|
|
23790
23795
|
return Logger.debug("Unsupported dialect", {
|
|
23791
23796
|
dialect: t
|
|
23792
23797
|
}), null;
|
package/dist/main.js
CHANGED
|
@@ -22,17 +22,17 @@ import { _ as Logger, c as Objects, g as cn, h as Events, i as NOT_SET, l as use
|
|
|
22
22
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
23
23
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
24
24
|
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BuQpJEzp.js";
|
|
25
|
-
import { $ as useCellActions, At as DeferredRequestRegistry, B as safeExtractSetUIElementMessageBuffers, Bn as CircleAlert, Bt as getDataTypeColor, C as AccordionContent, Cn as Root2$1, Ct as customPythonLanguageSupport, Dn as Table2, Dt as Paths, E as BorderAllIcon, En as Trash2, Et as PathBuilder, F as base64ToDataView, Fn as Eye, Ft as jotaiJsonStorage, Gt as convertStatsName, H as getMarimoExportContext, J as getCellNames, Jt as useRequestClient, K as createActions, Kt as getRequestClient, L as dataViewToBase64, Ln as Database, Mn as Layers, Nn as Info, Nt as repl, On as PaintRoller, Pn as FileText, Q as reducer, Rn as Columns2, Rt as PluralWords, S as Accordion, Sn as Item$1, St as Checkbox, T as AccordionTrigger, U as hasTrustedExportContext, V as renderHTML, Vn as Braces, Vt as require_client, W as hasRunAnyCellAtom, X as notebookOutline, Y as notebookAtom, Yt as isUninstantiated, Z as numColumnsAtom, _n as atomWithStorage, a as useCellFocusActions, an as parseInitialValue, bt as isInternalCellName, ct as kioskModeAtom, dn as OBJECT_ID_ATTR, dt as outputIsLoading, en as NotebookScopedLocalStorage, et as useCellIds, f as isOutputEmpty, fn as RANDOM_ID_ATTR, ft as outputIsStale, gn as atomWithReducer, i as LazyAnyLanguageCodeMirror, in as parseDataset, jn as LoaderCircle, jt as generateUUID, k as ChevronDownIcon, ln as UIElementId, mt as headingToIdentifier, n as Spinner, nt as createCell, o as useLastFocusedCellId, ot as getInitialAppMode, p as useExpandedConsoleOutput, pn as jsonParseWithSpecialChar, pt as isErrorMime, qt as requestClientAtom, rn as parseAttrValue, s as maybeAddAltairImport, sn as HTMLCellId, st as initialModeAtom, un as findCellId, vn as selectAtom, w as AccordionItem, wn as Trigger2, wt as MarkdownLanguageAdapter, xn as Content2, xt as normalizeName, yt as getValidName, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-
|
|
25
|
+
import { $ as useCellActions, At as DeferredRequestRegistry, B as safeExtractSetUIElementMessageBuffers, Bn as CircleAlert, Bt as getDataTypeColor, C as AccordionContent, Cn as Root2$1, Ct as customPythonLanguageSupport, Dn as Table2, Dt as Paths, E as BorderAllIcon, En as Trash2, Et as PathBuilder, F as base64ToDataView, Fn as Eye, Ft as jotaiJsonStorage, Gt as convertStatsName, H as getMarimoExportContext, J as getCellNames, Jt as useRequestClient, K as createActions, Kt as getRequestClient, L as dataViewToBase64, Ln as Database, Mn as Layers, Nn as Info, Nt as repl, On as PaintRoller, Pn as FileText, Q as reducer, Rn as Columns2, Rt as PluralWords, S as Accordion, Sn as Item$1, St as Checkbox, T as AccordionTrigger, U as hasTrustedExportContext, V as renderHTML, Vn as Braces, Vt as require_client, W as hasRunAnyCellAtom, X as notebookOutline, Y as notebookAtom, Yt as isUninstantiated, Z as numColumnsAtom, _n as atomWithStorage, a as useCellFocusActions, an as parseInitialValue, bt as isInternalCellName, ct as kioskModeAtom, dn as OBJECT_ID_ATTR, dt as outputIsLoading, en as NotebookScopedLocalStorage, et as useCellIds, f as isOutputEmpty, fn as RANDOM_ID_ATTR, ft as outputIsStale, gn as atomWithReducer, i as LazyAnyLanguageCodeMirror, in as parseDataset, jn as LoaderCircle, jt as generateUUID, k as ChevronDownIcon, ln as UIElementId, mt as headingToIdentifier, n as Spinner, nt as createCell, o as useLastFocusedCellId, ot as getInitialAppMode, p as useExpandedConsoleOutput, pn as jsonParseWithSpecialChar, pt as isErrorMime, qt as requestClientAtom, rn as parseAttrValue, s as maybeAddAltairImport, sn as HTMLCellId, st as initialModeAtom, un as findCellId, vn as selectAtom, w as AccordionItem, wn as Trigger2, wt as MarkdownLanguageAdapter, xn as Content2, xt as normalizeName, yt as getValidName, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-Bi7maU1p.js";
|
|
26
26
|
import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
27
27
|
import { o as useSize, s as Root$2, u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
28
28
|
import { A as SquareFunction, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, O as TIME_UNIT_DESCRIPTIONS, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as ChartColumn, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON } from "./spec-CyLiCjSf.js";
|
|
29
|
-
import { $ as TableBody, $t as ChevronLeft, A as ComboboxItem, At as ChartErrorState, B as contextAwarePanelOpen, Bt as $fae977aafc393c5c$export$6b862160d295c8e, C as prettifyRowColumnCount, Ct as dateToLocalISODate, D as DatePicker, Dt as TabsContent, E as useInternalStateWithSync, Et as Tabs, F as CommandList, Ft as RenderTextWithLinks, G as slotsController, H as contextAwarePanelType, Ht as GripHorizontal, I as CommandSeparator, It as Kbd, Jt as Code, K as Toggle, Kt as Ellipsis, L as smartMatch, Lt as HtmlOutput, M as CommandEmpty, Mt as ChartLoadingState, N as CommandInput, Nt as LazyVegaEmbed, O as DateRangePicker, Ot as TabsList, P as CommandItem, Pt as useOverflowDetection, Q as Table, Qt as ChevronsDownUp, R as ContextAwarePanelItem, Rt as EmotionCacheProvider, S as downloadSizeLimitAtom, St as Maps, T as getColumnCountForDisplay, Tt as dateToLocalISOTime, U as isCellAwareAtom, Ut as Funnel, V as contextAwarePanelOwner, Vt as TextWrap, W as SlotNames, Wt as EyeOff, X as Fill, Xt as ChevronsRight, Yt as ChevronsUpDown, Z as Provider$1, Zt as ChevronsLeft, _ as downloadBlob, _t as SELECT_COLUMN_ID, at as generateColumns, b as Progress, bt as getMimeValues, c as Slide, ct as ColumnChartContext, d as JsonOutput, dt as useIntersectionObserver, en as ArrowDownWideNarrow, et as TableCell, f as OutputArea, ft as usePrevious$1, g as ADD_PRINTING_CLASS, gt as INDEX_COLUMN_NAME, h as InstallPackageButton, ht as loadTableData, it as NAMELESS_COLUMN_PREFIX, j as Command, jt as ChartInfoState, k as Combobox, kt as TabsTrigger, l as RadioGroup, lt as ColumnChartSpecModel, m as DataTable, mt as loadTableAndRawData, n as marimoVersionAtom, nt as TableHeader, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as inferFieldTypes, p as OutputRenderer, pt as getPageIndexForRow, qt as Download, r as showCodeInRunModeAtom, rt as TableRow, st as renderCellValue, t as useNotebookCodeAvailable, tt as TableHead, u as RadioGroupItem, ut as DelayMount, v as downloadByURL, vt as TOO_MANY_ROWS, w as prettifyRowCount, wt as dateToLocalISODateTime, x as Filenames, xt as isNullishFilter, y as downloadHTMLAsImage, yt as toFieldTypes, z as PANEL_TYPES, zt as $fae977aafc393c5c$export$588937bcd60ade55, __tla as __tla_2 } from "./code-visibility-
|
|
29
|
+
import { $ as TableBody, $t as ChevronLeft, A as ComboboxItem, At as ChartErrorState, B as contextAwarePanelOpen, Bt as $fae977aafc393c5c$export$6b862160d295c8e, C as prettifyRowColumnCount, Ct as dateToLocalISODate, D as DatePicker, Dt as TabsContent, E as useInternalStateWithSync, Et as Tabs, F as CommandList, Ft as RenderTextWithLinks, G as slotsController, H as contextAwarePanelType, Ht as GripHorizontal, I as CommandSeparator, It as Kbd, Jt as Code, K as Toggle, Kt as Ellipsis, L as smartMatch, Lt as HtmlOutput, M as CommandEmpty, Mt as ChartLoadingState, N as CommandInput, Nt as LazyVegaEmbed, O as DateRangePicker, Ot as TabsList, P as CommandItem, Pt as useOverflowDetection, Q as Table, Qt as ChevronsDownUp, R as ContextAwarePanelItem, Rt as EmotionCacheProvider, S as downloadSizeLimitAtom, St as Maps, T as getColumnCountForDisplay, Tt as dateToLocalISOTime, U as isCellAwareAtom, Ut as Funnel, V as contextAwarePanelOwner, Vt as TextWrap, W as SlotNames, Wt as EyeOff, X as Fill, Xt as ChevronsRight, Yt as ChevronsUpDown, Z as Provider$1, Zt as ChevronsLeft, _ as downloadBlob, _t as SELECT_COLUMN_ID, at as generateColumns, b as Progress, bt as getMimeValues, c as Slide, ct as ColumnChartContext, d as JsonOutput, dt as useIntersectionObserver, en as ArrowDownWideNarrow, et as TableCell, f as OutputArea, ft as usePrevious$1, g as ADD_PRINTING_CLASS, gt as INDEX_COLUMN_NAME, h as InstallPackageButton, ht as loadTableData, it as NAMELESS_COLUMN_PREFIX, j as Command, jt as ChartInfoState, k as Combobox, kt as TabsTrigger, l as RadioGroup, lt as ColumnChartSpecModel, m as DataTable, mt as loadTableAndRawData, n as marimoVersionAtom, nt as TableHeader, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as inferFieldTypes, p as OutputRenderer, pt as getPageIndexForRow, qt as Download, r as showCodeInRunModeAtom, rt as TableRow, st as renderCellValue, t as useNotebookCodeAvailable, tt as TableHead, u as RadioGroupItem, ut as DelayMount, v as downloadByURL, vt as TOO_MANY_ROWS, w as prettifyRowCount, wt as dateToLocalISODateTime, x as Filenames, xt as isNullishFilter, y as downloadHTMLAsImage, yt as toFieldTypes, z as PANEL_TYPES, zt as $fae977aafc393c5c$export$588937bcd60ade55, __tla as __tla_2 } from "./code-visibility-smy6VSJ-.js";
|
|
30
30
|
import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-B81PFEja.js";
|
|
31
31
|
import { t as Check } from "./check-DTbrK0zt.js";
|
|
32
32
|
import { A as Trigger$1, C as $a916eb452884faea$export$b7a616150fdb9f44, E as $18f2051aff69b9bf$export$a54013f0d02a8f82, F as X, L as ChevronDown, M as usePrevious$2, N as useDirection, P as createCollection, S as logNever, T as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, a as SelectGroup, c as SelectSeparator, d as NativeSelect, i as SelectContent, j as clamp$2, k as Icon, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, x as assertNever } from "./strings-Bu3vlb6W.js";
|
|
33
33
|
import { I as $64fa3d84918910a7$export$29f1550f4b0d4415, K as useDebounceControlledState, L as $64fa3d84918910a7$export$4d86445c2cf5e3, Mt as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, Nt as $3ef42575df84b30b$export$9d1611c77c2fe928, V as $64fa3d84918910a7$export$df3a06d6289f983e, Vt as $ff5963eb1fccf552$export$e08e3b67e392101e, a as NumberField, b as DropdownMenuTrigger, c as prettyNumber, d as DropdownMenuContent, f as DropdownMenuGroup, fn as Circle, g as DropdownMenuSeparator, i as OnBlurredInput, it as $701a24aa0da5b062$export$ea18c227d4417cc3, l as prettyScientificNumber, m as DropdownMenuLabel, n as DebouncedNumberInput, p as DropdownMenuItem, pn as ChevronRight, q as useDebouncedCallback, r as Input, rt as $f7dceffc5ad7768b$export$4e328f61c538687f, t as DebouncedInput, u as DropdownMenu, ut as $6179b936705e76d3$export$ae780daf29e6d456, vt as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./input-BwcGY_X1.js";
|
|
34
34
|
import { _ as isWasm, c as asRemoteURL, d as isStaticNotebook, f as appendQueryParams, g as Deferred, m as require_cuid2, u as getStaticVirtualFiles, v as CircleQuestionMark } from "./toDate-DNWCUEQp.js";
|
|
35
|
-
import { a as MarimoIncomingMessageEvent, c as MarimoValueUpdateEvent, d as Square, f as File, i as PythonIcon, l as createInputEvent, n as blobToString, o as MarimoValueInputEvent, r as filesToBase64, s as MarimoValueReadyEvent, t as processOutput, u as deserializeBlob } from "./process-output-
|
|
35
|
+
import { a as MarimoIncomingMessageEvent, c as MarimoValueUpdateEvent, d as Square, f as File, i as PythonIcon, l as createInputEvent, n as blobToString, o as MarimoValueInputEvent, r as filesToBase64, s as MarimoValueReadyEvent, t as processOutput, u as deserializeBlob } from "./process-output-BimQ_hG4.js";
|
|
36
36
|
import { n as Trash, r as Pencil, t as BulkEdit } from "./types-CVvp1fKr.js";
|
|
37
37
|
import { n as require_prop_types, r as Plus, t as ErrorBoundary } from "./ErrorBoundary-rULOrC_p.js";
|
|
38
38
|
import { t as require_react_dom } from "./react-dom-BTJzcVJ9.js";
|
|
@@ -5590,7 +5590,7 @@ let __tla = Promise.all([
|
|
|
5590
5590
|
};
|
|
5591
5591
|
}
|
|
5592
5592
|
};
|
|
5593
|
-
var LazyChatbot = import_react.lazy(() => import("./chat-ui-
|
|
5593
|
+
var LazyChatbot = import_react.lazy(() => import("./chat-ui-BW28GQUq.js").then((e) => ({
|
|
5594
5594
|
default: e.Chatbot
|
|
5595
5595
|
}))), messageSchema = array(object({
|
|
5596
5596
|
id: string(),
|
|
@@ -36093,7 +36093,7 @@ ${c}
|
|
|
36093
36093
|
if (l && l !== "slide") return l;
|
|
36094
36094
|
if (c == null ? void 0 : c.has(e)) return "skip";
|
|
36095
36095
|
}
|
|
36096
|
-
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-
|
|
36096
|
+
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-B0ZyILyK.js"));
|
|
36097
36097
|
const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
|
|
36098
36098
|
var _a3;
|
|
36099
36099
|
let u = useAtomValue(kioskModeAtom), d = l === "read" || u, f = useAtomValue(numColumnsAtom) > 1, [p, m] = (0, import_react.useState)(null), { cellsWithOutput: h, skippedIds: g, slideTypes: _, startCellIndex: v } = (0, import_react.useMemo)(() => computeSlideCellsInfo(c, e), [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
3
|
-
import { it as parseHtmlContent, rt as ansiToPlainText } from "./html-to-image-
|
|
3
|
+
import { it as parseHtmlContent, rt as ansiToPlainText } from "./html-to-image-Bi7maU1p.js";
|
|
4
4
|
import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
5
5
|
import { t as Strings } from "./strings-Bu3vlb6W.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
@@ -6,10 +6,10 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
|
6
6
|
import { _ as Logger, g as cn, h as Events, l as useEventListener, t as Button } from "./button-C5K9fIPF.js";
|
|
7
7
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
8
8
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
9
|
-
import { ct as kioskModeAtom } from "./html-to-image-
|
|
9
|
+
import { ct as kioskModeAtom } from "./html-to-image-Bi7maU1p.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
11
11
|
import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
12
|
-
import { Gt as Expand, J as PanelGroup, Jt as Code, Wt as EyeOff, Y as PanelResizeHandle, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, q as Panel, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-
|
|
12
|
+
import { Gt as Expand, J as PanelGroup, Jt as Code, Wt as EyeOff, Y as PanelResizeHandle, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, q as Panel, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-smy6VSJ-.js";
|
|
13
13
|
import { q as useDebouncedCallback } from "./input-BwcGY_X1.js";
|
|
14
14
|
import "./toDate-DNWCUEQp.js";
|
|
15
15
|
import "./react-dom-BTJzcVJ9.js";
|
package/package.json
CHANGED
|
@@ -4,46 +4,51 @@ import type { AiModel } from "@marimo-team/llm-info";
|
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import type { UserConfig } from "@/core/config/config-schema";
|
|
6
6
|
|
|
7
|
-
// Mock the models.json import
|
|
8
7
|
vi.mock("@marimo-team/llm-info/models.json", () => {
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
8
|
+
const make = (
|
|
9
|
+
overrides: Partial<AiModel> & Pick<AiModel, "name" | "model">,
|
|
10
|
+
): AiModel => ({
|
|
11
|
+
description: "",
|
|
12
|
+
roles: ["chat", "edit"],
|
|
13
|
+
capabilities: [],
|
|
14
|
+
input_types: [],
|
|
15
|
+
output_types: [],
|
|
16
|
+
release_date: "1970-01-01",
|
|
17
|
+
...overrides,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const models: Record<string, AiModel[]> = {
|
|
21
|
+
openai: [
|
|
22
|
+
make({
|
|
23
|
+
name: "GPT-4",
|
|
24
|
+
model: "gpt-4",
|
|
25
|
+
description: "OpenAI GPT-4 model",
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
anthropic: [
|
|
29
|
+
make({
|
|
30
|
+
name: "Claude 3",
|
|
31
|
+
model: "claude-3-sonnet",
|
|
32
|
+
description: "Anthropic Claude 3 Sonnet",
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
google: [
|
|
36
|
+
make({
|
|
37
|
+
name: "Gemini Pro",
|
|
38
|
+
model: "gemini-pro",
|
|
39
|
+
description: "Google Gemini Pro model",
|
|
40
|
+
}),
|
|
41
|
+
],
|
|
42
|
+
ollama: [
|
|
43
|
+
make({
|
|
44
|
+
name: "Ollama Model",
|
|
45
|
+
model: "llama2",
|
|
46
|
+
description: "Ollama Llama 2 model",
|
|
47
|
+
}),
|
|
48
|
+
],
|
|
46
49
|
};
|
|
50
|
+
|
|
51
|
+
return { models };
|
|
47
52
|
});
|
|
48
53
|
|
|
49
54
|
// Must import after mock
|
|
@@ -305,7 +305,7 @@ const AiModelDropdownItem = ({
|
|
|
305
305
|
<div className="flex flex-row w-full items-center">
|
|
306
306
|
<span>{model.name}</span>
|
|
307
307
|
<div className="ml-auto">
|
|
308
|
-
{model.thinking && (
|
|
308
|
+
{model.capabilities.includes("thinking") && (
|
|
309
309
|
<Tooltip content="Reasoning model">
|
|
310
310
|
<BrainIcon
|
|
311
311
|
className={`h-5 w-5 rounded-md p-1 ${getTagColour("thinking")}`}
|
|
@@ -362,7 +362,7 @@ export const AiModelInfoDisplay = ({
|
|
|
362
362
|
</div>
|
|
363
363
|
)}
|
|
364
364
|
|
|
365
|
-
{model.thinking && (
|
|
365
|
+
{model.capabilities.includes("thinking") && (
|
|
366
366
|
<div className="flex items-center gap-2">
|
|
367
367
|
<div className="w-2 h-2 bg-purple-500 rounded-full animate-pulse" />
|
|
368
368
|
<span className="text-xs text-muted-foreground">
|
|
@@ -509,7 +509,7 @@ const ModelInfoCard = ({ model }: { model: AiModel }) => {
|
|
|
509
509
|
<Tooltip content="Custom model">
|
|
510
510
|
{model.custom && <BotIcon className="h-4 w-4" />}
|
|
511
511
|
</Tooltip>
|
|
512
|
-
{model.thinking && (
|
|
512
|
+
{model.capabilities.includes("thinking") && (
|
|
513
513
|
<div
|
|
514
514
|
className={cn(
|
|
515
515
|
"flex items-center gap-1 rounded px-1 py-0.5 w-fit",
|
|
@@ -313,6 +313,26 @@ describe("sqlCode", () => {
|
|
|
313
313
|
);
|
|
314
314
|
});
|
|
315
315
|
|
|
316
|
+
it("should preserve dots inside quoted schema names", () => {
|
|
317
|
+
const sqlTableContext: SQLTableContext = {
|
|
318
|
+
engine: "postgres",
|
|
319
|
+
schema: "analytics.events",
|
|
320
|
+
defaultSchema: "public",
|
|
321
|
+
defaultDatabase: "mydb",
|
|
322
|
+
database: "remote",
|
|
323
|
+
dialect: "postgres",
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
const result = sqlCode({
|
|
327
|
+
table: mockTable,
|
|
328
|
+
columnName: mockColumn.name,
|
|
329
|
+
sqlTableContext,
|
|
330
|
+
});
|
|
331
|
+
expect(result).toBe(
|
|
332
|
+
'_df = mo.sql(f"""\nSELECT "email" FROM "remote"."analytics.events"."users" LIMIT 100\n""", engine=postgres)',
|
|
333
|
+
);
|
|
334
|
+
});
|
|
335
|
+
|
|
316
336
|
it("should not quote * column name", () => {
|
|
317
337
|
const sqlTableContext: SQLTableContext = {
|
|
318
338
|
engine: "postgres",
|
|
@@ -334,6 +354,68 @@ describe("sqlCode", () => {
|
|
|
334
354
|
});
|
|
335
355
|
});
|
|
336
356
|
|
|
357
|
+
describe("Dremio dialect", () => {
|
|
358
|
+
it("should quote reserved column names and table path parts", () => {
|
|
359
|
+
const sqlTableContext: SQLTableContext = {
|
|
360
|
+
engine: "dremio_conn",
|
|
361
|
+
schema: "operations",
|
|
362
|
+
defaultSchema: "",
|
|
363
|
+
defaultDatabase: "",
|
|
364
|
+
database: "lakehouse",
|
|
365
|
+
dialect: "dremio",
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
const result = sqlCode({
|
|
369
|
+
table: { ...mockTable, name: "shipments" as const },
|
|
370
|
+
columnName: "order",
|
|
371
|
+
sqlTableContext,
|
|
372
|
+
});
|
|
373
|
+
expect(result).toBe(
|
|
374
|
+
'_df = mo.sql(f"""\nSELECT "order" FROM "lakehouse"."operations"."shipments" LIMIT 100\n""", engine=dremio_conn)',
|
|
375
|
+
);
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
it("should not quote * column name", () => {
|
|
379
|
+
const sqlTableContext: SQLTableContext = {
|
|
380
|
+
engine: "dremio_conn",
|
|
381
|
+
schema: "operations",
|
|
382
|
+
defaultSchema: "",
|
|
383
|
+
defaultDatabase: "",
|
|
384
|
+
database: "lakehouse",
|
|
385
|
+
dialect: "dremio",
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
const result = sqlCode({
|
|
389
|
+
table: { ...mockTable, name: "customers" as const },
|
|
390
|
+
columnName: "*",
|
|
391
|
+
sqlTableContext,
|
|
392
|
+
});
|
|
393
|
+
expect(result).toBe(
|
|
394
|
+
'_df = mo.sql(f"""\nSELECT * FROM "lakehouse"."operations"."customers" LIMIT 100\n""", engine=dremio_conn)',
|
|
395
|
+
);
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
it("should preserve dots inside quoted schema names", () => {
|
|
399
|
+
const sqlTableContext: SQLTableContext = {
|
|
400
|
+
engine: "dremio_conn",
|
|
401
|
+
schema: "samples.dremio.com",
|
|
402
|
+
defaultSchema: "",
|
|
403
|
+
defaultDatabase: "",
|
|
404
|
+
database: "Samples",
|
|
405
|
+
dialect: "dremio",
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
const result = sqlCode({
|
|
409
|
+
table: { ...mockTable, name: "airlines" as const },
|
|
410
|
+
columnName: "*",
|
|
411
|
+
sqlTableContext,
|
|
412
|
+
});
|
|
413
|
+
expect(result).toBe(
|
|
414
|
+
'_df = mo.sql(f"""\nSELECT * FROM "Samples"."samples.dremio.com"."airlines" LIMIT 100\n""", engine=dremio_conn)',
|
|
415
|
+
);
|
|
416
|
+
});
|
|
417
|
+
});
|
|
418
|
+
|
|
337
419
|
describe("fallback behavior", () => {
|
|
338
420
|
it("should use default formatter for unknown dialect", () => {
|
|
339
421
|
const sqlTableContext: SQLTableContext = {
|
|
@@ -15,9 +15,9 @@ export function isSchemaless(schemaName: string) {
|
|
|
15
15
|
|
|
16
16
|
interface SqlCodeFormatter {
|
|
17
17
|
/**
|
|
18
|
-
* Format the table
|
|
18
|
+
* Format the table path based on dialect-specific rules
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
formatTablePath: (tablePath: string[]) => string;
|
|
21
21
|
/**
|
|
22
22
|
* Format the SELECT clause
|
|
23
23
|
*/
|
|
@@ -25,7 +25,7 @@ interface SqlCodeFormatter {
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const defaultFormatter: SqlCodeFormatter = {
|
|
28
|
-
|
|
28
|
+
formatTablePath: (tablePath: string[]) => tablePath.join("."),
|
|
29
29
|
formatSelectClause: (columnName: string, tableName: string) =>
|
|
30
30
|
`SELECT ${columnName} FROM ${tableName} LIMIT 100`,
|
|
31
31
|
};
|
|
@@ -41,7 +41,8 @@ function getFormatter(dialect: string): SqlCodeFormatter {
|
|
|
41
41
|
const quote = BigQueryDialect.spec.identifierQuotes;
|
|
42
42
|
return {
|
|
43
43
|
// BigQuery uses backticks for identifiers
|
|
44
|
-
|
|
44
|
+
formatTablePath: (tablePath: string[]) =>
|
|
45
|
+
`${quote}${tablePath.join(".")}${quote}`,
|
|
45
46
|
formatSelectClause: defaultFormatter.formatSelectClause,
|
|
46
47
|
};
|
|
47
48
|
}
|
|
@@ -49,7 +50,7 @@ function getFormatter(dialect: string): SqlCodeFormatter {
|
|
|
49
50
|
case "sqlserver":
|
|
50
51
|
case "microsoft sql server":
|
|
51
52
|
return {
|
|
52
|
-
|
|
53
|
+
formatTablePath: defaultFormatter.formatTablePath,
|
|
53
54
|
formatSelectClause: (columnName: string, tableName: string) =>
|
|
54
55
|
`SELECT TOP 100 ${columnName} FROM ${tableName}`,
|
|
55
56
|
};
|
|
@@ -57,12 +58,11 @@ function getFormatter(dialect: string): SqlCodeFormatter {
|
|
|
57
58
|
case "postgres":
|
|
58
59
|
case "postgresql":
|
|
59
60
|
case "duckdb":
|
|
61
|
+
case "dremio":
|
|
60
62
|
// Quote column and table names to avoid raising errors on weird characters
|
|
61
63
|
return {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return parts.map((part) => `"${part}"`).join(".");
|
|
65
|
-
},
|
|
64
|
+
formatTablePath: (tablePath: string[]) =>
|
|
65
|
+
tablePath.map((part) => `"${part}"`).join("."),
|
|
66
66
|
formatSelectClause: (columnName: string, tableName: string) =>
|
|
67
67
|
`SELECT ${columnName === "*" ? "*" : `"${columnName}"`} FROM ${tableName} LIMIT 100`,
|
|
68
68
|
};
|
|
@@ -114,26 +114,27 @@ export function sqlCode({
|
|
|
114
114
|
database,
|
|
115
115
|
dialect,
|
|
116
116
|
} = sqlTableContext;
|
|
117
|
-
|
|
117
|
+
const tablePath = [table.name];
|
|
118
118
|
|
|
119
119
|
// Set the fully qualified table name based on schema and database
|
|
120
120
|
if (isSchemaless(schema)) {
|
|
121
|
-
|
|
122
|
-
database
|
|
121
|
+
if (database !== defaultDatabase) {
|
|
122
|
+
tablePath.unshift(database);
|
|
123
|
+
}
|
|
123
124
|
} else {
|
|
124
125
|
// Include schema if it's not the default schema
|
|
125
126
|
if (schema !== defaultSchema) {
|
|
126
|
-
|
|
127
|
+
tablePath.unshift(schema);
|
|
127
128
|
}
|
|
128
129
|
|
|
129
130
|
// Include database if it's not the default database
|
|
130
131
|
if (database !== defaultDatabase) {
|
|
131
|
-
|
|
132
|
+
tablePath.unshift(database);
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
135
136
|
const formatter = getFormatter(dialect);
|
|
136
|
-
const formattedTableName = formatter.
|
|
137
|
+
const formattedTableName = formatter.formatTablePath(tablePath);
|
|
137
138
|
const selectClause = formatter.formatSelectClause(
|
|
138
139
|
columnName,
|
|
139
140
|
formattedTableName,
|
|
@@ -1,46 +1,52 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
3
|
|
|
4
|
-
// Mock the models.json import
|
|
5
4
|
vi.mock("@marimo-team/llm-info/models.json", () => {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
5
|
+
const make = (
|
|
6
|
+
overrides: Partial<AiModel> & Pick<AiModel, "name" | "model">,
|
|
7
|
+
): AiModel => ({
|
|
8
|
+
description: "",
|
|
9
|
+
roles: ["chat", "edit"],
|
|
10
|
+
capabilities: [],
|
|
11
|
+
input_types: [],
|
|
12
|
+
output_types: [],
|
|
13
|
+
release_date: "1970-01-01",
|
|
14
|
+
...overrides,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const multiModel = make({
|
|
18
|
+
name: "Multi Provider Model",
|
|
19
|
+
model: "multi-model",
|
|
20
|
+
description: "Model available on multiple providers",
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const models: Record<string, AiModel[]> = {
|
|
24
|
+
openai: [
|
|
25
|
+
make({
|
|
26
|
+
name: "GPT-4",
|
|
27
|
+
model: "gpt-4",
|
|
28
|
+
description: "OpenAI GPT-4 model",
|
|
29
|
+
}),
|
|
30
|
+
multiModel,
|
|
31
|
+
],
|
|
32
|
+
anthropic: [
|
|
33
|
+
make({
|
|
34
|
+
name: "Claude 3",
|
|
35
|
+
model: "claude-3-sonnet",
|
|
36
|
+
description: "Anthropic Claude 3 Sonnet",
|
|
37
|
+
}),
|
|
38
|
+
multiModel,
|
|
39
|
+
],
|
|
40
|
+
google: [
|
|
41
|
+
make({
|
|
42
|
+
name: "Gemini Pro",
|
|
43
|
+
model: "gemini-pro",
|
|
44
|
+
description: "Google Gemini Pro model",
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
43
47
|
};
|
|
48
|
+
|
|
49
|
+
return { models };
|
|
44
50
|
});
|
|
45
51
|
|
|
46
52
|
import type { AiModel } from "@marimo-team/llm-info";
|
|
@@ -107,14 +113,15 @@ describe("AiModelRegistry", () => {
|
|
|
107
113
|
});
|
|
108
114
|
|
|
109
115
|
const ids = [...registry.getModelsMap().keys()];
|
|
110
|
-
// Include custom and all default ones
|
|
116
|
+
// Include custom and all default ones; iteration follows provider
|
|
117
|
+
// sections in the source data (openai → anthropic → google).
|
|
111
118
|
expect(ids).toEqual([
|
|
112
119
|
"openai/custom-gpt",
|
|
113
120
|
"openai/gpt-4",
|
|
114
|
-
"anthropic/claude-3-sonnet",
|
|
115
|
-
"google/gemini-pro",
|
|
116
121
|
"openai/multi-model",
|
|
122
|
+
"anthropic/claude-3-sonnet",
|
|
117
123
|
"anthropic/multi-model",
|
|
124
|
+
"google/gemini-pro",
|
|
118
125
|
]);
|
|
119
126
|
});
|
|
120
127
|
});
|
|
@@ -125,9 +132,9 @@ describe("AiModelRegistry", () => {
|
|
|
125
132
|
const openaiModels = registry.getModelsByProvider("openai");
|
|
126
133
|
|
|
127
134
|
expect(openaiModels).toHaveLength(2); // gpt-4 and multi-model
|
|
128
|
-
expect(
|
|
129
|
-
|
|
130
|
-
)
|
|
135
|
+
expect(openaiModels.every((model) => model.provider === "openai")).toBe(
|
|
136
|
+
true,
|
|
137
|
+
);
|
|
131
138
|
});
|
|
132
139
|
|
|
133
140
|
it("should return empty array for provider with no models", () => {
|
|
@@ -147,9 +154,9 @@ describe("AiModelRegistry", () => {
|
|
|
147
154
|
expect(customModel?.name).toBe("custom-gpt");
|
|
148
155
|
expect(customModel?.model).toBe("custom-gpt");
|
|
149
156
|
expect(customModel?.description).toBe("Custom model");
|
|
150
|
-
expect(customModel?.
|
|
157
|
+
expect(customModel?.provider).toBe("openai");
|
|
151
158
|
expect(customModel?.roles).toEqual([]);
|
|
152
|
-
expect(customModel?.
|
|
159
|
+
expect(customModel?.capabilities).toEqual([]);
|
|
153
160
|
});
|
|
154
161
|
|
|
155
162
|
it("should filter models based on displayed models", () => {
|
|
@@ -309,7 +316,10 @@ describe("AiModelRegistry", () => {
|
|
|
309
316
|
|
|
310
317
|
expect(multiModelInOpenai).toBeDefined();
|
|
311
318
|
expect(multiModelInAnthropic).toBeDefined();
|
|
312
|
-
|
|
319
|
+
// Same model id, but each entry belongs to its own provider.
|
|
320
|
+
expect(multiModelInOpenai?.provider).toBe("openai");
|
|
321
|
+
expect(multiModelInAnthropic?.provider).toBe("anthropic");
|
|
322
|
+
expect(multiModelInOpenai?.name).toBe(multiModelInAnthropic?.name);
|
|
313
323
|
});
|
|
314
324
|
|
|
315
325
|
it("should handle displayed models filter with non-existent models", () => {
|
|
@@ -339,20 +349,20 @@ describe("AiModelRegistry", () => {
|
|
|
339
349
|
expect(model).toHaveProperty("name");
|
|
340
350
|
expect(model).toHaveProperty("model");
|
|
341
351
|
expect(model).toHaveProperty("description");
|
|
342
|
-
expect(model).toHaveProperty("
|
|
352
|
+
expect(model).toHaveProperty("provider");
|
|
343
353
|
expect(model).toHaveProperty("roles");
|
|
344
|
-
expect(model).toHaveProperty("
|
|
354
|
+
expect(model).toHaveProperty("capabilities");
|
|
345
355
|
expect(model).toHaveProperty("custom");
|
|
346
356
|
|
|
347
357
|
expect(typeof model.name).toBe("string");
|
|
348
358
|
expect(typeof model.model).toBe("string");
|
|
349
359
|
expect(typeof model.description).toBe("string");
|
|
350
|
-
expect(
|
|
360
|
+
expect(typeof model.provider).toBe("string");
|
|
351
361
|
expect(Array.isArray(model.roles)).toBe(true);
|
|
352
|
-
expect(
|
|
362
|
+
expect(Array.isArray(model.capabilities)).toBe(true);
|
|
353
363
|
expect(typeof model.custom).toBe("boolean");
|
|
354
364
|
|
|
355
|
-
expect(model.
|
|
365
|
+
expect(model.provider).toBe(provider);
|
|
356
366
|
}
|
|
357
367
|
}
|
|
358
368
|
});
|
|
@@ -367,31 +377,33 @@ describe("AiModelRegistry", () => {
|
|
|
367
377
|
|
|
368
378
|
expect(customModel).toMatchInlineSnapshot(`
|
|
369
379
|
{
|
|
380
|
+
"capabilities": [],
|
|
370
381
|
"custom": true,
|
|
371
382
|
"description": "Custom model",
|
|
383
|
+
"input_types": [],
|
|
372
384
|
"model": "custom-gpt",
|
|
373
385
|
"name": "custom-gpt",
|
|
374
|
-
"
|
|
375
|
-
|
|
376
|
-
|
|
386
|
+
"output_types": [],
|
|
387
|
+
"provider": "openai",
|
|
388
|
+
"release_date": "1970-01-01",
|
|
377
389
|
"roles": [],
|
|
378
|
-
"thinking": false,
|
|
379
390
|
}
|
|
380
391
|
`);
|
|
381
392
|
expect(defaultModel).toMatchInlineSnapshot(`
|
|
382
393
|
{
|
|
394
|
+
"capabilities": [],
|
|
383
395
|
"custom": false,
|
|
384
396
|
"description": "OpenAI GPT-4 model",
|
|
397
|
+
"input_types": [],
|
|
385
398
|
"model": "gpt-4",
|
|
386
399
|
"name": "GPT-4",
|
|
387
|
-
"
|
|
388
|
-
|
|
389
|
-
|
|
400
|
+
"output_types": [],
|
|
401
|
+
"provider": "openai",
|
|
402
|
+
"release_date": "1970-01-01",
|
|
390
403
|
"roles": [
|
|
391
404
|
"chat",
|
|
392
405
|
"edit",
|
|
393
406
|
],
|
|
394
|
-
"thinking": false,
|
|
395
407
|
}
|
|
396
408
|
`);
|
|
397
409
|
});
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Role,
|
|
7
|
-
} from "@marimo-team/llm-info";
|
|
8
|
-
import { models } from "@marimo-team/llm-info/models.json";
|
|
9
|
-
import { providers } from "@marimo-team/llm-info/providers.json";
|
|
3
|
+
import type { AiModel as AiModelType, AiProvider } from "@marimo-team/llm-info";
|
|
4
|
+
import { models as modelsJson } from "@marimo-team/llm-info/models.json";
|
|
5
|
+
import { providers as providersJson } from "@marimo-team/llm-info/providers.json";
|
|
10
6
|
import { Logger } from "@/utils/Logger";
|
|
11
7
|
import { MultiMap } from "@/utils/multi-map";
|
|
12
8
|
import { once } from "@/utils/once";
|
|
@@ -14,13 +10,19 @@ import type { ProviderId } from "./ids/ids";
|
|
|
14
10
|
import { AiModelId, type QualifiedModelId, type ShortModelId } from "./ids/ids";
|
|
15
11
|
|
|
16
12
|
export interface AiModel extends AiModelType {
|
|
17
|
-
roles: Role[];
|
|
18
13
|
model: ShortModelId;
|
|
19
|
-
|
|
14
|
+
/** The provider this entry belongs to. */
|
|
15
|
+
provider: ProviderId;
|
|
20
16
|
/** Whether this is a custom model. */
|
|
21
17
|
custom: boolean;
|
|
22
18
|
}
|
|
23
19
|
|
|
20
|
+
// JSON shape matches the `AiModel` schema (Zod-validated at codegen time).
|
|
21
|
+
const models = modelsJson as unknown as Partial<
|
|
22
|
+
Record<ProviderId, AiModelType[]>
|
|
23
|
+
>;
|
|
24
|
+
const providers = providersJson as unknown as readonly AiProvider[];
|
|
25
|
+
|
|
24
26
|
interface KnownModelMaps {
|
|
25
27
|
/** Map of qualified model ID to model info */
|
|
26
28
|
modelMap: ReadonlyMap<QualifiedModelId, AiModel>;
|
|
@@ -32,24 +34,25 @@ export const getKnownModelMaps = once((): KnownModelMaps => {
|
|
|
32
34
|
const modelMap = new Map<QualifiedModelId, AiModel>();
|
|
33
35
|
const defaultModelByProvider = new Map<ProviderId, QualifiedModelId>();
|
|
34
36
|
|
|
35
|
-
for (const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
for (const [providerKey, providerModels] of Object.entries(models)) {
|
|
38
|
+
if (!providerModels) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
const provider = providerKey as ProviderId;
|
|
42
|
+
for (const raw of providerModels) {
|
|
43
|
+
const modelId = raw.model as ShortModelId;
|
|
44
|
+
const modelInfo: AiModel = {
|
|
45
|
+
...raw,
|
|
46
|
+
model: modelId,
|
|
47
|
+
provider,
|
|
48
|
+
custom: false,
|
|
49
|
+
};
|
|
47
50
|
|
|
48
|
-
for (const provider of modelInfo.providers) {
|
|
49
51
|
const qualifiedModelId: QualifiedModelId = `${provider}/${modelId}`;
|
|
50
52
|
modelMap.set(qualifiedModelId, modelInfo);
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
const supportsChatOrEdit =
|
|
55
|
+
modelInfo.roles.includes("chat") || modelInfo.roles.includes("edit");
|
|
53
56
|
if (supportsChatOrEdit && !defaultModelByProvider.has(provider)) {
|
|
54
57
|
defaultModelByProvider.set(provider, qualifiedModelId);
|
|
55
58
|
}
|
|
@@ -67,9 +70,8 @@ const getProviderMap = once(
|
|
|
67
70
|
const providerMap = new Map<ProviderId, AiProvider>();
|
|
68
71
|
const providerToOrderIdx = new Map<ProviderId, number>();
|
|
69
72
|
providers.forEach((provider, idx) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
providerToOrderIdx.set(providerId, idx);
|
|
73
|
+
providerMap.set(provider.id, provider);
|
|
74
|
+
providerToOrderIdx.set(provider.id, idx);
|
|
73
75
|
});
|
|
74
76
|
return { providerMap, providerToOrderIdx };
|
|
75
77
|
},
|
|
@@ -158,9 +160,12 @@ export class AiModelRegistry {
|
|
|
158
160
|
name: modelId.shortModelId,
|
|
159
161
|
model: modelId.shortModelId,
|
|
160
162
|
description: "Custom model",
|
|
161
|
-
|
|
163
|
+
provider: modelId.providerId,
|
|
162
164
|
roles: [],
|
|
163
|
-
|
|
165
|
+
capabilities: [],
|
|
166
|
+
input_types: [],
|
|
167
|
+
output_types: [],
|
|
168
|
+
release_date: "1970-01-01",
|
|
164
169
|
custom: true,
|
|
165
170
|
};
|
|
166
171
|
customModelsMap.set(model, modelInfo);
|
|
@@ -52,6 +52,7 @@ const KNOWN_DIALECTS_ARRAY = [
|
|
|
52
52
|
"databricks",
|
|
53
53
|
"datafusion",
|
|
54
54
|
"microsoft sql server",
|
|
55
|
+
"dremio",
|
|
55
56
|
] as const;
|
|
56
57
|
const KNOWN_DIALECTS: ReadonlySet<string> = new Set(KNOWN_DIALECTS_ARRAY);
|
|
57
58
|
type KnownDialect = (typeof KNOWN_DIALECTS_ARRAY)[number];
|
|
@@ -115,6 +116,7 @@ export function guessDialect(
|
|
|
115
116
|
case "spark":
|
|
116
117
|
case "databricks":
|
|
117
118
|
case "datafusion":
|
|
119
|
+
case "dremio":
|
|
118
120
|
Logger.debug("Unsupported dialect", { dialect });
|
|
119
121
|
return ModifiedStandardSQL;
|
|
120
122
|
default:
|