Skip to content

Commit 27a71f5

Browse files
Merge pull request #3090 from quadratichq/qa
QA June 17th
2 parents 7378696 + db2d051 commit 27a71f5

File tree

112 files changed

+1591
-971
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1591
-971
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ edition = "2024"
1414
description = "Infinite data grid with Python, JavaScript, and SQL built-in"
1515
repository = "https://github.com/quadratichq/quadratic"
1616
license-file = "LICENSE"
17-
version = "0.11.2"
17+
version = "0.11.3"
1818

1919
[profile.release]
2020
# Tell `rustc` to optimize for small code size.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.11.2
1+
0.11.3

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quadratic",
3-
"version": "0.11.2",
3+
"version": "0.11.3",
44
"author": {
55
"name": "David Kircos",
66
"email": "david@quadratichq.com",

quadratic-api/package.json

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quadratic-api",
3-
"version": "0.11.2",
3+
"version": "0.11.3",
44
"description": "",
55
"main": "index.js",
66
"scripts": {
@@ -31,14 +31,13 @@
3131
},
3232
"author": "David Kircos",
3333
"dependencies": {
34-
"@anthropic-ai/bedrock-sdk": "^0.22.1",
35-
"@anthropic-ai/sdk": "^0.53.0",
36-
"@anthropic-ai/vertex-sdk": "^0.11.4",
37-
"@aws-sdk/client-bedrock-runtime": "^3.826.0",
34+
"@anthropic-ai/bedrock-sdk": "0.22.1",
35+
"@anthropic-ai/sdk": "0.54.0",
36+
"@anthropic-ai/vertex-sdk": "0.11.4",
37+
"@aws-sdk/client-bedrock-runtime": "3.830.0",
3838
"@aws-sdk/client-s3": "^3.427.0",
39-
"@aws-sdk/client-secrets-manager": "^3.441.0",
4039
"@aws-sdk/s3-request-presigner": "^3.427.0",
41-
"@google/genai": "1.4.0",
40+
"@google/genai": "1.5.1",
4241
"@ory/kratos-client": "^1.2.1",
4342
"@prisma/client": "^4.12.0",
4443
"@sendgrid/mail": "^8.1.0",
@@ -57,10 +56,7 @@
5756
"jwks-rsa": "^3.0.0",
5857
"multer": "^2.0.0",
5958
"multer-s3": "^3.0.1",
60-
"newrelic": "^11.17.0",
61-
"openai": "^4.103.0",
62-
"pg": "^8.11.3",
63-
"ssh-keygen": "^0.5.0",
59+
"openai": "5.5.1",
6460
"stripe": "^14.16.0",
6561
"supertest": "^6.3.3",
6662
"zod": "^3.25.3"

quadratic-api/src/ai/handler/ai.handler.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
isVertexAIModel,
1111
isXAIModel,
1212
} from 'quadratic-shared/ai/helpers/model.helper';
13-
import { DEFAULT_BACKUP_MODEL } from 'quadratic-shared/ai/models/AI_MODELS';
13+
import { DEFAULT_BACKUP_MODEL, DEFAULT_BACKUP_MODEL_THINKING } from 'quadratic-shared/ai/models/AI_MODELS';
1414
import type {
1515
AIMessagePrompt,
1616
AIModelKey,
@@ -95,12 +95,17 @@ export const handleAIRequest = async (
9595
} catch (error) {
9696
console.error('Error in handleAIRequest: ', modelKey, error);
9797

98-
if (
99-
ENVIRONMENT === 'production' &&
100-
modelKey !== DEFAULT_BACKUP_MODEL &&
101-
['AIAnalyst', 'AIAssistant'].includes(args.source)
102-
) {
103-
return handleAIRequest(DEFAULT_BACKUP_MODEL, args, response);
98+
if (ENVIRONMENT === 'production' && ['AIAnalyst', 'AIAssistant'].includes(args.source)) {
99+
const options = getModelOptions(modelKey, inputArgs);
100+
101+
// thinking backup model
102+
if (options.thinking && modelKey !== DEFAULT_BACKUP_MODEL_THINKING) {
103+
return handleAIRequest(DEFAULT_BACKUP_MODEL_THINKING, args, response);
104+
}
105+
// non-thinking backup model
106+
else if (!options.thinking && modelKey !== DEFAULT_BACKUP_MODEL) {
107+
return handleAIRequest(DEFAULT_BACKUP_MODEL, args, response);
108+
}
104109
}
105110

106111
const responseMessage: AIMessagePrompt = {

quadratic-api/src/ai/handler/genai.handler.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ export const handleGenAIRequest = async (
3030
maxOutputTokens: options.max_tokens,
3131
tools,
3232
toolConfig: tool_choice,
33+
...(options.thinking !== undefined && {
34+
thinkingConfig: {
35+
includeThoughts: options.thinking,
36+
thinkingBudget: options.thinkingBudget,
37+
},
38+
}),
3339
},
3440
};
3541

quadratic-api/src/ai/helpers/genai.helper.ts

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -205,20 +205,41 @@ export async function parseGenAIStream(
205205

206206
// text and tool calls
207207
for (const part of candidate?.content?.parts ?? []) {
208-
if (part.text !== undefined) {
209-
let currentContent = responseMessage.content.pop();
210-
if (currentContent?.type !== 'text') {
211-
if (currentContent?.text) {
212-
responseMessage.content.push(currentContent);
208+
if (part.text) {
209+
// thinking text
210+
if (part.thought) {
211+
let currentContent = responseMessage.content.pop();
212+
if (currentContent?.type !== 'google_thinking') {
213+
if (currentContent?.text) {
214+
responseMessage.content.push(currentContent);
215+
}
216+
currentContent = {
217+
type: 'google_thinking',
218+
text: '',
219+
};
213220
}
214-
currentContent = {
215-
type: 'text',
216-
text: '',
217-
};
221+
currentContent.text += part.text;
222+
responseMessage.content.push(currentContent);
218223
}
219-
currentContent.text += part.text;
220-
responseMessage.content.push(currentContent);
221-
} else if (part.functionCall?.name) {
224+
// chat text
225+
else {
226+
let currentContent = responseMessage.content.pop();
227+
if (currentContent?.type !== 'text') {
228+
if (currentContent?.text) {
229+
responseMessage.content.push(currentContent);
230+
}
231+
currentContent = {
232+
type: 'text',
233+
text: '',
234+
};
235+
}
236+
currentContent.text += part.text;
237+
responseMessage.content.push(currentContent);
238+
}
239+
}
240+
241+
// tool call
242+
if (part.functionCall?.name) {
222243
responseMessage.toolCalls.push({
223244
id: part.functionCall.id ?? part.functionCall.name,
224245
name: part.functionCall.name,

quadratic-api/src/ai/helpers/modelRouter.helper.ts

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export const getModelKey = async (modelKey: AIModelKey, inputArgs: AIRequestHelp
6565
<capabilities>
6666
<capability>Creating sample data</capability>
6767
<capability>Creating calculators</capability>
68+
<capability>Creating new charts</capability>
69+
<capability>Editing existing charts</capability>
6870
<capability>Requests that involve frustration</capability>
6971
<capability>Onboarding questions</capability>
7072
<capability>Data cleaning</capability>
@@ -75,15 +77,14 @@ export const getModelKey = async (modelKey: AIModelKey, inputArgs: AIRequestHelp
7577
<capability>Charts that have problems</capability>
7678
<capability>API requests</capability>
7779
<capability>Any capabilities not defined in these instructions</capability>
80+
<capability>Requests that involve frustration</capability>
81+
<capability>Charts that have problems</capability>
7882
</capabilities>
7983
</model>
8084
<model name="4.1">
8185
<capabilities>
82-
<capability>Creating new charts</capability>
83-
<capability>Editing existing charts</capability>
8486
<capability>Simple/explicitly defined formatting</capability>
8587
<capability>Moving data to specific cell locations</capability>
86-
<capability>Simple calculations and formulas - sums, means, averages, filters, etc.</capability>
8788
</capabilities>
8889
</model>
8990
</models>
@@ -109,18 +110,6 @@ export const getModelKey = async (modelKey: AIModelKey, inputArgs: AIRequestHelp
109110
<user>Create a mortgage calculator</user>
110111
<answer>Claude</answer>
111112
</example>
112-
<example>
113-
<user>try again</user>
114-
<answer>Claude</answer>
115-
</example>
116-
<example>
117-
<user>Why do you keep failing?</user>
118-
<answer>Claude</answer>
119-
</example>
120-
<example>
121-
<user>Chart is empty or missing data</user>
122-
<answer>Claude</answer>
123-
</example>
124113
<example>
125114
<user>Hi, I'm new to Quadratic.</user>
126115
<answer>Claude</answer>
@@ -150,7 +139,15 @@ export const getModelKey = async (modelKey: AIModelKey, inputArgs: AIRequestHelp
150139
<answer>Claude</answer>
151140
</example>
152141
<example>
153-
<user>That chart has an issue</user>
142+
<user>Add an extra axis to my chart</user>
143+
<answer>Claude</answer>
144+
</example>
145+
<example>
146+
<user>Change the line to blue</user>
147+
<answer>Claude</answer>
148+
</example>
149+
<example>
150+
<user>Create a chart</user>
154151
<answer>Claude</answer>
155152
</example>
156153
<example>
@@ -159,31 +156,35 @@ export const getModelKey = async (modelKey: AIModelKey, inputArgs: AIRequestHelp
159156
</example>
160157
<example>
161158
<user>Find the mean, filtered by product type</user>
162-
<answer>4.1</answer>
159+
<answer>Claude</answer>
163160
</example>
164161
<example>
165162
<user>Sum the values in column F</user>
166-
<answer>4.1</answer>
163+
<answer>Claude</answer>
167164
</example>
168165
<example>
169166
<user>Calculate the mean of costs</user>
170-
<answer>4.1</answer>
167+
<answer>Claude</answer>
171168
</example>
172169
<example>
173170
<user>move that to A9</user>
174171
<answer>4.1</answer>
175172
</example>
176173
<example>
177-
<user>Add an extra axis to my chart</user>
178-
<answer>4.1</answer>
174+
<user>That chart has an issue</user>
175+
<answer>Claude</answer>
176+
</example>
177+
<example>
178+
<user>try again</user>
179+
<answer>Claude</answer>
179180
</example>
180181
<example>
181-
<user>Change the line to blue</user>
182-
<answer>4.1</answer>
182+
<user>Why do you keep failing?</user>
183+
<answer>Claude</answer>
183184
</example>
184185
<example>
185-
<user>Create a chart</user>
186-
<answer>4.1</answer>
186+
<user>Chart is empty or missing data</user>
187+
<answer>Claude</answer>
187188
</example>
188189
</examples>
189190
`,

quadratic-client/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quadratic-client",
3-
"version": "0.11.2",
3+
"version": "0.11.3",
44
"author": {
55
"name": "David Kircos",
66
"email": "david@quadratichq.com",
@@ -58,7 +58,7 @@
5858
"@mui/icons-material": "^5.2.0",
5959
"@mui/material": "^5.2.2",
6060
"@ory/kratos-client": "^1.2.1",
61-
"@protobuf-ts/plugin": "^2.9.6",
61+
"@protobuf-ts/runtime": "^2.11.0",
6262
"@radix-ui/react-icons": "^1.3.2",
6363
"@sentry/react": "^9.6.1",
6464
"@szhsin/react-menu": "^4.0.2",
@@ -91,15 +91,14 @@
9191
"react-router": "^7.5.2",
9292
"recoil": "^0.7.7",
9393
"remark-gfm": "^4.0.0",
94-
"semver": "^7.7.1",
9594
"tailwind-merge": "^3.2.0",
96-
"ua-parser-js": "^2.0.3",
9795
"uuid": "^11.1.0",
9896
"vscode-jsonrpc": "^8.2.1",
9997
"vscode-languageserver-protocol": "^3.17.5",
10098
"zod": "^3.25.3"
10199
},
102100
"devDependencies": {
101+
"@protobuf-ts/plugin": "^2.11.0",
103102
"@sentry/vite-plugin": "^3.3.1",
104103
"@tailwindcss/container-queries": "^0.1.1",
105104
"@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"version": "0.11.2"
2+
"version": "0.11.3"
33
}

0 commit comments

Comments
 (0)