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.
@@ -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