vzcode 1.58.0 → 1.60.0
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/assets/{buildWorker-C_tGhWXG.js → buildWorker-Dsx6rOdK.js} +1 -1
- package/dist/assets/{index-CE_xP06t.css → index-DMIy-XE4.css} +1 -1
- package/dist/assets/{index-CtGus8Qk.js → index-S-R8oY72.js} +116 -116
- package/dist/assets/{worker-BrwN8AXx.js → worker-BSzbM0Uo.js} +180 -180
- package/dist/assets/{worker-CekYspLa.js → worker-y5jhqCTR.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +5 -5
- package/src/client/VZCodeContext/index.tsx +29 -0
- package/src/client/VZCodeContext/types.ts +236 -0
- package/src/client/{VZCodeContext.tsx → VZCodeContext/useVZCodeState.ts} +39 -284
- package/src/client/VZSidebar/AIChat/Message.tsx +2 -0
- package/src/client/VZSidebar/AIChat/MessageList.tsx +0 -2
- package/src/client/VZSidebar/AIChat/ThinkingScratchpad.tsx +121 -2
- package/src/client/VZSidebar/AIChat/index.tsx +2 -15
- package/src/client/VZSidebar/AIChat/styles.scss +18 -0
- package/src/server/aiChatHandler/index.ts +3 -0
- package/src/server/aiChatHandler/llmStreaming.ts +3 -0
|
@@ -24,11 +24,13 @@ export const handleAIChatMessage =
|
|
|
24
24
|
createAIEditLocalPresence,
|
|
25
25
|
onCreditDeduction,
|
|
26
26
|
getCurrentCommitId,
|
|
27
|
+
model,
|
|
27
28
|
}: {
|
|
28
29
|
shareDBDoc: ShareDBDoc<VizContent>;
|
|
29
30
|
createAIEditLocalPresence: () => any;
|
|
30
31
|
onCreditDeduction?: any;
|
|
31
32
|
getCurrentCommitId?: () => string | null;
|
|
33
|
+
model?: string;
|
|
32
34
|
}) =>
|
|
33
35
|
async (req: any, res: any) => {
|
|
34
36
|
const { content, chatId, mode = 'edit' } = req.body;
|
|
@@ -67,6 +69,7 @@ export const handleAIChatMessage =
|
|
|
67
69
|
shareDBDoc,
|
|
68
70
|
createAIEditLocalPresence,
|
|
69
71
|
chatId,
|
|
72
|
+
model,
|
|
70
73
|
});
|
|
71
74
|
|
|
72
75
|
// Create server-side runCode function using shareDBDoc
|
|
@@ -49,11 +49,13 @@ export const createLLMFunction = ({
|
|
|
49
49
|
// When false, reasoning tokens are not requested from the API
|
|
50
50
|
// and reasoning content is not processed in the streaming response.
|
|
51
51
|
enableReasoningTokens = false,
|
|
52
|
+
model,
|
|
52
53
|
}: {
|
|
53
54
|
shareDBDoc: ShareDBDoc<VizContent>;
|
|
54
55
|
createAIEditLocalPresence: () => any;
|
|
55
56
|
chatId: VizChatId;
|
|
56
57
|
enableReasoningTokens?: boolean;
|
|
58
|
+
model?: string;
|
|
57
59
|
}) => {
|
|
58
60
|
return async (fullPrompt: string) => {
|
|
59
61
|
const localPresence = enableStreamingEditing
|
|
@@ -200,6 +202,7 @@ export const createLLMFunction = ({
|
|
|
200
202
|
|
|
201
203
|
// Stream the response with reasoning tokens
|
|
202
204
|
const modelName =
|
|
205
|
+
model ||
|
|
203
206
|
process.env.VIZHUB_EDIT_WITH_AI_MODEL_NAME ||
|
|
204
207
|
'anthropic/claude-3.5-sonnet';
|
|
205
208
|
|