You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore(webapp): update dependencies and refactor AI tool integration to use the new API
- Upgraded `@ai-sdk/openai` to version `3.0.0` and `ai` to version `6.0.116` in `package.json`.
- Refactored AI tool calls in `ai-generate.tsx`, `ai-generate-payload.tsx`, and `aiQueryService.server.ts` to use updated input handling.
- Changed `maxSteps` to `stopWhen` in several service files for better clarity and consistency.
- Updated import statements to reflect changes in the `ai` package.
- Removed unused peer dependencies from `pnpm-lock.yaml` to streamline the lock file.
Copy file name to clipboardExpand all lines: apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.query.ai-generate.tsx
Copy file name to clipboardExpand all lines: apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.test.ai-generate-payload.tsx
"Look up the source code of the task to understand what payload shape it expects. Use this when there is no JSON Schema available and you need to infer the payload structure from the task implementation.",
"Set the time filter for the query page UI instead of adding time conditions to the query. ALWAYS use this tool when the user wants to filter by time (e.g., 'last 7 days', 'past hour', 'yesterday'). The UI will apply this filter automatically using the table's time column (triggered_at for runs, bucket_start for metrics). Do NOT add triggered_at or bucket_start to the WHERE clause for time filtering - use this tool instead.",
69
-
parameters: z.object({
69
+
inputSchema: z.object({
70
70
period: z
71
71
.string()
72
72
.optional()
@@ -125,7 +125,7 @@ export class AIQueryService {
125
125
validateTSQLQuery: tool({
126
126
description:
127
127
"Validate a TSQL query for syntax errors and schema compliance. Always use this tool to verify your query before returning it to the user.",
128
-
parameters: z.object({
128
+
inputSchema: z.object({
129
129
query: z.string().describe("The TSQL query to validate"),
130
130
}),
131
131
execute: async({ query })=>{
@@ -135,7 +135,7 @@ export class AIQueryService {
135
135
getTableSchema: tool({
136
136
description:
137
137
"Get detailed schema information about available tables and columns. Use this to understand what data is available and how to query it.",
138
-
parameters: z.object({
138
+
inputSchema: z.object({
139
139
tableName: z
140
140
.string()
141
141
.optional()
@@ -147,7 +147,7 @@ export class AIQueryService {
147
147
}),
148
148
setTimeFilter: this.buildSetTimeFilterTool(),
149
149
},
150
-
maxSteps: 5,
150
+
stopWhen: stepCountIs(5),
151
151
experimental_telemetry: {
152
152
isEnabled: true,
153
153
metadata: {
@@ -191,7 +191,7 @@ export class AIQueryService {
191
191
validateTSQLQuery: tool({
192
192
description:
193
193
"Validate a TSQL query for syntax errors and schema compliance. Always use this tool to verify your query before returning it to the user.",
194
-
parameters: z.object({
194
+
inputSchema: z.object({
195
195
query: z.string().describe("The TSQL query to validate"),
196
196
}),
197
197
execute: async({ query })=>{
@@ -201,7 +201,7 @@ export class AIQueryService {
201
201
getTableSchema: tool({
202
202
description:
203
203
"Get detailed schema information about available tables and columns. Use this to understand what data is available and how to query it.",
@@ -91,7 +91,7 @@ export class AIRunFilterService {
91
91
tools: {
92
92
lookupTags: tool({
93
93
description: "Look up available tags in the environment",
94
-
parameters: z.object({
94
+
inputSchema: z.object({
95
95
query: z.string().optional().describe("Optional search query to filter tags"),
96
96
}),
97
97
execute: async({ query })=>{
@@ -101,7 +101,7 @@ export class AIRunFilterService {
101
101
lookupVersions: tool({
102
102
description:
103
103
"Look up available versions in the environment. If you specify `isCurrent` it will return a single version string if it finds one. Otherwise it will return an array of version strings.",
104
-
parameters: z.object({
104
+
inputSchema: z.object({
105
105
isCurrent: z
106
106
.boolean()
107
107
.optional()
@@ -119,7 +119,7 @@ export class AIRunFilterService {
119
119
}),
120
120
lookupQueues: tool({
121
121
description: "Look up available queues in the environment",
122
-
parameters: z.object({
122
+
inputSchema: z.object({
123
123
query: z.string().optional().describe("Optional search query to filter queues"),
124
124
type: z
125
125
.enum(["task","custom"])
@@ -135,13 +135,13 @@ export class AIRunFilterService {
135
135
lookupTasks: tool({
136
136
description:
137
137
"Look up available tasks in the environment. It will return each one. The `slug` is used for the filtering. You also get the triggerSource which is either `STANDARD` or `SCHEDULED`",
138
-
parameters: z.object({}),
138
+
inputSchema: z.object({}),
139
139
execute: async()=>{
140
140
returnawaitthis.queryFns.queryTasks.query();
141
141
},
142
142
}),
143
143
},
144
-
maxSteps: 5,
144
+
stopWhen: stepCountIs(5),
145
145
system: `You are an AI assistant that converts natural language descriptions into structured filter parameters for a task run filtering system.
0 commit comments