Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fcc6be4
feat: change question to plain text, remove hash caching
zhu-xiaowei Feb 14, 2025
e91aab7
feat: render markdown with only new message coming
zhu-xiaowei Feb 17, 2025
56adf0d
feat: copy Markdown as project file
zhu-xiaowei Feb 17, 2025
8d8dacb
feat: support custom super cache for markdown
zhu-xiaowei Feb 18, 2025
cfa8804
fix: request stop issue
zhu-xiaowei Feb 18, 2025
4a8560a
fix: space token issue
zhu-xiaowei Feb 18, 2025
efd42a0
feat: support reasoning display
zhu-xiaowei Feb 25, 2025
ebdef0d
feat: add BedrockThinkingModels as constants add model price and sett…
zhu-xiaowei Feb 25, 2025
25b22e1
fix: multiple bedrock chunk parse issue
zhu-xiaowei Feb 26, 2025
dc74caf
fix: render issue for display mode latex after text without break line
zhu-xiaowei Feb 26, 2025
b590703
feat: add flexDirection to column-reverse to support correct reasonin…
zhu-xiaowei Feb 27, 2025
0493d83
feat: remove expand for reasoning
zhu-xiaowei Feb 27, 2025
174724f
feat: add cache for code node rendering
zhu-xiaowei Feb 27, 2025
ed10d06
feat: update template for claude 3.7
zhu-xiaowei Feb 27, 2025
bc7acdb
feat: revert release template
zhu-xiaowei Feb 27, 2025
db611ee
fix: large list will render empty page issue
zhu-xiaowei Feb 27, 2025
17d04e2
fix: simplify inner flatlist render logic
zhu-xiaowei Feb 27, 2025
67b1600
fix: bedrock api return multiple type response under one chunk
zhu-xiaowei Feb 27, 2025
675549e
fix: remove unused style, reduce padding for reasoning
zhu-xiaowei Feb 27, 2025
600e32f
fix: generate image issue after add custom cache for useMarkdown
zhu-xiaowei Feb 27, 2025
c970ff7
fix: settings page model id display issue, and update template
zhu-xiaowei Feb 28, 2025
6939b24
fix: update lambda timeout to 900s, fix cancel request issue, improve…
zhu-xiaowei Feb 28, 2025
b250fd9
feat: revert release-template.yml
zhu-xiaowei Feb 28, 2025
3d6181f
feat: update reasoning and code background color
zhu-xiaowei Mar 1, 2025
e067555
docs: update readme with api changes, and API Key alert text.
zhu-xiaowei Mar 1, 2025
30b98d4
docs: update readme header, download url and add expanded
zhu-xiaowei Mar 1, 2025
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
49 changes: 33 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
[中文](/README_CN.md)

# SwiftChat - A Cross-platform AI Chat App

> 🚀 Your Personal AI Assistant - Fast, Private, and Cross-platform

[![GitHub Release](https://img.shields.io/github/v/release/aws-samples/swift-chat)](https://github.com/aws-samples/swift-chat/releases)
[![License](https://img.shields.io/badge/license-MIT--0-green)](LICENSE)

## 📱 Quick Download

- [Download for Android](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.apk)
- [Download for macOS](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.dmg)
- For iOS: Currently available through local build with Xcode

[中文](/README_CN.md)

SwiftChat is a fast and responsive AI chat application developed with [React Native](https://reactnative.dev/) and
powered by [Amazon Bedrock](https://aws.amazon.com/bedrock/), with compatibility extending to other model providers such
as Ollama, DeepSeek, and OpenAI. With its minimalist design philosophy and robust privacy protection, it delivers
Expand Down Expand Up @@ -100,6 +111,9 @@ Please follow
the [Amazon Bedrock User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) to
enable your models.

<details>
<summary><b>🔧 Configuration Steps (Click to expand)</b></summary>

### Step 1: Set up your API Key

1. Sign in to your AWS console and
Expand Down Expand Up @@ -138,19 +152,14 @@ enable your models.
Wait about 3-5 minutes for the deployment to finish, then click the CloudFormation stack and go to **Outputs** tab, you
can find the **API URL** which looks like: `https://xxx.xxx.awsapprunner.com` or `https://xxx.lambda-url.xxx.on.aws`

### Step 3: Download the app and setup with API URL and API Key

1. Download the App

- Android App click to [Download](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.apk)
- macOS App click to [Download](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.dmg)
- iOS (Currently we do not provide the iOS version, you can build it locally with Xcode)
### Step 3: Open the App and setup with API URL and API Key

2. Launch the App, open the drawer menu, and tap **Settings**.
3. Paste the `API URL` and `API Key` then select the Region.
4. Click the top right ✓ icon to save your configuration and start your chat.
1. Launch the App, open the drawer menu, and tap **Settings**.
2. Paste the `API URL` and `API Key`(The **Value** you typed in Parameter Store) then select the Region.
3. Click the top right ✓ icon to save your configuration and start your chat.

Congratulations 🎉 Your SwiftChat App is ready to use!
</details>

### Supported Region

Expand All @@ -168,7 +177,8 @@ Congratulations 🎉 Your SwiftChat App is ready to use!

## Getting Started with Other Model Providers

### Configure Ollama
<details>
<summary><b>🔧 Configure Ollama (Click to expand)</b></summary>

1. Navigate to the **Settings Page** and select the **Ollama** tab.
2. Enter your Ollama Server URL. For example:
Expand All @@ -178,15 +188,21 @@ Congratulations 🎉 Your SwiftChat App is ready to use!
3. Once the correct Server URL is entered, you can select your desired Ollama models from the **Text Model** dropdown
list.

### Configure DeepSeek
</details>

<details>
<summary><b>🔧 Configure DeepSeek (Click to expand)</b></summary>

1. Go to the **Settings Page** and select the **DeepSeek** tab.
2. Input your DeepSeek API Key.
3. Choose DeepSeek models from the **Text Model** dropdown list. Currently, the following DeepSeek models are supported:
- `DeepSeek-V3`
- `DeepSeek-R1`

### Configure OpenAI
</details>

<details>
<summary><b>🔧 Configure OpenAI (Click to expand)</b></summary>

1. Navigate to the **Settings Page** and select the **OpenAI** tab.
2. Enter your OpenAI API Key.
Expand All @@ -197,6 +213,8 @@ Congratulations 🎉 Your SwiftChat App is ready to use!
Additionally, if you have deployed the [ClickStream Server](#step-2-deploy-stack-and-get-your-api-url), you can enable
the **Use Proxy** option to forward your requests.

</details>

## Detailed Features

**Quick Access Tools**: Code Copy, Selection Mode, Scroll Controls and Token Counter
Expand Down Expand Up @@ -265,7 +283,6 @@ orientation.

- Speed up end-to-end API requests through **image compression**
- Deploying APIs in the **same region** as Bedrock provides lower latency
- Minimal response payload with **zero parsing** needed for direct display

📱 **Fast Render Speed**

Expand Down
61 changes: 37 additions & 24 deletions README_CN.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
[English](/README.md)

# SwiftChat - 跨平台 AI 聊天应用

> 🚀 您的私人 AI 助手 - 快速、安全、跨平台

[![GitHub Release](https://img.shields.io/github/v/release/aws-samples/swift-chat)](https://github.com/aws-samples/swift-chat/releases)
[![License](https://img.shields.io/badge/license-MIT--0-green)](LICENSE)

## 📱 快速下载

- [下载 Android 版本](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.apk)
- [下载 macOS 版本](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.dmg)
- iOS 版本:目前可通过 Xcode 本地构建使用

[English](/README.md)

SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https://reactnative.dev/)
开发,并依托 [Amazon Bedrock](https://aws.amazon.com/bedrock/) 提供强大支持,同时兼容 Ollama、DeepSeek 和 OpenAI
等其他模型供应商。凭借其极简设计理念与坚实的隐私保护措施,该应用在 Android、iOS 和 macOS 平台上实现了实时流式对话及 AI
Expand Down Expand Up @@ -71,7 +82,7 @@ SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https
我们重新设计了用户界面,优化了字体大小和行间距,呈现出更优雅、清爽的视觉效果。这些功能也都完美适配了 Android 和 macOS
的原生界面,确保了流畅的使用体验。

> 注意: 放了方便展示其中一些动图有加速处理。如您遇到动图卡顿的情况,请在电脑上使用 Chrome, Firefox 或者 Edge 浏览器进行查看。
> 注意: 为了方便展示,其中一些动图有加速处理。如您遇到动图卡顿的情况,请在电脑上使用 Chrome, Firefox 或者 Edge 浏览器进行查看。

## 架构

Expand All @@ -93,9 +104,10 @@ SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https
- 文本模型: `Amazon Nova Pro`
- 图像模型: `Stable Diffusion 3.5 Large`

如果您要使用图片生成功能,请确保已开启 `Amazon Nova Lite`
模型的访问权限。您可以参考 [Amazon Bedrock 用户指南](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html)
来启用您的模型。
如果您要使用图片生成功能,请确保已开启 `Amazon Nova Lite` 模型的访问权限。您可以参考 [Amazon Bedrock 用户指南](https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html) 来启用您的模型。

<details>
<summary><b>🔧 配置步骤(点击展开)</b></summary>

### 第 1 步: 设置 API Key

Expand All @@ -122,26 +134,19 @@ SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https
2. 点击 **下一步**,在"指定堆栈详细信息"页面中提供以下信息:
- 使用存储 API Key 的参数名填写`ApiKeyParam`(例如"SwiftChatAPIKey")。
- 对于 App Runner,根据您的需求选择`InstanceTypeParam`。
3. 点击 **下一步**,保持 "配置堆栈选项" 页面默认设置,阅读功能并勾选底部的 "我确认,AWS CloudFormation 可能会创建 IAM 资源"
复选框。
3. 点击 **下一步**,保持 "配置堆栈选项" 页面默认设置,阅读功能并勾选底部的 "我确认,AWS CloudFormation 可能会创建 IAM 资源" 复选框。
4. 点击 **下一步**,在 "审核并创建" 中检查配置并点击 **提交**。

等待约 3-5 分钟部署完成,然后点击 CloudFormation 堆栈并转到 **输出** 选项卡,您可以找到 **API URL**
类似`https://xxx.xxx.awsapprunner.com` 或 `https://xxx.lambda-url.xxx.on.aws`。

### 第 3 步: 下载应用并设置 API URL 和 API Key

1. 下载应用
等待约 3-5 分钟部署完成,然后点击 CloudFormation 堆栈并转到 **输出** 选项卡,您可以找到 **API URL** 类似`https://xxx.xxx.awsapprunner.com` 或 `https://xxx.lambda-url.xxx.on.aws`。

- Android 应用点击 [下载](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.apk)
- macOS 应用点击 [下载](https://github.com/aws-samples/swift-chat/releases/download/1.10.0/SwiftChat.dmg)
- iOS (目前不提供 iOS 版本,您可以使用 Xcode 在本地构建)
### 第 3 步: 启动应用并设置 API URL 和 API Key

2. 启动应用,点击左侧菜单按钮,并点击底部的 **Settings**。
3. 粘贴`API URL`和`API Key`然后选择 Region。
4. 点击右上角 ✓ 图标保存配置并开始聊天。
1. 启动应用,点击左侧菜单按钮,并点击底部的 **Settings**。
2. 粘贴`API URL`和`API Key` (Parameter Store 中您填写的**值**) 然后选择 Region。
3. 点击右上角 ✓ 图标保存配置并开始聊天。

恭喜 🎉 您的 SwiftChat 应用已准备就绪!
</details>

### 支持的区域

Expand All @@ -159,7 +164,8 @@ SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https

## 入门指南 - 使用其他模型提供商

### 配置 Ollama
<details>
<summary><b>🔧 配置 Ollama(点击展开)</b></summary>

1. 进入 **设置页面**,选择 **Ollama** 标签。
2. 输入您的 Ollama 服务器 URL。例如:
Expand All @@ -168,15 +174,21 @@ SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https
```
3. 输入正确的服务器 URL 后,您可以从 **文本模型** 下拉列表中选择所需的 Ollama 模型。

### 配置 DeepSeek
</details>

<details>
<summary><b>🔧 配置 DeepSeek(点击展开)</b></summary>

1. 进入 **设置页面**,选择 **DeepSeek** 标签。
2. 输入您的 DeepSeek API 密钥。
3. 从 **文本模型** 下拉列表中选择 DeepSeek 模型。目前支持以下 DeepSeek 模型:
- `DeepSeek-V3`
- `DeepSeek-R1`

### 配置 OpenAI
</details>

<details>
<summary><b>🔧 配置 OpenAI(点击展开)</b></summary>

1. 进入 **设置页面**,选择 **OpenAI** 标签。
2. 输入您的 OpenAI API 密钥。
Expand All @@ -186,6 +198,8 @@ SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https

此外,如果您已部署 [ClickStream Server](#第-2-步-部署堆栈并获取-api-url),可以启用 **Use Proxy** 选项以转发您的请求。

</details>

## 详细功能

**快捷工具**:代码复制、选择模式、页面滚动和 Token 使用统计
Expand Down Expand Up @@ -252,7 +266,6 @@ SwiftChat 是一款快速响应的 AI 聊天应用,采用 [React Native](https

- 通过**图像压缩**加速端到端 API 请求
- 在与 Bedrock **相同区域**部署 API 以提供更低延迟
- 最小响应有效负载,**零解析**直接显示

📱 **快速渲染速度**

Expand Down
53 changes: 20 additions & 33 deletions react-native/package-lock.json

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

5 changes: 3 additions & 2 deletions react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"react-native-haptic-feedback": "^2.2.0",
"react-native-image-picker": "^7.2.3",
"react-native-image-viewing": "^0.2.2",
"react-native-marked": "^6.0.5",
"react-native-marked": "^6.0.7",
"react-native-math-view": "^3.9.5",
"react-native-mmkv": "^2.12.2",
"react-native-polyfill-globals": "^3.1.0",
Expand Down Expand Up @@ -67,7 +67,8 @@
"jest": "^29.6.3",
"prettier": "2.8.8",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
"typescript": "5.0.4",
"@types/marked": "5.0.0"
},
"overrides": {
"@react-native-clipboard/clipboard": {
Expand Down
Loading