Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dependency on external Google Fonts #50

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ USER nextjs
EXPOSE 3000

ENV PORT 3000
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD ["node", "server.js"]
CMD HOSTNAME="0.0.0.0" node server.js
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ docker run -d -p 3000:3000 \

### Running Locally

1. Install NodeJS 18.
1. Install NodeJS 20.
2. Clone the repository.
3. Install dependencies with `npm install`.
4. Copy `.env.example` to `.env.local` and update environment variables.
Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ docker run -d -p 3000:3000 \

### 本地运行

1. 安装NodeJS 18
1. 安装NodeJS 20
2. 克隆仓库。
3. 使用`npm install`安装依赖。
4. 复制`.env.example`文件为`.env.local`并更新环境变量。
Expand Down
4 changes: 2 additions & 2 deletions app/api/chat/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getApiConfig = () => {
let model: string
if (useAzureOpenAI) {
let apiBaseUrl = process.env.AZURE_OPENAI_API_BASE_URL
const apiVersion = '2023-05-15'
const apiVersion = '2024-02-01'
const deployment = process.env.AZURE_OPENAI_DEPLOYMENT || ''
if (apiBaseUrl && apiBaseUrl.endsWith('/')) {
apiBaseUrl = apiBaseUrl.slice(0, -1)
Expand Down Expand Up @@ -112,7 +112,7 @@ const getOpenAIStream = async (

try {
const json = JSON.parse(data)
const text = json.choices[0].delta.content
const text = json.choices[0]?.delta.content
const queue = encoder.encode(text)
controller.enqueue(queue)
} catch (e) {
Expand Down
5 changes: 1 addition & 4 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Analytics } from '@vercel/analytics/react'
import { Inter } from 'next/font/google'
import { Toaster } from 'react-hot-toast'
import { Header } from '@/components/Header'
import ThemesProvider from '@/providers/ThemesProvider'
Expand All @@ -19,12 +18,10 @@ export const metadata = {
}
}

const inter = Inter({ subsets: ['latin'], variable: '--font-inter' })

export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en" suppressHydrationWarning>
<body className={inter.className}>
<body>
<ThemesProvider>
<Header />
{children}
Expand Down
2 changes: 1 addition & 1 deletion components/Chat/Chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import toast from 'react-hot-toast'
import { AiOutlineClear, AiOutlineLoading3Quarters, AiOutlineUnorderedList } from 'react-icons/ai'
import { FiSend } from 'react-icons/fi'
import ChatContext from './chatContext'
import { Chat, ChatMessage } from './interface'
import type { Chat, ChatMessage } from './interface'
import Message from './Message'

import './index.scss'
Expand Down
Loading