-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
199 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { EnvModule } from '#api/common/service/env/env.module'; | ||
import { LangchainModule } from '#api/infra/langchain/langchain.module'; | ||
import { Modules } from '#api/module'; | ||
|
||
@Module({ | ||
imports: [EnvModule, LangchainModule, ...Modules], | ||
imports: [EnvModule, LangchainModule], | ||
}) | ||
export class AppModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# auto generated folder | ||
generated/ | ||
.vercel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import('next').NextConfig} */ | ||
const config = { | ||
reactStrictMode: true, | ||
transpilePackages: ['@hayabusa/ui'], | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "@hanjaemeo-api/website", | ||
"version": "0.1.0", | ||
"repository": "https://github.com/HanJaemEo/hanjaemeo-api.git", | ||
"license": "MIT", | ||
"private": true, | ||
"type": "module", | ||
"module": "nodenext", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start", | ||
"fmt": "biome format .", | ||
"fmt:fix": "biome format --write", | ||
"lint": "biome lint .", | ||
"lint:fix": "biome lint --apply", | ||
"test": "bun test" | ||
}, | ||
"dependencies": { | ||
"ai": "3.0.12", | ||
"next": "14.1.3", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0", | ||
"sharp": "0.33.2", | ||
"ts-pattern": "5.0.8" | ||
}, | ||
"devDependencies": { | ||
"@hanjaemeo-api/tsconfig": "workspace:*", | ||
"@hanjaemeo-api/type": "workspace:*", | ||
"@types/react": "18.2.65", | ||
"@types/react-dom": "18.2.22" | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
'use client'; | ||
|
||
import { useChat } from 'ai/react'; | ||
|
||
type ChatProps = { | ||
api: NonNullable<Parameters<typeof useChat>['0']>['api']; | ||
}; | ||
|
||
export const Chat = ({ api }: ChatProps) => { | ||
const { messages, input, isLoading, handleInputChange, handleSubmit } = useChat({ | ||
api, | ||
onResponse: response => { | ||
// biome-ignore lint/suspicious/noConsoleLog: | ||
console.log('response', response); | ||
}, | ||
}); | ||
|
||
return ( | ||
<div> | ||
<ul> | ||
{messages.map((m, index) => ( | ||
// biome-ignore lint/suspicious/noArrayIndexKey: | ||
<li key={index}> | ||
{m.role === 'user' ? 'User: ' : 'AI: '} | ||
{m.content} | ||
</li> | ||
))} | ||
</ul> | ||
<form onSubmit={handleSubmit}> | ||
<label> | ||
Say something... | ||
<input value={input} onChange={handleInputChange} /> | ||
</label> | ||
<button type='submit'>Send</button> | ||
{isLoading && <span>...</span>} | ||
</form> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { NextPage } from 'next'; | ||
import type { ReactNode } from 'react'; | ||
|
||
type RootLayoutProps = { | ||
children: ReactNode; | ||
}; | ||
|
||
const RootLayout: NextPage<RootLayoutProps> = ({ children }) => { | ||
return ( | ||
<html lang='en' suppressHydrationWarning> | ||
<head /> | ||
<body>{children}</body> | ||
</html> | ||
); | ||
}; | ||
|
||
export default RootLayout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { NextPage } from 'next'; | ||
import { Chat } from './chat'; | ||
|
||
const RootPage: NextPage = () => ( | ||
<div className='flex flex-col gap-20'> | ||
<div className='flex items-center gap-10'> | ||
<h1 className='text-xl text-sage-12'>GPT</h1> | ||
<Chat api='https://hanjaemeo-production.up.railway.app/call' /> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default RootPage; | ||
|
||
export const runtime = 'edge'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": ["**/test/**/*", "**/*.*js", "**/*.test.ts", "**/*.story.tsx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"$schema": "https://json.schemastore.org/tsconfig", | ||
"extends": "@hanjaemeo-api/tsconfig/tsconfig.nextjs.json", | ||
"compilerOptions": { | ||
"baseUrl": "./", | ||
"paths": { | ||
"#website/*": ["./src/*"] | ||
} | ||
}, | ||
"include": ["./src/**/*", "./*.*js", "./*.*ts", ".next/types/**/*.*ts", ".next/types/**/*.ts"], | ||
"exclude": ["**/node_modules/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters