@@ -12,6 +12,7 @@ macOS platforms.
12
12
** Key Features:**
13
13
14
14
- Real-time streaming chat with AI
15
+ - Rich Markdown Support: Tables, Code Blocks, LaTeX and More
15
16
- AI image generation with progress
16
17
- Multimodal support (images, videos & documents)
17
18
- Conversation history list view and management
@@ -28,6 +29,14 @@ macOS platforms.
28
29
- Upload large videos (1080p/4K) beyond 8MB with auto compression
29
30
- Support using natural language to make Nova Canvas generate images, remove backgrounds, replace backgrounds, and
30
31
create images in similar styles.
32
+ - Support LaTeX formula rendering for Amazon Nova.
33
+
34
+ The image below demonstrates SwiftChat rich markdown content support. We redesigned the UI with optimized font sizes and
35
+ line spacing for a more elegant and clean presentation.
36
+
37
+ ![ ] ( assets/markdown.png )
38
+
39
+ All of these features are seamlessly displayed across all supported platforms with native UI.
31
40
32
41
## Architecture
33
42
@@ -47,11 +56,12 @@ this [example](https://github.com/awslabs/aws-lambda-web-adapter/tree/main/examp
47
56
48
57
Ensure you have access to Amazon Bedrock foundation models. SwiftChat default settings are:
49
58
50
- * Region: ` us-west-2 `
51
- * Text Model: ` Claude 3.5 Sonnet `
52
- * Image Model: ` Stable Image Core 1.0 `
59
+ - Region: ` us-west-2 `
60
+ - Text Model: ` Amazon Nova Pro `
61
+ - Image Model: ` Stable Image Core 1.0 `
53
62
54
- Follow the [ Amazon Bedrock User Guide] ( https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html ) to
63
+ If you are using the image generation feature, please make sure you have enabled access to the ` Amazon Nova Lite ` model.
64
+ Please follow the [ Amazon Bedrock User Guide] ( https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html ) to
55
65
enable your models.
56
66
57
67
### Step 1: Set up your API Key
@@ -61,29 +71,30 @@ enable your models.
61
71
2 . Check whether you are in the [ supported region] ( #supported-region ) , then click on the ** Create parameter** button.
62
72
3 . Fill in the parameters below, leaving other options as default:
63
73
64
- * ** Name** : Enter a parameter name (e.g., "SwiftChatAPIKey", will be used as ` ApiKeyParam ` in Step 2).
74
+ - ** Name** : Enter a parameter name (e.g., "SwiftChatAPIKey", will be used as ` ApiKeyParam ` in Step 2).
65
75
66
- * ** Type** : Select ` SecureString `
76
+ - ** Type** : Select ` SecureString `
67
77
68
- * ** Value** : Enter any string without spaces.(this will be your ` API Key ` in Step 3)
78
+ - ** Value** : Enter any string without spaces.(this will be your ` API Key ` in Step 3)
69
79
70
80
4 . Click ** Create parameter** .
71
81
72
82
### Step 2: Deploy stack and get your API URL
73
83
74
84
1 . Click one of the following buttons to launch the CloudFormation Stack in the same region where your API Key was
75
85
created.
76
- - ** App Runner**
77
86
78
- [ ![ Launch Stack] ( assets/launch-stack.png )] ( https://console.aws.amazon.com/cloudformation/home#/stacks/create/template?stackName=SwiftChatAPI&templateURL=https://aws-gcr-solutions.s3.amazonaws.com/swift-chat/latest/SwiftChatAppRunner.template )
87
+ - ** App Runner**
88
+
89
+ [ ![ Launch Stack] ( assets/launch-stack.png )] ( https://console.aws.amazon.com/cloudformation/home#/stacks/create/template?stackName=SwiftChatAPI&templateURL=https://aws-gcr-solutions.s3.amazonaws.com/swift-chat/latest/SwiftChatAppRunner.template )
79
90
80
- - ** Lambda** (Note: For AWS customer use only)
91
+ - ** Lambda** (Note: For AWS customer use only)
81
92
82
- [ ![ Launch Stack] ( assets/launch-stack.png )] ( https://console.aws.amazon.com/cloudformation/home#/stacks/create/template?stackName=SwiftChatLambda&templateURL=https://aws-gcr-solutions.s3.amazonaws.com/swift-chat/latest/SwiftChatLambda.template )
93
+ [ ![ Launch Stack] ( assets/launch-stack.png )] ( https://console.aws.amazon.com/cloudformation/home#/stacks/create/template?stackName=SwiftChatLambda&templateURL=https://aws-gcr-solutions.s3.amazonaws.com/swift-chat/latest/SwiftChatLambda.template )
83
94
84
95
2 . Click ** Next** , On the "Specify stack details" page, provide the following information:
85
- - Fill the ` ApiKeyParam ` with the parameter name you used for storing the API key (e.g., "SwiftChatAPIKey").
86
- - For App Runner, choose an ` InstanceTypeParam ` based on your needs.
96
+ - Fill the ` ApiKeyParam ` with the parameter name you used for storing the API key (e.g., "SwiftChatAPIKey").
97
+ - For App Runner, choose an ` InstanceTypeParam ` based on your needs.
87
98
3 . Click ** Next** , Keep the "Configure stack options" page as default, Read the Capabilities and Check the "I
88
99
acknowledge that AWS CloudFormation might create IAM resources" checkbox at the bottom.
89
100
4 . Click ** Next** , In the "Review and create" Review your configuration and click ** Submit** .
@@ -94,9 +105,10 @@ can find the **API URL** which looks like: `https://xxx.xxx.awsapprunner.com` or
94
105
### Step 3: Download the app and setup with API URL and API Key
95
106
96
107
1 . Download the App
97
- - Android App click to [ Download] ( https://github.com/aws-samples/swift-chat/releases/download/1.7.0/SwiftChat.apk )
98
- - macOS App click to [ Download] ( https://github.com/aws-samples/swift-chat/releases/download/1.7.0/SwiftChat.dmg )
99
- - iOS (Currently we do not provide the iOS version, you can build it locally with Xcode)
108
+
109
+ - Android App click to [ Download] ( https://github.com/aws-samples/swift-chat/releases/download/1.7.0/SwiftChat.apk )
110
+ - macOS App click to [ Download] ( https://github.com/aws-samples/swift-chat/releases/download/1.7.0/SwiftChat.dmg )
111
+ - iOS (Currently we do not provide the iOS version, you can build it locally with Xcode)
100
112
101
113
2 . Launch the App, open the drawer menu, and tap ** Settings** .
102
114
3 . Paste the ` API URL ` and ` API Key ` then select the Region.
@@ -120,27 +132,30 @@ Congratulations 🎉 Your SwiftChat App is ready to use!
120
132
121
133
## Detailed Features
122
134
135
+ We feature streamlined chat History, Settings pages, and intuitive Usage statistics:
136
+
137
+ ![ ] ( assets/history_settings.png )
138
+
123
139
### Message Handling
124
140
125
141
- [x] Text copy support:
126
- * Copy button in message header
127
- * Copy button in code blocks
128
- * Direct Select and copy code on macOS (double click or long click on iOS)
129
- * Long press text to copy entire sentence (Right-click on macOS)
142
+ - Copy button in message header
143
+ - Copy button in code blocks
144
+ - Direct Select and copy code on macOS (double click or long click on iOS)
145
+ - Long press text to copy entire sentence (Right-click on macOS)
130
146
- [x] Text selection mode by tapping message title or double-clicking text
131
147
- [x] Message timeline view in history
132
148
- [x] Delete messages through long press in history
133
149
- [x] Click to preview for uploaded documents and images
134
150
- [x] Support Markdown format for both questions and answers
135
- - [x] Support table display and code syntax highlighting
136
151
- [x] Maximum 20 images and 5 documents per conversation
137
152
138
153
### Image Features
139
154
140
- - [x] Support image generation with Chinese prompts(Make sure ` Claude 3 Haiku ` is enabled in your selected region)
155
+ - [x] Support image generation with Chinese prompts(Make sure ` Amazon Nova Lite ` is enabled in your selected region)
141
156
- [x] View and zoom generated images
142
157
- [x] Long press images to save or share
143
- - [x] Automatic image compression to optimize token usage
158
+ - [x] Automatic image compression to improve response speed
144
159
145
160
### User Experience
146
161
@@ -152,6 +167,12 @@ Congratulations 🎉 Your SwiftChat App is ready to use!
152
167
- [x] Check detailed token usage and image generation count in Settings
153
168
- [x] In-app upgrade notifications (Android & macOS)
154
169
170
+ We have optimized the layout for landscape mode. As shown below, you can comfortably view table and code contents in
171
+ landscape orientation.
172
+
173
+ ![ ] ( assets/landscape.png )
174
+ ![ ] ( assets/landscape_code.png )
175
+
155
176
## What Makes SwiftChat Really "Swift"?
156
177
157
178
🚀 ** Fast Launch Speed**
@@ -193,7 +214,7 @@ following command to download dependencies.
193
214
194
215
``` bash
195
216
cd react-native && npm i
196
- ```
217
+ ```
197
218
198
219
### Build for Android
199
220
@@ -215,83 +236,7 @@ npm start && npm run ios
215
236
216
237
## API Reference
217
238
218
- ### API Schema
219
-
220
- First, please configure you ` API URL ` and ` API Key ` like:
221
-
222
- ``` bash
223
- export API_URL=< API URL>
224
- export API_KEY=< API Key>
225
- ```
226
-
227
- 1 . ` /api/converse `
228
- ``` bash
229
- curl -N " ${API_URL} /api/converse" \
230
- --header ' Content-Type: application/json' \
231
- --header " Authorization: Bearer ${API_KEY} " \
232
- --data ' {
233
- "messages": [
234
- {
235
- "role": "user",
236
- "content": [
237
- {
238
- "text": "Hi"
239
- }
240
- ]
241
- }
242
- ],
243
- "modelId": "anthropic.claude-3-5-sonnet-20240620-v1:0",
244
- "region": "us-west-2"
245
- }'
246
- ```
247
- This API is used to implement streaming conversations, and it only returns the text and token usage for display.
248
-
249
- The ` messages ` under body fully complies with the messages structure specification in Amazon
250
- Bedrock [ converse stream] ( https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/bedrock-runtime/client/converse_stream.html )
251
- API. You can also add ` image ` or ` document ` according to the specification to support multimodal conversations.
252
-
253
- 2 . ` /api/image `
254
- ``` bash
255
- curl " ${API_URL} /api/image" \
256
- --header ' Content-Type: application/json' \
257
- --header " Authorization: Bearer ${API_KEY} " \
258
- --data ' {
259
- "prompt": "Beautiful countryside",
260
- "modelId": "stability.stable-image-core-v1:0",
261
- "region": "us-west-2",
262
- "width": "1024",
263
- "height": "1024"
264
- }'
265
- ```
266
- This API is used to generate images and returns a base64 encoded string of the image.
267
-
268
- 3 . ` /api/models `
269
- ``` bash
270
- curl " ${API_URL} /api/models" \
271
- --header ' Content-Type: application/json' \
272
- --header ' accept: application/json' \
273
- --header " Authorization: Bearer ${API_KEY} " \
274
- --data ' {
275
- "region": "us-west-2"
276
- }'
277
- ```
278
- This API is used to get a list of all streaming-supported text models and image generation models in the specified
279
- region.
280
-
281
- 4 . ` /api/upgrade `
282
- ``` bash
283
- curl " ${API_URL} /api/upgrade" \
284
- --header ' Content-Type: application/json' \
285
- --header ' accept: application/json' \
286
- --header " Authorization: Bearer ${API_KEY} "
287
- ```
288
- This API is used to get the new version of SwiftChat for Android and macOS App updates.
289
-
290
- ### API Code Reference
291
-
292
- - Client code: [ bedrock-api.ts] ( /react-native/src/api/bedrock-api.ts )
293
-
294
- - Server code: [ main.py] ( server/src/main.py )
239
+ Please refer [ API Reference] ( server/README.md )
295
240
296
241
## How to upgrade?
297
242
@@ -319,4 +264,3 @@ See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more inform
319
264
## License
320
265
321
266
This library is licensed under the MIT-0 License. See the [ LICENSE] ( LICENSE ) file.
322
-
0 commit comments