Skip to content

Commit 2bc70d5

Browse files
Merge pull request #3184 from quadratichq/qa
QA July 8
2 parents 2d18a56 + c368fe8 commit 2bc70d5

File tree

52 files changed

+504
-429
lines changed

Some content is hidden

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

52 files changed

+504
-429
lines changed

.github/workflows/qa-deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ jobs:
298298
service:
299299
- name: client
300300
url: "https://qa.quadratic-preview.com/version.json"
301-
- name: api-heroku
302-
url: "https://quadratic-staging.herokuapp.com/health"
301+
# - name: api-heroku
302+
# url: "https://quadratic-staging.herokuapp.com/health"
303303
- name: api-aws
304304
url: "https://api-pr-qa.quadratic-preview.com/health"
305305
- name: multiplayer

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.13.1"
17+
version = "0.13.2"
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.13.1
1+
0.13.2

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.13.1",
3+
"version": "0.13.2",
44
"author": {
55
"name": "David Kircos",
66
"email": "david@quadratichq.com",

quadratic-api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "quadratic-api",
3-
"version": "0.13.1",
3+
"version": "0.13.2",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import type { AIModelKey, AIRequestHelperArgs, ParsedAIResponse } from 'quadrati
1717
import { handleAnthropicRequest } from '../../ai/handler/anthropic.handler';
1818
import { handleBedrockRequest } from '../../ai/handler/bedrock.handler';
1919
import { handleOpenAIRequest } from '../../ai/handler/openai.handler';
20-
import { getQuadraticContext, getToolUseContext } from '../../ai/helpers/context.helper';
20+
import { getCurrentDateContext, getQuadraticContext, getToolUseContext } from '../../ai/helpers/context.helper';
2121
import {
2222
anthropic,
2323
bedrock,
@@ -42,6 +42,14 @@ export const handleAIRequest = async (
4242
): Promise<ParsedAIResponse | undefined> => {
4343
let args = inputArgs;
4444
try {
45+
if (args.time) {
46+
const currentDateContext = getCurrentDateContext(args.time);
47+
args = {
48+
...args,
49+
messages: [...currentDateContext, ...args.messages],
50+
};
51+
}
52+
4553
if (args.useToolsPrompt) {
4654
const toolUseContext = getToolUseContext(args.source);
4755
args = {
@@ -51,7 +59,7 @@ export const handleAIRequest = async (
5159
}
5260

5361
if (args.useQuadraticContext) {
54-
const quadraticContext = getQuadraticContext(args.language, args.time);
62+
const quadraticContext = getQuadraticContext(args.language);
5563
args = {
5664
...args,
5765
messages: [...quadraticContext, ...args.messages],

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

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { JavascriptDocs } from '../docs/JavascriptDocs';
66
import { PythonDocs } from '../docs/PythonDocs';
77
import { QuadraticDocs } from '../docs/QuadraticDocs';
88

9-
export const getQuadraticContext = (language?: CodeCellType, time?: string): ChatMessage[] => [
9+
export const getQuadraticContext = (language?: CodeCellType): ChatMessage[] => [
1010
{
1111
role: 'user',
1212
content: [
@@ -17,8 +17,9 @@ You are a helpful assistant inside of a spreadsheet application called Quadratic
1717
Be minimally verbose in your explanations of the code and data you produce.\n
1818
You are an agent - please keep going until the user's query is completely resolved, before ending your turn and yielding back to the user. Only terminate your turn when you are sure that the problem is solved.\n
1919
If you are not sure about sheet data content pertaining to the user's request, use your tools to read data and gather the relevant information: do NOT guess or make up an answer.\n
20-
Be proactive. When the user makes a request, use your tools to solve it. Don't ask the user for clarifying information before trying to solve the user's query. If you don't see the data you need, use your tool for retrieving relevant data and then solve the problem.\n
21-
The current date is ${time || new Date().toString()}.\n
20+
Be proactive. When the user makes a request, use your tools to solve it.\n
21+
IMPORTANT: Don't ask the user for clarifying information before trying to solve the user's query. If you don't see the data you need, use your tools for retrieving relevant data and then solve the problem.\n
22+
Do what you think is most appropriate instead of asking for clarifying details. The user will correct you if what you do is incorrect. The user will be displeased if you ask for clarifying details.\n
2223
This is the documentation for Quadratic:\n
2324
${QuadraticDocs}\n\n
2425
${language === 'Python' || language === undefined ? PythonDocs : ''}\n
@@ -95,3 +96,28 @@ ${Object.entries(aiToolsSpec)
9596
},
9697
];
9798
};
99+
100+
export const getCurrentDateContext = (time: string): ChatMessage[] => {
101+
return [
102+
{
103+
role: 'user',
104+
content: [
105+
{
106+
type: 'text',
107+
text: `The current date is ${time || new Date().toString()}.`,
108+
},
109+
],
110+
contextType: 'currentDate',
111+
},
112+
{
113+
role: 'assistant',
114+
content: [
115+
{
116+
type: 'text',
117+
text: `I understand the current date and user locale.`,
118+
},
119+
],
120+
contextType: 'currentDate',
121+
},
122+
];
123+
};

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export const getModelKey = async (
2323
exceededBillingLimit: boolean
2424
): Promise<AIModelKey> => {
2525
try {
26+
if (!['AIAnalyst', 'AIAssistant'].includes(inputArgs.source)) {
27+
return modelKey;
28+
}
29+
2630
if (!isOnPaidPlan) {
2731
return DEFAULT_MODEL_FREE;
2832
}

quadratic-client/package.json

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

0 commit comments

Comments
 (0)