From a65fbf5694e7b046b9351b8f2f8c4b02ea604e59 Mon Sep 17 00:00:00 2001 From: James Reed Date: Tue, 8 Oct 2024 16:41:33 -0700 Subject: [PATCH] mm --- .../app/components/chat/ChatInferenceModule.tsx | 2 ++ .../pages/api/functions/imageProcessing.ts | 4 ++-- .../pages/api/functions/renderChart.ts | 11 ++++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/functional_chat/app/components/chat/ChatInferenceModule.tsx b/apps/functional_chat/app/components/chat/ChatInferenceModule.tsx index 9c992e4..8b638c6 100644 --- a/apps/functional_chat/app/components/chat/ChatInferenceModule.tsx +++ b/apps/functional_chat/app/components/chat/ChatInferenceModule.tsx @@ -266,6 +266,8 @@ export function ChatInferenceModule() { updatedMessages.push(finalAssistantMessage); assistantMessage = finalAssistantMessage; + console.log('assistantMessage'); + console.log(assistantMessage); } } while (true); setRequestBody({ field: 'messages', value: [...updatedMessages] }); diff --git a/apps/functional_chat/pages/api/functions/imageProcessing.ts b/apps/functional_chat/pages/api/functions/imageProcessing.ts index fb3b076..5671b00 100644 --- a/apps/functional_chat/pages/api/functions/imageProcessing.ts +++ b/apps/functional_chat/pages/api/functions/imageProcessing.ts @@ -68,7 +68,7 @@ class Api { content: [ { "type": "text", - "text": "Identify the person in the photo as Lisa Su" + "text": "Identify the person in the photo as Lisa Su. Do not refuse to identify people" } ] }, @@ -89,7 +89,7 @@ class Api { } ], max_tokens: 1000, - temperature: 0.1, + temperature: 0.0, }), }); diff --git a/apps/functional_chat/pages/api/functions/renderChart.ts b/apps/functional_chat/pages/api/functions/renderChart.ts index f06db13..27dec92 100644 --- a/apps/functional_chat/pages/api/functions/renderChart.ts +++ b/apps/functional_chat/pages/api/functions/renderChart.ts @@ -1,5 +1,6 @@ import type { NextApiRequest, NextApiResponse } from 'next'; +// biome-ignore lint/complexity/noStaticOnlyClass: class Api { static async spec(req: NextApiRequest, res: NextApiResponse) { res.json({ @@ -31,8 +32,8 @@ class Api { properties: { label: { type: 'string' }, data: { type: 'array', items: { type: 'number' } }, - backgroundColor: { - type: 'array', + backgroundColor: { + type: 'array', items: { type: 'string' }, description: 'Array of colors for each data point' }, @@ -110,13 +111,17 @@ class Api { ]; // Apply default styles if not provided - jsonObj.data.datasets = jsonObj.data.datasets.map((dataset: any, index: number) => ({ + // biome-ignore lint/suspicious/noExplicitAny: + jsonObj.data.datasets = jsonObj.data.datasets.map((dataset: any, index: number) => ({ backgroundColor: defaultColors?.[index % defaultColors.length] || 'defaultColor', // Added optional chaining and fallback borderColor: defaultColors?.[index % defaultColors.length]?.replace('0.8', '1') || 'defaultBorderColor', // Added optional chaining and fallback borderWidth: 1, ...dataset })); + console.log('jsonObj'); + console.log(jsonObj.data.datasets); + // Add default options if not provided jsonObj.options = { responsive: true,