added chatbot and exportType folder with the types

This commit is contained in:
Ivan Rudik
2025-11-09 02:20:56 +00:00
parent 475b830b60
commit 36a54831ce
5 changed files with 33 additions and 10 deletions
-7
View File
@@ -1,7 +0,0 @@
// app/api/auth/[auth0]/route.js
import { handleAuth } from '@auth0/nextjs-auth0';
export const runtime = 'nodejs';
export const GET = handleAuth();
+1 -1
View File
@@ -4,7 +4,7 @@ import { useState, useEffect, useRef, useCallback } from "react";
import { useSearchParams } from "next/navigation"; import { useSearchParams } from "next/navigation";
import ChatInput from "../utils/component/ui/ChatInput"; import ChatInput from "../utils/component/ui/ChatInput";
import MessageWindow from "../utils/component/ui/MessageWindow"; 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(){ export default function Home(){
const [history, setHistory] = useState<ChatHistory>([]) const [history, setHistory] = useState<ChatHistory>([])
+30
View File
@@ -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;
}
+1 -1
View File
@@ -3,7 +3,7 @@
"use client"; "use client";
import React, { useState, useEffect, useCallback } from "react"; import React, { useState, useEffect, useCallback } from "react";
import FormPage from './FormPage'; import FormPage from './FormPage';
import { ChatSetting, CardData } from "../exportType/types"; import { ChatSetting, CardData } from "@/app/exportType/types";
import { FormData, PROFICIENCY_LEVELS } from './formTypes'; import { FormData, PROFICIENCY_LEVELS } from './formTypes';
import SwipeCards from '../cards/page'; import SwipeCards from '../cards/page';
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"target": "ES2017", "target": "ES2018",
"lib": ["dom", "dom.iterable", "esnext"], "lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true, "allowJs": true,
"skipLibCheck": true, "skipLibCheck": true,