From 36a54831cef4ed95c933f3029a4d4feb7faa856d Mon Sep 17 00:00:00 2001 From: Ivan Rudik Date: Sun, 9 Nov 2025 02:20:56 +0000 Subject: [PATCH] added chatbot and exportType folder with the types --- app/api/auth/[...auth0]/route.js | 7 ------- app/chatbot/page.tsx | 2 +- app/exportType/types.ts | 30 ++++++++++++++++++++++++++++++ app/formfile/page.tsx | 2 +- tsconfig.json | 2 +- 5 files changed, 33 insertions(+), 10 deletions(-) delete mode 100644 app/api/auth/[...auth0]/route.js create mode 100644 app/exportType/types.ts diff --git a/app/api/auth/[...auth0]/route.js b/app/api/auth/[...auth0]/route.js deleted file mode 100644 index 1c99c77..0000000 --- a/app/api/auth/[...auth0]/route.js +++ /dev/null @@ -1,7 +0,0 @@ -// app/api/auth/[auth0]/route.js - -import { handleAuth } from '@auth0/nextjs-auth0'; - -export const runtime = 'nodejs'; - -export const GET = handleAuth(); \ No newline at end of file diff --git a/app/chatbot/page.tsx b/app/chatbot/page.tsx index df0c671..363f852 100644 --- a/app/chatbot/page.tsx +++ b/app/chatbot/page.tsx @@ -4,7 +4,7 @@ import { useState, useEffect, useRef, useCallback } from "react"; import { useSearchParams } from "next/navigation"; import ChatInput from "../utils/component/ui/ChatInput"; import MessageWindow from "../utils/component/ui/MessageWindow"; -import { ChatHistory, ChatSetting, Message , MessageRole } from "./exportType/types"; +import { ChatHistory, ChatSetting, Message , MessageRole } from "@/app/exportType/types"; export default function Home(){ const [history, setHistory] = useState([]) diff --git a/app/exportType/types.ts b/app/exportType/types.ts new file mode 100644 index 0000000..eca26ad --- /dev/null +++ b/app/exportType/types.ts @@ -0,0 +1,30 @@ +export type MessageRole = "user" | "model"; + +export type MessagePart = { + text: string; +} + +export interface Message{ + role: MessageRole; + parts:MessagePart[]; +} +export type ChatHistory = Message[]; + +export interface GenerateConfig{ + temperature : number; + topP : number; + responseMimeType : string; +} + +export interface ChatSetting{ + temperature :number; + model: string; + sysTemInstructions: string; +} + +export interface CardData { + id: number; + title: string; + tracks: string[]; + summary: string; +} \ No newline at end of file diff --git a/app/formfile/page.tsx b/app/formfile/page.tsx index 4ae8426..ccf46ef 100644 --- a/app/formfile/page.tsx +++ b/app/formfile/page.tsx @@ -3,7 +3,7 @@ "use client"; import React, { useState, useEffect, useCallback } from "react"; import FormPage from './FormPage'; -import { ChatSetting, CardData } from "../exportType/types"; +import { ChatSetting, CardData } from "@/app/exportType/types"; import { FormData, PROFICIENCY_LEVELS } from './formTypes'; import SwipeCards from '../cards/page'; diff --git a/tsconfig.json b/tsconfig.json index 3a13f90..765b0d3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2017", + "target": "ES2018", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,