Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(hogql): rename promptJev to jev and default it to jeeves-0.1 (#109316)

Jovan Sakovicaeb24ab38018
diff --git a/posthog/hogql/database/test/test_warehouse_usage.py b/posthog/hogql/database/test/test_warehouse_usage.py
index 696ce294c5bd..21fb855979f5 100644
--- a/posthog/hogql/database/test/test_warehouse_usage.py
+++ b/posthog/hogql/database/test/test_warehouse_usage.py
@@ -114,7 +114,7 @@ class TestWarehouseUsage(BaseTest):
patch("posthog.hogql.query.sync_execute", return_value=([], [("label", "Nullable(String)")])),
):
response = execute_hogql_query(
- "SELECT label FROM (SELECT __preview_promptJev(id, 'Refund?') AS label FROM stripe_table_1 LIMIT 10)",
+ "SELECT label FROM (SELECT jev(id, 'Refund?') AS label FROM stripe_table_1 LIMIT 10)",
self.team,
user=self.user,
)
diff --git a/posthog/hogql/functions/posthog.py b/posthog/hogql/functions/posthog.py
index ac1e713a99fb..05ac60e16dc7 100644
--- a/posthog/hogql/functions/posthog.py
+++ b/posthog/hogql/functions/posthog.py
@@ -26,7 +26,7 @@ HOGQL_POSTHOG_FUNCTIONS: dict[str, HogQLFunctionMeta] = {
signatures=[((StringType(),), ArrayType(item_type=IntegerType()))],
),
"embedText": HogQLFunctionMeta("embedText", 1, 2),
- "__preview_promptJev": HogQLFunctionMeta("__preview_promptJev", 2, 4, case_sensitive=False),
+ "jev": HogQLFunctionMeta("jev", 2, 4, case_sensitive=False),
# posthog/models/channel_type/sql.py and posthog/hogql/database/schema/channel_type.py
"lookupDomainType": HogQLFunctionMeta("lookupDomainType", 1, 1),
"lookupPaidSourceType": HogQLFunctionMeta("lookupPaidSourceType", 1, 1),
diff --git a/posthog/hogql/functions/prompt_jev.py b/posthog/hogql/functions/prompt_jev.py
index 2f3eea244c46..28619de22205 100644
--- a/posthog/hogql/functions/prompt_jev.py
+++ b/posthog/hogql/functions/prompt_jev.py
@@ -14,7 +14,7 @@ class PromptJevFinder(TraversingVisitor):
self.calls: list[ast.Call] = []
def visit_call(self, node: ast.Call) -> None:
- if node.name.lower() == "__preview_promptjev":
+ if node.name.lower() == "jev":
self.calls.append(node)
super().visit_call(node)
@@ -38,51 +38,51 @@ class PromptJevCall:
@classmethod
def parse(cls, node: ast.Call) -> "PromptJevCall":
if node.params or node.distinct or node.filter_expr or node.order_by or node.within_group:
- raise QueryError("__preview_promptJev does not accept aggregate modifiers.")
+ raise QueryError("jev does not accept aggregate modifiers.")
if len(node.args) < 2 or isinstance(node.args[0], ast.NamedArgument):
- raise QueryError("Use __preview_promptJev(input, instructions, choice := ['label', 'other']).")
+ raise QueryError("Use jev(input, instructions, choice := ['label', 'other']).")
instructions = node.args[1]
if (
not isinstance(instructions, ast.Constant)
or not isinstance(instructions.value, str)
or not instructions.value.strip()
):
- raise QueryError("__preview_promptJev instructions must be a non-empty string literal.")
+ raise QueryError("jev instructions must be a non-empty string literal.")
if len(instructions.value.encode()) > 8192:
- raise QueryError("__preview_promptJev instructions exceed 8 KiB. Shorten the instructions.")
+ raise QueryError("jev instructions exceed 8 KiB. Shorten the instructions.")
options: dict[str, ast.Expr] = {}
for arg in node.args[2:]:
if not isinstance(arg, ast.NamedArgument) or arg.name not in {"choice", "noul", "batch_size"}:
- raise QueryError("__preview_promptJev supports the named arguments choice, noul, and batch_size.")
+ raise QueryError("jev supports the named arguments choice, noul, and batch_size.")
if arg.name in options:
- raise QueryError(f"__preview_promptJev received {arg.name} more than once.")
+ raise QueryError(f"jev received {arg.name} more than once.")
options[arg.name] = arg.value
if "choice" in options and "noul" in options:
- raise QueryError("Use either choice or noul with __preview_promptJev.")
+ raise QueryError("Use either choice or noul with jev.")
batch = options.get("batch_size", ast.Constant(value=16))
if not isinstance(batch, ast.Constant) or type(batch.value) is not int or not 1 <= batch.value <= 32:
- raise QueryError("__preview_promptJev batch_size must be an integer literal between 1 and 32.")
+ raise QueryError("jev batch_size must be an integer literal between 1 and 32.")
criteria: dict[str, str | None] = {}
option = options.get("choice", options.get("noul"))
if option is not None:
if not isinstance(option, ast.Array):
- raise QueryError("__preview_promptJev criteria must be an array of string literals.")
+ raise QueryError("jev criteria must be an array of string literals.")
for item in option.exprs:
if not isinstance(item, ast.Constant) or not isinstance(item.value, str) or not item.value.strip():
- raise QueryError("__preview_promptJev criteria must contain non-empty string literals.")
+ raise QueryError("jev criteria must contain non-empty string literals.")
if item.value in criteria:
- raise QueryError("__preview_promptJev criteria must be unique.")
+ raise QueryError("jev criteria must be unique.")
if len(item.value.encode()) > 1024:
- raise QueryError("__preview_promptJev labels exceed 1 KiB. Shorten the labels.")
+ raise QueryError("jev labels exceed 1 KiB. Shorten the labels.")
criteria[item.value] = None
if "choice" in options:
if not 2 <= len(criteria) <= MAX_CHOICES:
- raise QueryError(f"__preview_promptJev choice needs between 2 and {MAX_CHOICES} labels.")
+ raise QueryError(f"jev choice needs between 2 and {MAX_CHOICES} labels.")
question: Question = ChoiceQuestion(instructions=instructions.value, criteria=criteria)
else:
if "noul" in options and set(criteria) != {"true", "false"}:
- raise QueryError("__preview_promptJev noul needs exactly the labels 'true' and 'false'.")
+ raise QueryError("jev noul needs exactly the labels 'true' and 'false'.")
question = NoulQuestion(instructions=instructions.value)
if PromptJevFinder.contains(node.args[0]):
- raise QueryError("Put each __preview_promptJev evaluation in a separate subquery.")
+ raise QueryError("Put each jev evaluation in a separate subquery.")
return cls(input=node.args[0], question=question, batch_size=batch.value)
diff --git a/posthog/hogql/printer/clickhouse.py b/posthog/hogql/printer/clickhouse.py
index fe7ebafff40e..580083dcd5ec 100644
--- a/posthog/hogql/printer/clickhouse.py
+++ b/posthog/hogql/printer/clickhouse.py
@@ -955,10 +955,8 @@ class ClickHousePrinter(BasePrinter):
return isinstance(left_type, ast.DecimalType) and isinstance(right_type, ast.DecimalType)
def visit_call(self, node: ast.Call):
- if node.name.lower() == "__preview_promptjev":
- raise QueryError(
- "__preview_promptJev must run through the HogQL query executor. It cannot be embedded in SQL."
- )
+ if node.name.lower() == "jev":
+ raise QueryError("jev must run through the HogQL query executor. It cannot be embedded in SQL.")
serialized = self._serialize_to_json_string_call(node)
if serialized is not None:
return serialized
diff --git a/posthog/hogql/printer/test/__snapshots__/test_trino_printer.ambr b/posthog/hogql/printer/test/__snapshots__/test_trino_printer.ambr
index 6456bd55e361..58f2867f2116 100644
--- a/posthog/hogql/printer/test/__snapshots__/test_trino_printer.ambr
+++ b/posthog/hogql/printer/test/__snapshots__/test_trino_printer.ambr
@@ -304,7 +304,6 @@
'__preview_getTrafficCategory',
'__preview_getTrafficType',
'__preview_isBot',
- '__preview_promptJev',
'_defaultChannelType',
'_domainType',
'embedText',
@@ -316,6 +315,7 @@
'getTrafficCategory',
'getTrafficType',
'isLikelyBot',
+ 'jev',
'lookupDomainType',
'lookupOrganicMediumType',
'lookupOrganicSourceType',
diff --git a/posthog/hogql/query.py b/posthog/hogql/query.py
index 8e0e2d1e30d1..7edb62c91be8 100644
--- a/posthog/hogql/query.py
+++ b/posthog/hogql/query.py
@@ -601,7 +601,7 @@ class HogQLQueryExecutor:
sources = extract_warehouse_sources(self._get_select_query_type())
except Exception:
sources = []
- # __preview_promptJev source queries read their tables in separate executions.
+ # jev source queries read their tables in separate executions.
sources = list({source.id: source for source in [*sources, *self._prompt_jev_warehouse_sources]}.values())
self.used_data_warehouse_sources = sources
return sources
@@ -745,7 +745,7 @@ class HogQLQueryExecutor:
validate_prompt_jev_access(self.team)
PromptJevBudget().visit(self.select_query)
- # The resolver types __preview_promptJev calls without model output, so an invalid query fails before any model call.
+ # The resolver types jev calls without model output, so an invalid query fails before any model call.
Resolver(
context=dataclasses.replace(
self.context,
@@ -790,12 +790,10 @@ class HogQLQueryExecutor:
return PromptJevSource(response=response, column_types=executor._resolved_column_types())
planner = PromptJevPlanner(execute=execute_source, runner=runner, tables=self._prompt_jev_tables)
- with self.timings.measure("__preview_promptJev"):
+ with self.timings.measure("jev"):
self.select_query = planner.visit(self.select_query)
if PromptJevFinder.contains(self.select_query):
- raise QueryError(
- "Use __preview_promptJev in a named SELECT column and filter its results in an outer query."
- )
+ raise QueryError("Use jev in a named SELECT column and filter its results in an outer query.")
def _prepare_execution(self, *, embedded_select: bool = False) -> _PreparedExecution:
self.context.referenced_saved_query_ids.clear()
@@ -814,9 +812,7 @@ class HogQLQueryExecutor:
self._process_placeholders()
if PromptJevFinder.contains(self.select_query):
if embedded_select or not self._executing or self.connection_id is not None:
- raise QueryError(
- "__preview_promptJev requires a ClickHouse-backed query execution and cannot be embedded."
- )
+ raise QueryError("jev requires a ClickHouse-backed query execution and cannot be embedded.")
self._evaluate_prompt_jev()
if embedded_select:
_EmbeddedSelectSettingsValidator().visit(self.select_query)
diff --git a/posthog/hogql/resolver.py b/posthog/hogql/resolver.py
index 28f8ffef8083..37b9de540d9f 100644
--- a/posthog/hogql/resolver.py
+++ b/posthog/hogql/resolver.py
@@ -2004,12 +2004,12 @@ class Resolver(CloningVisitor):
def visit_call(self, node: ast.Call):
"""Visit function calls."""
- if node.name.lower() == "__preview_promptjev":
+ if node.name.lower() == "jev":
spec = PromptJevCall.parse(node)
node = clone_expr(node, clear_types=True)
node.args[0] = self.visit(spec.input)
node.type = ast.CallType(
- name="__preview_promptJev",
+ name="jev",
arg_types=[],
return_type=constant_type_from_runtime_type(parse_clickhouse_type(spec.clickhouse_type)),
)
diff --git a/posthog/hogql/test/test_prompt_jev.py b/posthog/hogql/test/test_prompt_jev.py
index 1d3a3e9f4721..1ef9657595f0 100644
--- a/posthog/hogql/test/test_prompt_jev.py
+++ b/posthog/hogql/test/test_prompt_jev.py
@@ -43,21 +43,19 @@ def gateway_response(_url: str, *, json: dict, headers: dict) -> httpx.Response:
class TestPromptJev(SimpleTestCase):
@parameterized.expand(
[
- ("SELECT __preview_promptJev('a', 'q') AS p", 1000),
- ("SELECT __preview_promptJev('a', 'q') AS p, __preview_promptJev('b', 'q') AS q LIMIT 500", 1000),
- ("SELECT __preview_promptJev('a', 'q') AS p, __preview_promptJev('b', 'q') AS q LIMIT 0", 0),
+ ("SELECT jev('a', 'q') AS p", 1000),
+ ("SELECT jev('a', 'q') AS p, jev('b', 'q') AS q LIMIT 500", 1000),
+ ("SELECT jev('a', 'q') AS p, jev('b', 'q') AS q LIMIT 0", 0),
(
- "WITH c AS (SELECT __preview_promptJev('a', 'q') AS p LIMIT 1000) SELECT a.p, b.p FROM c a CROSS JOIN c b",
+ "WITH c AS (SELECT jev('a', 'q') AS p LIMIT 1000) SELECT a.p, b.p FROM c a CROSS JOIN c b",
1000,
),
(
- "WITH c AS (SELECT __preview_promptJev('a', 'q') AS p LIMIT 600) "
- "SELECT 0.0 AS p UNION ALL SELECT p FROM c",
+ "WITH c AS (SELECT jev('a', 'q') AS p LIMIT 600) SELECT 0.0 AS p UNION ALL SELECT p FROM c",
600,
),
(
- "WITH c AS (SELECT __preview_promptJev('a', 'q') AS p LIMIT 600) "
- "SELECT p FROM c UNION ALL SELECT p FROM c",
+ "WITH c AS (SELECT jev('a', 'q') AS p LIMIT 600) SELECT p FROM c UNION ALL SELECT p FROM c",
600,
),
]
@@ -69,24 +67,19 @@ class TestPromptJev(SimpleTestCase):
def test_unused_ctes_do_not_reserve_budget(self) -> None:
budget = PromptJevBudget()
- budget.visit(
- parse_select(
- "WITH a AS (SELECT __preview_promptJev('a', 'q') AS p), "
- "b AS (SELECT __preview_promptJev('b', 'q') AS p) SELECT 1"
- )
- )
+ budget.visit(parse_select("WITH a AS (SELECT jev('a', 'q') AS p), b AS (SELECT jev('b', 'q') AS p) SELECT 1"))
self.assertEqual(budget.decisions, 0)
@parameterized.expand(
[
- ("__preview_promptJev('a', '')", "non-empty"),
- ("__preview_promptJev('a', instructions)", "literal"),
- ("__preview_promptJev('a', 'q', choice := ['a', 'a'])", "unique"),
- ("__preview_promptJev('a', 'q', choice := ['a'])", "between 2"),
- ("__preview_promptJev('a', 'q', batch_size := 0)", "between 1"),
- ("__preview_promptJev('a', 'q', noul := ['yes', 'no'])", "exactly"),
- ("__preview_promptJev('a', 'q', choice := ['a','b'], noul := ['true','false'])", "either"),
- ("__preview_promptJev('a', 'q', score := ['a','b'])", "supports"),
+ ("jev('a', '')", "non-empty"),
+ ("jev('a', instructions)", "literal"),
+ ("jev('a', 'q', choice := ['a', 'a'])", "unique"),
+ ("jev('a', 'q', choice := ['a'])", "between 2"),
+ ("jev('a', 'q', batch_size := 0)", "between 1"),
+ ("jev('a', 'q', noul := ['yes', 'no'])", "exactly"),
+ ("jev('a', 'q', choice := ['a','b'], noul := ['true','false'])", "either"),
+ ("jev('a', 'q', score := ['a','b'])", "supports"),
]
)
def test_invalid_arguments(self, query: str, message: str) -> None:
@@ -96,7 +89,7 @@ class TestPromptJev(SimpleTestCase):
PromptJevCall.parse(node)
def test_batches_deduplicates_and_skips_nulls(self) -> None:
- node = parse_expr("__preview_promptJev(body, 'Refund?', batch_size := 2)")
+ node = parse_expr("jev(body, 'Refund?', batch_size := 2)")
assert isinstance(node, ast.Call)
spec = PromptJevCall.parse(node)
runner = PromptJevRunner(team_id=123, distinct_id="test-user")
@@ -111,14 +104,14 @@ class TestPromptJev(SimpleTestCase):
@parameterized.expand([(42, "must be text"), ("x" * 8193, "8 KiB")])
def test_rejects_invalid_input_before_network(self, value: object, message: str) -> None:
- node = parse_expr("__preview_promptJev(body, 'Refund?')")
+ node = parse_expr("jev(body, 'Refund?')")
assert isinstance(node, ast.Call)
with patch("httpx.AsyncClient.post") as post, self.assertRaisesRegex(QueryError, message):
PromptJevRunner(team_id=1, distinct_id=None).evaluate(PromptJevCall.parse(node), [value])
post.assert_not_called()
def test_gateway_failure_does_not_return_a_decision(self) -> None:
- node = parse_expr("__preview_promptJev('refund', 'Refund?')")
+ node = parse_expr("jev('refund', 'Refund?')")
assert isinstance(node, ast.Call)
with (
patch("httpx.AsyncClient.post", return_value=httpx.Response(429)),
@@ -127,7 +120,7 @@ class TestPromptJev(SimpleTestCase):
PromptJevRunner(team_id=1, distinct_id=None).evaluate(PromptJevCall.parse(node), ["refund"])
def test_deadline_cancels_inflight_requests_and_pending_batches(self) -> None:
- node = parse_expr("__preview_promptJev(body, 'Refund?', batch_size := 1)")
+ node = parse_expr("jev(body, 'Refund?', batch_size := 1)")
assert isinstance(node, ast.Call)
runner = PromptJevRunner(team_id=1, distinct_id=None)
cancelled = 0
@@ -162,7 +155,7 @@ class TestPromptJev(SimpleTestCase):
self.assertEqual(cancelled, 4)
def test_expired_deadline_sends_no_requests(self) -> None:
- node = parse_expr("__preview_promptJev(body, 'Refund?')")
+ node = parse_expr("jev(body, 'Refund?')")
assert isinstance(node, ast.Call)
runner = PromptJevRunner(team_id=1, distinct_id=None)
runner.deadline = time.monotonic() - 1
@@ -182,17 +175,13 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
@parameterized.expand(
[
- ("SELECT " + ", ".join(f"__preview_promptJev('a', 'q{i}') AS p{i}" for i in range(10)) + " LIMIT 101",),
- ("SELECT __preview_promptJev('a', 'q') AS p, __preview_promptJev('b', 'q') AS q",),
- (
- "SELECT __preview_promptJev('a', 'q') AS p LIMIT 501 UNION ALL SELECT __preview_promptJev('b', 'q') AS p LIMIT 500",
- ),
- (
- "SELECT __preview_promptJev(toString(p), 'q') AS q FROM (SELECT __preview_promptJev('a', 'q') AS p LIMIT 501) LIMIT 500",
- ),
+ ("SELECT " + ", ".join(f"jev('a', 'q{i}') AS p{i}" for i in range(10)) + " LIMIT 101",),
+ ("SELECT jev('a', 'q') AS p, jev('b', 'q') AS q",),
+ ("SELECT jev('a', 'q') AS p LIMIT 501 UNION ALL SELECT jev('b', 'q') AS p LIMIT 500",),
+ ("SELECT jev(toString(p), 'q') AS q FROM (SELECT jev('a', 'q') AS p LIMIT 501) LIMIT 500",),
(
- "WITH c AS (SELECT __preview_promptJev(toString(number), 'first') AS p FROM numbers(1000) LIMIT 1000) "
- "SELECT 0.0 AS p UNION ALL SELECT __preview_promptJev('refund', 'second') AS p FROM c LIMIT 1",
+ "WITH c AS (SELECT jev(toString(number), 'first') AS p FROM numbers(1000) LIMIT 1000) "
+ "SELECT 0.0 AS p UNION ALL SELECT jev('refund', 'second') AS p FROM c LIMIT 1",
),
]
)
@@ -214,7 +203,7 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
patch("httpx.AsyncClient.post") as post,
self.assertRaisesRegex(QueryError, "not enabled for this project"),
):
- execute_hogql_query("SELECT __preview_promptJev('refund', 'Refund?') AS p", self.team, user=self.user)
+ execute_hogql_query("SELECT jev('refund', 'Refund?') AS p", self.team, user=self.user)
execute.assert_not_called()
post.assert_not_called()
self.assertEqual(self.feature_enabled.call_args.kwargs["groups"]["project"], str(self.team.pk))
@@ -230,7 +219,7 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
patch("httpx.AsyncClient.post") as post,
self.assertRaisesRegex(QueryError, "native ClickHouse connection"),
):
- execute_hogql_query("SELECT __preview_promptJev('refund', 'Refund?') AS p", self.team, user=self.user)
+ execute_hogql_query("SELECT jev('refund', 'Refund?') AS p", self.team, user=self.user)
execute.assert_not_called()
post.assert_not_called()
@@ -247,7 +236,7 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
{
"query": {
"kind": "HogQLQuery",
- "query": "SELECT __preview_promptJev(properties.message, 'Refund?') AS probability FROM events WHERE event = 'jev_test_message' LIMIT 10",
+ "query": "SELECT jev(properties.message, 'Refund?') AS probability FROM events WHERE event = 'jev_test_message' LIMIT 10",
}
},
)
@@ -258,35 +247,33 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
@parameterized.expand(
[
(
- "SELECT probability FROM (SELECT __preview_promptJev('refund please', 'Refund?') AS probability) WHERE probability > 0.5",
+ "SELECT probability FROM (SELECT jev('refund please', 'Refund?') AS probability) WHERE probability > 0.5",
[(0.9,)],
),
(
- "SELECT result.choice, count() FROM (SELECT __preview_promptJev(body, 'Route?', choice := ['billing', 'other']) AS result FROM (SELECT arrayJoin(['refund', 'hello', 'refund']) AS body)) GROUP BY result.choice ORDER BY result.choice",
+ "SELECT result.choice, count() FROM (SELECT jev(body, 'Route?', choice := ['billing', 'other']) AS result FROM (SELECT arrayJoin(['refund', 'hello', 'refund']) AS body)) GROUP BY result.choice ORDER BY result.choice",
[("billing", 2), ("other", 1)],
),
(
- "WITH classified AS (SELECT __preview_promptJev('refund', 'Refund?') AS p) SELECT a.p, b.p FROM classified a CROSS JOIN classified b",
+ "WITH classified AS (SELECT jev('refund', 'Refund?') AS p) SELECT a.p, b.p FROM classified a CROSS JOIN classified b",
[(0.9, 0.9)],
),
(
- "WITH a AS (SELECT __preview_promptJev('refund', 'Refund?') AS p), b AS (SELECT p FROM a) SELECT p FROM b",
+ "WITH a AS (SELECT jev('refund', 'Refund?') AS p), b AS (SELECT p FROM a) SELECT p FROM b",
[(0.9,)],
),
(
- "SELECT label FROM (SELECT __preview_promptJev(body, 'Refund?') AS label FROM (SELECT label AS body FROM (SELECT 'refund' AS label)))",
+ "SELECT label FROM (SELECT jev(body, 'Refund?') AS label FROM (SELECT label AS body FROM (SELECT 'refund' AS label)))",
[(0.9,)],
),
- ("SELECT __preview_promptJev(NULL, 'Refund?') AS p", [(None,)]),
- ("SELECT __preview_promptJev('hello', 'Refund?') AS p LIMIT 0", []),
+ ("SELECT jev(NULL, 'Refund?') AS p", [(None,)]),
+ ("SELECT jev('hello', 'Refund?') AS p LIMIT 0", []),
(
- "SELECT "
- + ", ".join(f"__preview_promptJev('refund', 'Refund?') AS p{i}" for i in range(10))
- + " LIMIT 100",
+ "SELECT " + ", ".join(f"jev('refund', 'Refund?') AS p{i}" for i in range(10)) + " LIMIT 100",
[(0.9,) * 10],
),
(
- "WITH messages AS (SELECT 'refund' AS body) SELECT 0.0 AS p UNION ALL SELECT __preview_promptJev(body, 'Refund?') AS p FROM messages LIMIT 10",
+ "WITH messages AS (SELECT 'refund' AS body) SELECT 0.0 AS p UNION ALL SELECT jev(body, 'Refund?') AS p FROM messages LIMIT 10",
[(0.0,), (0.9,)],
),
]
@@ -299,8 +286,8 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
@parameterized.expand(
[
- ("WITH unused AS (SELECT __preview_promptJev('refund', 'Refund?') AS p) SELECT 1",),
- ("WITH a AS (SELECT __preview_promptJev('refund', 'Refund?') AS p), b AS (SELECT p FROM a) SELECT 1",),
+ ("WITH unused AS (SELECT jev('refund', 'Refund?') AS p) SELECT 1",),
+ ("WITH a AS (SELECT jev('refund', 'Refund?') AS p), b AS (SELECT p FROM a) SELECT 1",),
]
)
def test_unused_ctes_send_no_requests(self, query: str) -> None:
@@ -312,7 +299,7 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
def test_explicit_limit_above_the_default_keeps_every_row(self) -> None:
with patch("httpx.AsyncClient.post", side_effect=gateway_response):
response = execute_hogql_query(
- "SELECT __preview_promptJev(toString(number), 'Refund?') AS p FROM numbers(150) LIMIT 150",
+ "SELECT jev(toString(number), 'Refund?') AS p FROM numbers(150) LIMIT 150",
self.team,
user=self.user,
)
@@ -328,7 +315,7 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
flush_persons_and_events()
with patch("httpx.AsyncClient.post", side_effect=gateway_response):
response = execute_hogql_query(
- "SELECT props.category, p FROM (SELECT properties AS props, __preview_promptJev(properties.message, 'Refund?') AS p FROM events WHERE event = 'jev_test_message' LIMIT 1)",
+ "SELECT props.category, p FROM (SELECT properties AS props, jev(properties.message, 'Refund?') AS p FROM events WHERE event = 'jev_test_message' LIMIT 1)",
self.team,
user=self.user,
)
@@ -339,7 +326,7 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
patch("httpx.AsyncClient.post", side_effect=gateway_response),
patch("posthog.hogql.query.sync_execute", wraps=sync_execute) as execute,
):
- execute_hogql_query("SELECT __preview_promptJev('refund', 'Refund?') AS p", self.team, user=self.user)
+ execute_hogql_query("SELECT jev('refund', 'Refund?') AS p", self.team, user=self.user)
timeouts = [
int(seconds)
for call in execute.call_args_list
@@ -350,13 +337,13 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
@parameterized.expand(
[
- ("SELECT __preview_promptJev('a', 'q')", "named SELECT"),
- ("SELECT __preview_promptJev('a', 'q') AS p ORDER BY p", "outside"),
- ("SELECT __preview_promptJev('a', 'q') AS p WHERE p > 0.5", "outer query"),
- ("SELECT labl FROM (SELECT __preview_promptJev('refund', 'Refund?') AS label)", "labl"),
- ("SELECT __preview_promptJev(toString(number), 'q') AS p FROM numbers(1001)", "at most 1000"),
+ ("SELECT jev('a', 'q')", "named SELECT"),
+ ("SELECT jev('a', 'q') AS p ORDER BY p", "outside"),
+ ("SELECT jev('a', 'q') AS p WHERE p > 0.5", "outer query"),
+ ("SELECT labl FROM (SELECT jev('refund', 'Refund?') AS label)", "labl"),
+ ("SELECT jev(toString(number), 'q') AS p FROM numbers(1001)", "at most 1000"),
(
- "SELECT __preview_promptJev(toString(number), 'Topic?') AS a, __preview_promptJev(toString(number), 'Tone?') AS b FROM numbers(600)",
+ "SELECT jev(toString(number), 'Topic?') AS a, jev(toString(number), 'Tone?') AS b FROM numbers(600)",
"query budget",
),
]
@@ -369,5 +356,5 @@ class TestPromptJevQuery(ClickhouseTestMixin, APIBaseTest):
@override_settings(AI_GATEWAY_URL="", AI_GATEWAY_API_KEY="")
def test_missing_gateway_configuration(self) -> None:
with patch("httpx.AsyncClient.post") as post, self.assertRaisesRegex(QueryError, "not configured"):
- execute_hogql_query("SELECT __preview_promptJev('a', 'q') AS p", self.team, user=self.user)
+ execute_hogql_query("SELECT jev('a', 'q') AS p", self.team, user=self.user)
post.assert_not_called()
diff --git a/posthog/hogql/transforms/prompt_jev.py b/posthog/hogql/transforms/prompt_jev.py
index afbc38c46325..be9d1cb50475 100644
--- a/posthog/hogql/transforms/prompt_jev.py
+++ b/posthog/hogql/transforms/prompt_jev.py
@@ -140,7 +140,7 @@ class PromptJevRunner:
assert self.client is not None
remaining = self.deadline - time.monotonic()
if remaining <= 0:
- raise QueryError("__preview_promptJev exceeded its time limit. Select fewer rows and try again.")
+ raise QueryError("jev exceeded its time limit. Select fewer rows and try again.")
questions: dict[str, Question] = {}
state: dict[str, str] = {}
for i, text in enumerate(texts):
@@ -186,7 +186,7 @@ class PromptJevRunner:
tasks = [asyncio.create_task(evaluate_batch(batch)) for batch in batches]
return await asyncio.gather(*tasks)
except TimeoutError as error:
- raise QueryError("__preview_promptJev exceeded its time limit. Select fewer rows and try again.") from error
+ raise QueryError("jev exceeded its time limit. Select fewer rows and try again.") from error
finally:
for task in tasks:
task.cancel()
@@ -200,17 +200,15 @@ class PromptJevRunner:
if value is None:
continue
if not isinstance(value, str):
- raise QueryError("__preview_promptJev input must be text. Use toString(input) to convert it.")
+ raise QueryError("jev input must be text. Use toString(input) to convert it.")
if len(value.encode()) > MAX_INPUT_BYTES:
- raise QueryError(
- "__preview_promptJev input exceeds 8 KiB. Shorten each input before classifying it."
- )
+ raise QueryError("jev input exceeds 8 KiB. Shorten each input before classifying it.")
key = _DecisionKey(question=question_key, text=value)
if key not in self.cache:
missing[key] = None
input_bytes = self.input_bytes + sum(len(key.text.encode()) for key in missing)
if len(self.cache) + len(missing) > MAX_DECISIONS or input_bytes > MAX_TOTAL_BYTES:
- raise QueryError("__preview_promptJev exceeds the query budget. Select fewer or shorter inputs.")
+ raise QueryError("jev exceeds the query budget. Select fewer or shorter inputs.")
return missing
def evaluate(self, spec: PromptJevCall, values: list[object]) -> list[object]:
@@ -291,13 +289,13 @@ class PromptJevBudget(TraversingVisitor):
or type(node.limit.value) is not int
or not 0 <= node.limit.value <= MAX_ROWS
):
- raise QueryError(f"__preview_promptJev LIMIT must be an integer literal between 0 and {MAX_ROWS}.")
+ raise QueryError(f"jev LIMIT must be an integer literal between 0 and {MAX_ROWS}.")
rows = node.limit.value
# Reserve the worst case before any stage runs, including stages that depend on earlier decisions.
self.decisions += rows * len(finder.calls)
if self.decisions > MAX_DECISIONS:
raise QueryError(
- f"__preview_promptJev exceeds the query budget of {MAX_DECISIONS} row evaluations across all columns and SELECTs. "
+ f"jev exceeds the query budget of {MAX_DECISIONS} row evaluations across all columns and SELECTs. "
f"This query reserves {self.decisions}. Add smaller LIMITs to the SELECTs containing Jev calls, "
"or use fewer Jev columns. A SELECT without LIMIT reserves 1000 rows per Jev column."
)
@@ -311,7 +309,7 @@ class _AliasReferences(TraversingVisitor):
def visit_field(self, node: ast.Field) -> None:
if node.chain and node.chain[0] in self.aliases:
- raise QueryError("Read __preview_promptJev result aliases from an outer query.")
+ raise QueryError("Read jev result aliases from an outer query.")
def visit_select_query(self, node: ast.SelectQuery) -> None:
# HogQL resolves a field only against its own SELECT, so fields in nested SELECTs cannot read these aliases.
@@ -398,30 +396,26 @@ class PromptJevPlanner(CloningVisitor):
or query.limit_percent
or query.limit_with_ties
):
- raise QueryError(
- "Apply grouping, sorting, and DISTINCT in a query outside the __preview_promptJev SELECT."
- )
+ raise QueryError("Apply grouping, sorting, and DISTINCT in a query outside the jev SELECT.")
specs: dict[int, PromptJevCall] = {}
aliases: set[str] = set()
for i, column in enumerate(query.select):
if (
isinstance(column, ast.Alias)
and isinstance(column.expr, ast.Call)
- and column.expr.name.lower() == "__preview_promptjev"
+ and column.expr.name.lower() == "jev"
):
specs[i] = PromptJevCall.parse(column.expr)
aliases.add(column.alias)
elif isinstance(column, ast.Field) and "*" in column.chain:
- raise QueryError("List columns explicitly in a __preview_promptJev SELECT instead of using '*'.")
+ raise QueryError("List columns explicitly in a jev SELECT instead of using '*'.")
if len(specs) != len(local.calls):
- raise QueryError("Use __preview_promptJev as a named SELECT column, then read it from an outer query.")
+ raise QueryError("Use jev as a named SELECT column, then read it from an outer query.")
source = clone_expr(query)
for i, spec in specs.items():
source.select[i] = ast.Alias(alias=cast(ast.Alias, query.select[i]).alias, expr=clone_expr(spec.input))
if PromptJevFinder.contains(source):
- raise QueryError(
- "Use __preview_promptJev only in SELECT columns. Filter its results in an outer query."
- )
+ raise QueryError("Use jev only in SELECT columns. Filter its results in an outer query.")
_AliasReferences(aliases).visit(source)
if source.limit is None:
source.limit = ast.Constant(value=MAX_ROWS + 1)
@@ -430,17 +424,17 @@ class PromptJevPlanner(CloningVisitor):
or type(source.limit.value) is not int
or not 0 <= source.limit.value <= MAX_ROWS
):
- raise QueryError(f"__preview_promptJev LIMIT must be an integer literal between 0 and {MAX_ROWS}.")
+ raise QueryError(f"jev LIMIT must be an integer literal between 0 and {MAX_ROWS}.")
result = self.execute(source)
response = result.response
if response.error:
raise QueryError(response.error)
rows: list[list[object]] = [list(row) for row in response.results or []]
if len(rows) > MAX_ROWS:
- raise QueryError(f"__preview_promptJev reads at most {MAX_ROWS} rows. Add a LIMIT to its SELECT.")
+ raise QueryError(f"jev reads at most {MAX_ROWS} rows. Add a LIMIT to its SELECT.")
names = response.columns or []
if len(names) != len(query.select) or len(set(names)) != len(names):
- raise QueryError("Give each column in the __preview_promptJev SELECT a unique name.")
+ raise QueryError("Give each column in the jev SELECT a unique name.")
kinds = [str(kind) for _, kind in response.types or []]
inputs = {i: [row[i] for row in rows] for i in specs}
self.runner.check_budget([(spec, inputs[i]) for i, spec in specs.items()])
@@ -471,16 +465,14 @@ class PromptJevPlanner(CloningVisitor):
def visit_call(self, node: ast.Call) -> ast.Call:
# Binding validates every call, including ones whose SELECT has no rows.
- if node.name.lower() == "__preview_promptjev":
+ if node.name.lower() == "jev":
PromptJevCall.parse(node)
return cast(ast.Call, super().visit_call(node))
def validate_prompt_jev_access(team: "Team") -> None:
if settings.CLICKHOUSE_USE_HTTP or team.pk in settings.CLICKHOUSE_USE_HTTP_PER_TEAM:
- raise QueryError(
- "__preview_promptJev requires the native ClickHouse connection. Ask your administrator to configure it."
- )
+ raise QueryError("jev requires the native ClickHouse connection. Ask your administrator to configure it.")
if not feature_enabled_or_false(
"hogql-prompt-jev",
str(team.uuid),
@@ -492,4 +484,4 @@ def validate_prompt_jev_access(team: "Team") -> None:
only_evaluate_locally=True,
send_feature_flag_events=False,
):
- raise QueryError("__preview_promptJev is not enabled for this project. Contact support to request access.")
+ raise QueryError("jev is not enabled for this project. Contact support to request access.")
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index e1ddf9b41245..a385d1d48ec7 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -1316,9 +1316,9 @@ AI_GATEWAY_INTERNAL_TOKEN = get_from_env("AI_GATEWAY_INTERNAL_TOKEN", "")
AI_GATEWAY_URL = get_from_env("AI_GATEWAY_URL", "")
AI_GATEWAY_API_KEY = get_from_env("AI_GATEWAY_API_KEY", "")
-# Decision model behind the preview HogQL `__preview_promptJev` function. Per environment, so a
+# Decision model behind the HogQL `jev` function. Per environment, so a
# different model can be measured without a code change.
-HOGQL_PROMPT_JEV_MODEL = get_from_env("HOGQL_PROMPT_JEV_MODEL", "posthog/hogference/jevk5-fp8-0.2")
+HOGQL_PROMPT_JEV_MODEL = get_from_env("HOGQL_PROMPT_JEV_MODEL", "posthog/hogference/jeeves-0.1")
# Projected into gateway_credential.json: a JSON team_id -> tier map
# ("free"/"pro"/"enterprise") for the gateway's rate-limit bucket.
diff --git a/products/data_warehouse/backend/test/__snapshots__/test_hogql_fixer_ai.ambr b/products/data_warehouse/backend/test/__snapshots__/test_hogql_fixer_ai.ambr
index 49de4e9b84ac..bc9d05c1f43e 100644
--- a/products/data_warehouse/backend/test/__snapshots__/test_hogql_fixer_ai.ambr
+++ b/products/data_warehouse/backend/test/__snapshots__/test_hogql_fixer_ai.ambr
@@ -74,7 +74,7 @@
And lastly these are some HogQL specific functions:
```
- ['matchesAction', 'sparkline', 'recordingButton', 'explainCSPReport', 'sortablesemver', 'embedText', 'lookupDomainType', 'lookupPaidSourceType', 'lookupPaidMediumType', 'lookupOrganicSourceType', 'lookupOrganicMediumType', 'convertCurrency', 'getSurveyResponse', 'uniqueSurveySubmissionsFilter', 'getTrafficType', 'getTrafficCategory', 'isLikelyBot', 'getBotType', 'getBotName', 'getBotOperator']
+ ['matchesAction', 'sparkline', 'recordingButton', 'explainCSPReport', 'sortablesemver', 'embedText', 'jev', 'lookupDomainType', 'lookupPaidSourceType', 'lookupPaidMediumType', 'lookupOrganicSourceType', 'lookupOrganicMediumType', 'convertCurrency', 'getSurveyResponse', 'uniqueSurveySubmissionsFilter', 'getTrafficType', 'getTrafficCategory', 'isLikelyBot', 'getBotType', 'getBotName', 'getBotOperator']
```
You fix HogQL errors that may come from either HogQL resolver errors or clickhouse execution errors. You don't help with other knowledge.
diff --git a/services/hogql-language-service/internal/completion/functions.go b/services/hogql-language-service/internal/completion/functions.go
index 557df3078bfc..5dd5b53a1b84 100644
--- a/services/hogql-language-service/internal/completion/functions.go
+++ b/services/hogql-language-service/internal/completion/functions.go
@@ -33,35 +33,35 @@ groupBitmapOrState groupBitmapState groupBitmapXor groupBitmapXorIf groupUniqArr
h3GetIndexesFromUnidirectionalEdge h3GetOriginIndexFromUnidirectionalEdge h3GetPentagonIndexes h3GetRes0Indexes h3GetResolution h3GetUnidirectionalEdge h3GetUnidirectionalEdgeBoundary h3GetUnidirectionalEdgesFromHexagon h3HexAreaKm2 h3HexAreaM2 h3HexRing h3IndexesAreNeighbors h3IsPentagon h3IsResClassIII h3IsValid h3Line h3NumHexagons h3PointDistKm h3PointDistM h3PointDistRads
h3ToCenterChild h3ToChildren h3ToGeo h3ToGeoBoundary h3ToParent h3ToString h3UnidirectionalEdgeIsValid h3kRing has hasAll hasAllTokens hasAny hasAnyTokens hasSubsequence hasSubsequenceCaseInsensitive hasSubsequenceCaseInsensitiveUTF8 hasSubsequenceUTF8 hasSubstr hasToken hasTokenCaseInsensitive
hasTokenCaseInsensitiveOrNull hasTokenOrNull hex hop hopEnd hopStart hypot if ifNotFinite ifnull ilike in indexHint indexOf initcap intDiv intDivOrZero intExp10 intExp2 isFinite
-isIPAddressInRange isIPv4String isIPv6String isInfinite isLikelyBot isNaN isNotNull isValidJSON isValidUTF8 isnull json_agg kurtPop kurtPopIf kurtSamp kurtSampIf lag lagInFrame languageCodeToName last_value lcm
-lead leadInFrame least left leftPad leftPadUTF8 length lengthUTF8 less lessOrEquals lgamma like ln locate log log10 log1p log2 lookupDomainType lookupOrganicMediumType
-lookupOrganicSourceType lookupPaidMediumType lookupPaidSourceType lower lowerUTF8 lpad ltrim make_date make_interval make_timestamp make_timestamptz map mapAdd mapApply mapContains mapContainsKeyLike mapExists mapExtractKeyLike mapFilter mapFromArrays
-mapKeys mapPopulateSeries mapSubtract mapUpdate mapValues match matchesAction max max2 maxArgMax maxArgMaxIf maxArgMaxOrDefault maxArgMaxOrDefaultIf maxArgMaxOrNull maxArgMaxOrNullIf maxArgMin maxArgMinIf maxArgMinOrDefault maxArgMinOrDefaultIf maxArgMinOrNull
-maxArgMinOrNullIf maxArray maxArrayIf maxArrayOrDefault maxArrayOrDefaultIf maxArrayOrNull maxArrayOrNullIf maxForEach maxForEachIf maxForEachOrDefault maxForEachOrDefaultIf maxForEachOrNull maxForEachOrNullIf maxIf maxIntersections maxIntersectionsIf maxIntersectionsPosition maxIntersectionsPositionIf maxMap maxMapIf
-maxMapOrDefault maxMapOrDefaultIf maxMapOrNull maxMapOrNullIf maxMerge maxMergeIf maxMergeOrDefault maxMergeOrDefaultIf maxMergeOrNull maxMergeOrNullIf maxOrDefault maxOrDefaultIf maxOrNull maxOrNullIf maxState maxStateIf maxStateOrDefault maxStateOrDefaultIf maxStateOrNull maxStateOrNullIf
-md5 median medianArgMax medianArgMaxIf medianArgMaxOrDefault medianArgMaxOrDefaultIf medianArgMaxOrNull medianArgMaxOrNullIf medianArgMin medianArgMinIf medianArgMinOrDefault medianArgMinOrDefaultIf medianArgMinOrNull medianArgMinOrNullIf medianArray medianArrayIf medianArrayOrDefault medianArrayOrDefaultIf medianArrayOrNull medianArrayOrNullIf
-medianBFloat16 medianBFloat16If medianDeterministic medianDeterministicIf medianExact medianExactHigh medianExactHighIf medianExactIf medianExactLow medianExactLowIf medianExactWeighted medianExactWeightedIf medianForEach medianForEachIf medianForEachOrDefault medianForEachOrDefaultIf medianForEachOrNull medianForEachOrNullIf medianIf medianMap
-medianMapIf medianMapOrDefault medianMapOrDefaultIf medianMapOrNull medianMapOrNullIf medianMerge medianMergeIf medianMergeOrDefault medianMergeOrDefaultIf medianMergeOrNull medianMergeOrNullIf medianOrDefault medianOrDefaultIf medianOrNull medianOrNullIf medianState medianStateIf medianStateOrDefault medianStateOrDefaultIf medianStateOrNull
-medianStateOrNullIf medianTDigest medianTDigestIf medianTDigestWeighted medianTDigestWeightedIf medianTiming medianTimingIf medianTimingWeighted medianTimingWeightedIf min min2 minArgMax minArgMaxIf minArgMaxOrDefault minArgMaxOrDefaultIf minArgMaxOrNull minArgMaxOrNullIf minArgMin minArgMinIf minArgMinOrDefault
-minArgMinOrDefaultIf minArgMinOrNull minArgMinOrNullIf minArray minArrayIf minArrayOrDefault minArrayOrDefaultIf minArrayOrNull minArrayOrNullIf minForEach minForEachIf minForEachOrDefault minForEachOrDefaultIf minForEachOrNull minForEachOrNullIf minIf minMap minMapIf minMapOrDefault minMapOrDefaultIf
-minMapOrNull minMapOrNullIf minMerge minMergeIf minMergeOrDefault minMergeOrDefaultIf minMergeOrNull minMergeOrNullIf minOrDefault minOrDefaultIf minOrNull minOrNullIf minState minStateIf minStateOrDefault minStateOrDefaultIf minStateOrNull minStateOrNullIf minus modulo
-moduloOrZero monthName multiFuzzyMatchAllIndices multiFuzzyMatchAny multiFuzzyMatchAnyIndex multiIf multiMatchAllIndices multiMatchAny multiMatchAnyIndex multiSearchAllPositions multiSearchAllPositionsCaseInsensitive multiSearchAllPositionsCaseInsensitiveUTF8 multiSearchAllPositionsUTF8 multiSearchAny multiSearchAnyCaseInsensitive multiSearchAnyCaseInsensitiveUTF8 multiSearchAnyUTF8 multiSearchFirstIndex multiSearchFirstIndexCaseInsensitive multiSearchFirstIndexCaseInsensitiveUTF8
-multiSearchFirstIndexUTF8 multiSearchFirstPosition multiSearchFirstPositionCaseInsensitive multiSearchFirstPositionCaseInsensitiveUTF8 multiSearchFirstPositionUTF8 multiply multiplyDecimal negate netloc ngramDistance ngramDistanceCaseInsensitive ngramDistanceCaseInsensitiveUTF8 ngramDistanceUTF8 ngramSearch ngramSearchCaseInsensitive ngramSearchCaseInsensitiveUTF8 ngramSearchUTF8 ngrams not notEmpty
-notEquals notILike notIn notLike now nowInBlock nth_value nullif or parseDateTime parseDateTimeBestEffort path pathFull percentile_cont percentile_disc pi plus pointInEllipses pointInPolygon port
-position positionCaseInsensitive positionCaseInsensitiveUTF8 positionUTF8 positiveModulo pow power protocol quantile quantileExact quantileIf quantiles quantilesIf quantilesMerge quantilesMergeIf quantilesState quantilesStateIf queryString queryStringAndFragment radians
-rand range rank recordingButton regexpExtract regexpQuoteMeta reinterpretAsFloat32 reinterpretAsFloat64 reinterpretAsInt128 reinterpretAsInt16 reinterpretAsInt256 reinterpretAsInt32 reinterpretAsInt64 reinterpretAsInt8 reinterpretAsUInt128 reinterpretAsUInt16 reinterpretAsUInt256 reinterpretAsUInt32 reinterpretAsUInt64 reinterpretAsUInt8
-reinterpretAsUUID repeat replace replaceAll replaceOne replaceRegexpAll replaceRegexpOne reverse reverseUTF8 right rightPad rightPadUTF8 round roundAge roundBankers roundDown roundDuration roundToExp2 rowNumberInAllBlocks rowNumberInBlock
-row_number rpad rtrim sign simpleLinearRegression simpleLinearRegressionIf sin sinh skewPop skewPopIf skewSamp skewSampIf sortablesemver sparkline splitByChar splitByNonAlpha splitByRegexp splitByString splitByWhitespace split_part
-sqrt startsWith stddevPop stddevPopIf stddevSamp stddevSampIf stringToH3 string_agg subBitmap substring substringUTF8 subtractDays subtractHours subtractMinutes subtractMonths subtractQuarters subtractSeconds subtractWeeks subtractYears sum
-sumArgMax sumArgMaxIf sumArgMaxOrDefault sumArgMaxOrDefaultIf sumArgMaxOrNull sumArgMaxOrNullIf sumArgMin sumArgMinIf sumArgMinOrDefault sumArgMinOrDefaultIf sumArgMinOrNull sumArgMinOrNullIf sumArray sumArrayIf sumArrayOrDefault sumArrayOrDefaultIf sumArrayOrNull sumArrayOrNullIf sumForEach sumForEachIf
-sumForEachMerge sumForEachOrDefault sumForEachOrDefaultIf sumForEachOrNull sumForEachOrNullIf sumForEachState sumIf sumMap sumMapIf sumMapMerge sumMapMergeIf sumMapOrDefault sumMapOrDefaultIf sumMapOrNull sumMapOrNullIf sumMerge sumMergeIf sumMergeOrDefault sumMergeOrDefaultIf sumMergeOrNull
-sumMergeOrNullIf sumOrDefault sumOrDefaultIf sumOrNull sumOrNullIf sumState sumStateIf sumStateOrDefault sumStateOrDefaultIf sumStateOrNull sumStateOrNullIf sumWithOverflow sumWithOverflowIf tan tgamma theilsU theilsUIf throwIf timeSlot timeSlots
-timeStampAdd timeStampSub timeZoneOf timeZoneOffset timezone toBool toDate toDateTime toDateTime64 toDateTimeUS toDayOfMonth toDayOfWeek toDayOfYear toDecimal toFloat toFloat64OrNull toFloatOrDefault toFloatOrNull toFloatOrZero toHour
-toIPv4 toIPv4OrDefault toIPv4OrNull toIPv4OrZero toIPv6 toIPv6OrDefault toIPv6OrNull toIPv6OrZero toISOWeek toISOYear toInt toIntOrDefault toIntOrZero toIntervalDay toIntervalHour toIntervalMinute toIntervalMonth toIntervalQuarter toIntervalSecond toIntervalWeek
-toIntervalYear toJSONString toLastDayOfMonth toLastDayOfWeek toMinute toModifiedJulianDay toMonday toMonth toNullable toNullableString toQuarter toSecond toStartOfDay toStartOfFifteenMinutes toStartOfFiveMinutes toStartOfHour toStartOfISOYear toStartOfInterval toStartOfMinute toStartOfMonth
-toStartOfQuarter toStartOfSecond toStartOfTenMinutes toStartOfWeek toStartOfYear toString toTime toTimeZone toTypeName toUUID toUUIDOrDefault toUnixTimestamp toUnixTimestamp64Milli toValidUTF8 toWeek toYYYYMM toYYYYMMDD toYYYYMMDDhhmmss toYear toYearWeek
-to_char to_date to_timestamp today tokens topK topLevelDomain transform translate translateUTF8 trim trimLeft trimRight trunc tryBase58Decode tryBase64Decode tumble tumbleEnd tumbleStart tuple
-tupleDivide tupleDivideByNumber tupleElement tupleHammingDistance tupleMinus tupleMultiply tupleMultiplyByNumber tupleNegate tuplePlus tupleToNameValuePairs unhex uniq uniqCombined uniqCombined64 uniqExact uniqExactIf uniqExactMerge uniqExactState uniqHLL12 uniqHLL12If
-uniqIf uniqMap uniqMapMerge uniqMapMergeIf uniqMerge uniqMergeIf uniqState uniqStateIf uniqTheta uniqThetaIf uniqUpToMerge uniqueSurveySubmissionsFilter untuple upper upperUTF8 varPop varPopIf varSamp varSampIf width_bucket
-windowFunnel xor yesterday
+isIPAddressInRange isIPv4String isIPv6String isInfinite isLikelyBot isNaN isNotNull isValidJSON isValidUTF8 isnull jev json_agg kurtPop kurtPopIf kurtSamp kurtSampIf lag lagInFrame languageCodeToName last_value
+lcm lead leadInFrame least left leftPad leftPadUTF8 length lengthUTF8 less lessOrEquals lgamma like ln locate log log10 log1p log2 lookupDomainType
+lookupOrganicMediumType lookupOrganicSourceType lookupPaidMediumType lookupPaidSourceType lower lowerUTF8 lpad ltrim make_date make_interval make_timestamp make_timestamptz map mapAdd mapApply mapContains mapContainsKeyLike mapExists mapExtractKeyLike mapFilter
+mapFromArrays mapKeys mapPopulateSeries mapSubtract mapUpdate mapValues match matchesAction max max2 maxArgMax maxArgMaxIf maxArgMaxOrDefault maxArgMaxOrDefaultIf maxArgMaxOrNull maxArgMaxOrNullIf maxArgMin maxArgMinIf maxArgMinOrDefault maxArgMinOrDefaultIf
+maxArgMinOrNull maxArgMinOrNullIf maxArray maxArrayIf maxArrayOrDefault maxArrayOrDefaultIf maxArrayOrNull maxArrayOrNullIf maxForEach maxForEachIf maxForEachOrDefault maxForEachOrDefaultIf maxForEachOrNull maxForEachOrNullIf maxIf maxIntersections maxIntersectionsIf maxIntersectionsPosition maxIntersectionsPositionIf maxMap
+maxMapIf maxMapOrDefault maxMapOrDefaultIf maxMapOrNull maxMapOrNullIf maxMerge maxMergeIf maxMergeOrDefault maxMergeOrDefaultIf maxMergeOrNull maxMergeOrNullIf maxOrDefault maxOrDefaultIf maxOrNull maxOrNullIf maxState maxStateIf maxStateOrDefault maxStateOrDefaultIf maxStateOrNull
+maxStateOrNullIf md5 median medianArgMax medianArgMaxIf medianArgMaxOrDefault medianArgMaxOrDefaultIf medianArgMaxOrNull medianArgMaxOrNullIf medianArgMin medianArgMinIf medianArgMinOrDefault medianArgMinOrDefaultIf medianArgMinOrNull medianArgMinOrNullIf medianArray medianArrayIf medianArrayOrDefault medianArrayOrDefaultIf medianArrayOrNull
+medianArrayOrNullIf medianBFloat16 medianBFloat16If medianDeterministic medianDeterministicIf medianExact medianExactHigh medianExactHighIf medianExactIf medianExactLow medianExactLowIf medianExactWeighted medianExactWeightedIf medianForEach medianForEachIf medianForEachOrDefault medianForEachOrDefaultIf medianForEachOrNull medianForEachOrNullIf medianIf
+medianMap medianMapIf medianMapOrDefault medianMapOrDefaultIf medianMapOrNull medianMapOrNullIf medianMerge medianMergeIf medianMergeOrDefault medianMergeOrDefaultIf medianMergeOrNull medianMergeOrNullIf medianOrDefault medianOrDefaultIf medianOrNull medianOrNullIf medianState medianStateIf medianStateOrDefault medianStateOrDefaultIf
+medianStateOrNull medianStateOrNullIf medianTDigest medianTDigestIf medianTDigestWeighted medianTDigestWeightedIf medianTiming medianTimingIf medianTimingWeighted medianTimingWeightedIf min min2 minArgMax minArgMaxIf minArgMaxOrDefault minArgMaxOrDefaultIf minArgMaxOrNull minArgMaxOrNullIf minArgMin minArgMinIf
+minArgMinOrDefault minArgMinOrDefaultIf minArgMinOrNull minArgMinOrNullIf minArray minArrayIf minArrayOrDefault minArrayOrDefaultIf minArrayOrNull minArrayOrNullIf minForEach minForEachIf minForEachOrDefault minForEachOrDefaultIf minForEachOrNull minForEachOrNullIf minIf minMap minMapIf minMapOrDefault
+minMapOrDefaultIf minMapOrNull minMapOrNullIf minMerge minMergeIf minMergeOrDefault minMergeOrDefaultIf minMergeOrNull minMergeOrNullIf minOrDefault minOrDefaultIf minOrNull minOrNullIf minState minStateIf minStateOrDefault minStateOrDefaultIf minStateOrNull minStateOrNullIf minus
+modulo moduloOrZero monthName multiFuzzyMatchAllIndices multiFuzzyMatchAny multiFuzzyMatchAnyIndex multiIf multiMatchAllIndices multiMatchAny multiMatchAnyIndex multiSearchAllPositions multiSearchAllPositionsCaseInsensitive multiSearchAllPositionsCaseInsensitiveUTF8 multiSearchAllPositionsUTF8 multiSearchAny multiSearchAnyCaseInsensitive multiSearchAnyCaseInsensitiveUTF8 multiSearchAnyUTF8 multiSearchFirstIndex multiSearchFirstIndexCaseInsensitive
+multiSearchFirstIndexCaseInsensitiveUTF8 multiSearchFirstIndexUTF8 multiSearchFirstPosition multiSearchFirstPositionCaseInsensitive multiSearchFirstPositionCaseInsensitiveUTF8 multiSearchFirstPositionUTF8 multiply multiplyDecimal negate netloc ngramDistance ngramDistanceCaseInsensitive ngramDistanceCaseInsensitiveUTF8 ngramDistanceUTF8 ngramSearch ngramSearchCaseInsensitive ngramSearchCaseInsensitiveUTF8 ngramSearchUTF8 ngrams not
+notEmpty notEquals notILike notIn notLike now nowInBlock nth_value nullif or parseDateTime parseDateTimeBestEffort path pathFull percentile_cont percentile_disc pi plus pointInEllipses pointInPolygon
+port position positionCaseInsensitive positionCaseInsensitiveUTF8 positionUTF8 positiveModulo pow power protocol quantile quantileExact quantileIf quantiles quantilesIf quantilesMerge quantilesMergeIf quantilesState quantilesStateIf queryString queryStringAndFragment
+radians rand range rank recordingButton regexpExtract regexpQuoteMeta reinterpretAsFloat32 reinterpretAsFloat64 reinterpretAsInt128 reinterpretAsInt16 reinterpretAsInt256 reinterpretAsInt32 reinterpretAsInt64 reinterpretAsInt8 reinterpretAsUInt128 reinterpretAsUInt16 reinterpretAsUInt256 reinterpretAsUInt32 reinterpretAsUInt64
+reinterpretAsUInt8 reinterpretAsUUID repeat replace replaceAll replaceOne replaceRegexpAll replaceRegexpOne reverse reverseUTF8 right rightPad rightPadUTF8 round roundAge roundBankers roundDown roundDuration roundToExp2 rowNumberInAllBlocks
+rowNumberInBlock row_number rpad rtrim sign simpleLinearRegression simpleLinearRegressionIf sin sinh skewPop skewPopIf skewSamp skewSampIf sortablesemver sparkline splitByChar splitByNonAlpha splitByRegexp splitByString splitByWhitespace
+split_part sqrt startsWith stddevPop stddevPopIf stddevSamp stddevSampIf stringToH3 string_agg subBitmap substring substringUTF8 subtractDays subtractHours subtractMinutes subtractMonths subtractQuarters subtractSeconds subtractWeeks subtractYears
+sum sumArgMax sumArgMaxIf sumArgMaxOrDefault sumArgMaxOrDefaultIf sumArgMaxOrNull sumArgMaxOrNullIf sumArgMin sumArgMinIf sumArgMinOrDefault sumArgMinOrDefaultIf sumArgMinOrNull sumArgMinOrNullIf sumArray sumArrayIf sumArrayOrDefault sumArrayOrDefaultIf sumArrayOrNull sumArrayOrNullIf sumForEach
+sumForEachIf sumForEachMerge sumForEachOrDefault sumForEachOrDefaultIf sumForEachOrNull sumForEachOrNullIf sumForEachState sumIf sumMap sumMapIf sumMapMerge sumMapMergeIf sumMapOrDefault sumMapOrDefaultIf sumMapOrNull sumMapOrNullIf sumMerge sumMergeIf sumMergeOrDefault sumMergeOrDefaultIf
+sumMergeOrNull sumMergeOrNullIf sumOrDefault sumOrDefaultIf sumOrNull sumOrNullIf sumState sumStateIf sumStateOrDefault sumStateOrDefaultIf sumStateOrNull sumStateOrNullIf sumWithOverflow sumWithOverflowIf tan tgamma theilsU theilsUIf throwIf timeSlot
+timeSlots timeStampAdd timeStampSub timeZoneOf timeZoneOffset timezone toBool toDate toDateTime toDateTime64 toDateTimeUS toDayOfMonth toDayOfWeek toDayOfYear toDecimal toFloat toFloat64OrNull toFloatOrDefault toFloatOrNull toFloatOrZero
+toHour toIPv4 toIPv4OrDefault toIPv4OrNull toIPv4OrZero toIPv6 toIPv6OrDefault toIPv6OrNull toIPv6OrZero toISOWeek toISOYear toInt toIntOrDefault toIntOrZero toIntervalDay toIntervalHour toIntervalMinute toIntervalMonth toIntervalQuarter toIntervalSecond
+toIntervalWeek toIntervalYear toJSONString toLastDayOfMonth toLastDayOfWeek toMinute toModifiedJulianDay toMonday toMonth toNullable toNullableString toQuarter toSecond toStartOfDay toStartOfFifteenMinutes toStartOfFiveMinutes toStartOfHour toStartOfISOYear toStartOfInterval toStartOfMinute
+toStartOfMonth toStartOfQuarter toStartOfSecond toStartOfTenMinutes toStartOfWeek toStartOfYear toString toTime toTimeZone toTypeName toUUID toUUIDOrDefault toUnixTimestamp toUnixTimestamp64Milli toValidUTF8 toWeek toYYYYMM toYYYYMMDD toYYYYMMDDhhmmss toYear
+toYearWeek to_char to_date to_timestamp today tokens topK topLevelDomain transform translate translateUTF8 trim trimLeft trimRight trunc tryBase58Decode tryBase64Decode tumble tumbleEnd tumbleStart
+tuple tupleDivide tupleDivideByNumber tupleElement tupleHammingDistance tupleMinus tupleMultiply tupleMultiplyByNumber tupleNegate tuplePlus tupleToNameValuePairs unhex uniq uniqCombined uniqCombined64 uniqExact uniqExactIf uniqExactMerge uniqExactState uniqHLL12
+uniqHLL12If uniqIf uniqMap uniqMapMerge uniqMapMergeIf uniqMerge uniqMergeIf uniqState uniqStateIf uniqTheta uniqThetaIf uniqUpToMerge uniqueSurveySubmissionsFilter untuple upper upperUTF8 varPop varPopIf varSamp varSampIf
+width_bucket windowFunnel xor yesterday
`)