Skip to content

Commit

Permalink
WIP: Use tauri to package the project
Browse files Browse the repository at this point in the history
  • Loading branch information
Amery2010 committed Jun 11, 2024
1 parent 9a4d903 commit a4073e8
Show file tree
Hide file tree
Showing 31 changed files with 4,123 additions and 13 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ Supports Gemini 1.5 and Gemini 1.5 Flash multimodal models
## Roadmap

- [x] Reconstruct the topic square and introduce Prompt list
- [x] Use tauri to package desktop applications
- [ ] Implementation based on functionCall plug-in
- [ ] Support conversation list
- [ ] Use tauri to package desktop applications

## 开发计划

- [x] 重构话题广场,引入 Prompt 列表
- [x] 使用 tauri 打包桌面应用
- [ ] 实现基于 functionCall 插件
- [ ] 支持对话列表
- [ ] 使用 tauri 打包桌面应用

## Get Started

Expand Down Expand Up @@ -407,11 +407,11 @@ Currently, the two models `Gemini 1.5 Pro` and `Gemini 1.5 Flash` support most i

~~目前了解到的 vercel 与 netlify 都使用了无服务器的边缘计算,虽然响应速度快,但对于上传文件有大小限制。Cloudflare Worker 对于大文件限制(免费用户 500MB,收费用户 5GB)相对宽松,可以用做 api 代理。[如何部署 Cloudflare Worker api 代理](/docs/How-to-deploy-the-Cloudflare-Worker-api-proxy.md)~~

#### 关于无法使用语音对话功能的问题须知
#### ~~关于无法使用语音对话功能的问题须知~~

目前语音识别使用的是浏览器的 SpeechRecognition 接口,系统会在[部分不支持 SpeechRecognition 接口的浏览器](https://caniuse.com/?search=SpeechRecognition)**隐藏语音对话功能**
~~目前语音识别使用的是浏览器的 SpeechRecognition 接口,系统会在[部分不支持 SpeechRecognition 接口的浏览器](https://caniuse.com/?search=SpeechRecognition)**隐藏语音对话功能**~~

由于大部分基于 Chrome 内核的浏览器在 SpeechRecognition 接口的实现上使用了 Google 的语音识别服务,因此需要能够正常访问国际网络的情况下使用。
~~由于大部分基于 Chrome 内核的浏览器在 SpeechRecognition 接口的实现上使用了 Google 的语音识别服务,因此需要能够正常访问国际网络的情况下使用。~~

#### 为什么我无法上传 doc、excel、pdf 这类常见文档

Expand All @@ -421,8 +421,6 @@ Currently, the two models `Gemini 1.5 Pro` and `Gemini 1.5 Flash` support most i

vercel 部署后生成的域名在几年前就已经被国内网络屏蔽,但并没有屏蔽服务器的 ip 地址。可以自定义域名,就可以在国内正常访问了。由于 vercel 在国内并没有服务器,所以有时候会出现些许的网络波动,属于正常现象。如何设置域名,可以参考我从网上找到的解决文章[Vercel绑定自定义域名](https://docs.tangly1024.com/article/vercel-domain)

**注意:尽可能不要在微信里使用 vercel 部署的网站,具体原因不多解释**

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=Amery2010/TalkWithGemini&type=Date)](https://star-history.com/#Amery2010/TalkWithGemini&Date)
Expand Down
4 changes: 2 additions & 2 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ interface AnswerParams {
onError?: (error: string, code?: number) => void
}

const buildMode = process.env.NEXT_PUBLIC_BUILD_MODE as string
const BUILD_MODE = process.env.NEXT_PUBLIC_BUILD_MODE as string
const nanoid = customAlphabet('1234567890abcdefghijklmnopqrstuvwxyz', 8)

const AssistantRecommend = dynamic(() => import('@/components/AssistantRecommend'))
Expand Down Expand Up @@ -426,7 +426,7 @@ export default function Home() {
const checkAccessStatus = useCallback(() => {
const { isProtected, password, apiKey } = useSettingStore.getState()
const isProtectedMode = isProtected && password === '' && apiKey === ''
const isStaticMode = buildMode === 'export' && apiKey === ''
const isStaticMode = BUILD_MODE === 'export' && apiKey === ''
if (isProtectedMode || isStaticMode) {
setSetingOpen(true)
return false
Expand Down
2 changes: 1 addition & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const uploadProxyUrl = process.env.GEMINI_UPLOAD_BASE_URL || 'https://generative
/** @type {(phase: string, defaultConfig: import("next").NextConfig) => Promise<import("next").NextConfig>} */
module.exports = async (phase) => {
const nextConfig = {
transpilePackages: ['crypto-js'],
transpilePackages: ['crypto-js', 'lodash-es'],
images: {
unoptimized: mode === 'export',
},
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "talk-with-gemini",
"version": "0.11.1",
"version": "0.11.2",
"private": true,
"author": "Amery2010 <[email protected]>",
"license": "GPL-3.0-only",
Expand All @@ -9,6 +9,7 @@
"build": "next build",
"build:docker": "cross-env NEXT_PUBLIC_BUILD_MODE=standalone next build",
"build:export": "cross-env NEXT_PUBLIC_BUILD_MODE=export next build",
"tauri:dev": "tauri dev",
"start": "next start",
"lint": "next lint"
},
Expand Down Expand Up @@ -62,6 +63,7 @@
"zustand": "^4.5.2"
},
"devDependencies": {
"@tauri-apps/cli": "^1.5.14",
"@types/crypto-js": "^4.2.2",
"@types/lodash-es": "^4.17.12",
"@types/markdown-it": "^13.0.8",
Expand Down
111 changes: 111 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified public/icons/logo-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/icons/logo-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/sw.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by Cargo
# will have compiled files and executables
/target/
Loading

0 comments on commit a4073e8

Please sign in to comment.