Skip to content

Commit fd0f1ee

Browse files
authored
fix: include missing native bindings (#14)
1 parent 9944266 commit fd0f1ee

File tree

3 files changed

+39
-35
lines changed

3 files changed

+39
-35
lines changed

.changeset/bold-roses-beg.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@stream-io/chat-react-native-ai': patch
3+
---
4+
5+
Include missing codegen files and update README.md

packages/react-native-sdk/README.md

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This official repository for Stream Chat's UI components is designed specifically for AI-first applications written in Swift UI. When paired with our real-time [Chat API](https://getstream.io/chat/), it makes integrating with and rendering responses from LLM providers such as ChatGPT, Gemini, Anthropic or any custom backend easier by providing rich with out-of-the-box components able to render Markdown, Code blocks, tables, thinking indicators, images, etc.
44

55
To start, this library includes the following components which assist with this task:
6+
67
- `StreamingMessageView` - a component that is able to render text, markdown and code in real-time, using a typewriter, character-by-character animation, similar to ChatGPT
78
- `ComposerView` - a fully featured prompt composer with attachments and speech input
89
- `SpeechToTextButton` - a reusable button that records voice input and streams the recognized transcript back into your UI
@@ -12,12 +13,12 @@ Our team plans to keep iterating and adding more components over time. If there'
1213

1314
## 🛠️ Installation
1415

15-
The `@stream-io/ai-components-react-native` SDK is available on NPM.
16+
The `@stream-io/chat-react-native-ai` SDK is available on NPM.
1617

1718
To install it and its peer dependencies, you may run the following command:
1819

1920
```bash
20-
yarn add @stream-io/ai-components-react-native react-native-reanimated react-native-worklets react-native-gesture-handler react-native-svg victory-native @shopify/react-native-skia @babel/plugin-proposal-export-namespace-from
21+
yarn add @stream-io/chat-react-native-ai react-native-reanimated react-native-worklets react-native-gesture-handler react-native-svg victory-native @shopify/react-native-skia @babel/plugin-proposal-export-namespace-from
2122
```
2223

2324
After this finishes, you'll need to add the respective `babel` plugins to your `babel.config.js` file, like so:
@@ -69,9 +70,9 @@ The SDK has built-in support for 2 libraries that allow you to achieve this:
6970

7071
#### `react-native-image-picker`
7172

72-
This RN CLI library is meant to be used in vanilla React Native projects.
73+
This RN CLI library is meant to be used in vanilla React Native projects.
7374

74-
To install it, you can run:
75+
To install it, you can run:
7576

7677
```bash
7778
yarn add react-native-image-picker
@@ -128,7 +129,7 @@ The `StreamingMessageView` is a component that can render markdown content effic
128129
Under the hood, it implements a letter-by-letter typewriter animation with a character queue, similar to ChatGPT.
129130

130131
| Name | Type | Required | Description |
131-
|------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
132+
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
132133
| `text` | `string` | yes | The text we want to pass as markdown. |
133134
| `paragraphTextNumberOfLines` | `boolean` | no | A boolean signifying if `numberOfLines` should be applied as a property to markdown `Paragraph` and `Text` components. Particularly useful if we want to display the same message, but in a "cut" fashion (for example when replying to someone). |
134135
| `rules` | [`MarkdownRules`](https://github.com/GetStream/ai-components-js/blob/11314d5b7e888ed4585e6c4790eb173e928be6b3/packages/react-native-sdk/src/markdown/types.ts#L24) | no | An object of `MarkdownRules` that is then going to be deeply merged with our default rules, based on the [`SimpleMarkdown` parsing engine](https://github.com/Khan/perseus/tree/main/packages/simple-markdown#adding-a-simple-extension). Can be used to add custom rules or change existing rules. You can disable a rule by passing `{ [ruleName]: { match: () => null }}`. |
@@ -140,7 +141,7 @@ Under the hood, it implements a letter-by-letter typewriter animation with a cha
140141

141142
Provided below is an example of how to use the component.
142143

143-
```tsx
144+
````tsx
144145
const markdownText = ```
145146
# Heading
146147
@@ -149,20 +150,20 @@ some text
149150
## Another heading
150151
```;
151152

152-
<StreamingMessageView
153+
<StreamingMessageView
153154
text={markdownText}
154155
letterInterval={5} // every 5ms
155156
renderingLetterCount={3} // render 3 letters at a time
156-
/>
157-
```
157+
/>;
158+
````
159+
158160
### `AITypingIndicatorView`
159161

160162
The `AITypingIndicatorView` is used to represent different states of the LLM, such as `Thinking`, `Checking External Sources` and so on, depending on the states you've defined on your backend. The only thing that needs to be passed to the component is the `text` property, which will then be displayed with a shimmering animation.
161163

162-
163-
| Name | Type | Required | Description |
164-
|---------|----------|----------|------------------------------------------------------|
165-
| `text` | `string` | yes | The text we want to be displayed inside of the view. |
164+
| Name | Type | Required | Description |
165+
| ------ | -------- | -------- | ---------------------------------------------------- |
166+
| `text` | `string` | yes | The text we want to be displayed inside of the view. |
166167

167168
#### Example
168169

@@ -174,9 +175,8 @@ The `AITypingIndicatorView` is used to represent different states of the LLM, su
174175

175176
The `ComposerView` gives users a modern text entry surface with attachment previews, actionable bottom sheet, speech-to-text button and an integrated send button.
176177

177-
178178
| Name | Type | Required | Description |
179-
|----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
179+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
180180
| `onSendMessage` | `(opts: { text: string; attachments?: MediaPickerState['assets']; custom?: Record<string, unknown>; }) => Promise<void>` | yes | A callback that will be invoked whenever the send button is pressed. The `text`, `attachments` and any `custom` data we've added to the state will be passed to it. |
181181
| `bottomSheetOptions` | [`BottomSheetOption[]`](https://github.com/GetStream/ai-components-js/blob/11314d5b7e888ed4585e6c4790eb173e928be6b3/packages/react-native-sdk/src/message-composer/MessageComposer.tsx#L19) | no | An array of [`BottomSheetOption`](https://github.com/GetStream/ai-components-js/blob/11314d5b7e888ed4585e6c4790eb173e928be6b3/packages/react-native-sdk/src/message-composer/MessageComposer.tsx#L19) objects that will render the extra options in the bottom sheet. |
182182
| `bottomSheetInsets` | `{ top: number; bottom: number; left: number; right: number }` | no | An object containing extra insets we can pass to the `ComposerView` in order to make sure the bottom sheet can extend properly beyond them. |
@@ -202,16 +202,16 @@ const options = [
202202
subtitle: 'Think longer for better answers',
203203
action: () => Alert.alert('Pressed on Thinking !'),
204204
Icon: Flag,
205-
}
206-
]
205+
},
206+
];
207207

208208
const insets = useSafeAreaInsets();
209209

210210
<ComposerView
211211
onSendMessage={sendMessage}
212212
bottomSheetOptions={bottomSheetOptions}
213213
bottomSheetInsets={insets}
214-
/>
214+
/>;
215215
```
216216

217217
### `SpeechToTextButton`
@@ -222,12 +222,11 @@ It uses the `useDictation` hook under the hood, which can also be used without t
222222

223223
It takes a single property named `options` that has the following keys:
224224

225-
| Name | Type | Required | Description |
226-
|-----------------------|------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
227-
| `language` | `string` | no | The language we want to transcribe from. It will default to `en-US`. |
228-
| `intermediateResults` | `boolean` | no | A boolean signifying whether we want to receive the intermediate results from the transcription or just the final result when the transcription is deemed done. Defaults to `true` |
229-
| `silenceTimeoutMs` | `number` | no | A number signifying the number of milliseconds of silence until transcription is deemed finished. Defaults to `2500`. |
230-
225+
| Name | Type | Required | Description |
226+
| --------------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
227+
| `language` | `string` | no | The language we want to transcribe from. It will default to `en-US`. |
228+
| `intermediateResults` | `boolean` | no | A boolean signifying whether we want to receive the intermediate results from the transcription or just the final result when the transcription is deemed done. Defaults to `true` |
229+
| `silenceTimeoutMs` | `number` | no | A number signifying the number of milliseconds of silence until transcription is deemed finished. Defaults to `2500`. |
231230

232231
```tsx
233232
const options = {
@@ -251,8 +250,8 @@ In order to modify the theme, you may refer to our full fledged theme object [as
251250
In the example below, we introduce a dark color scheme through the theming system.
252251

253252
```tsx
254-
const customTheme = {
255-
colors: colorScheme === 'dark'
253+
const customTheme = {
254+
colors: colorScheme === 'dark'
256255
? {
257256
accent_blue: '#4C9DFF',
258257
accent_red: '#FF636E',
@@ -289,14 +288,14 @@ Stream provides UI components and state handling that make it easy to build real
289288
## 📕 Tutorials
290289

291290
To learn more about integrating AI and chatbots into your application, we recommend checking out the full list of tutorials across all of our supported frontend SDKs and providers. Stream's Chat SDK is natively supported across:
292-
* [React](https://getstream.io/chat/react-chat/tutorial/)
293-
* [React Native](https://getstream.io/chat/react-native-chat/tutorial/)
294-
* [Angular](https://getstream.io/chat/angular/tutorial/)
295-
* [Jetpack Compose](https://getstream.io/tutorials/android-chat/)
296-
* [SwiftUI](https://getstream.io/tutorials/ios-chat/)
297-
* [Flutter](https://getstream.io/chat/flutter/tutorial/)
298-
* [Javascript/Bring your own](https://getstream.io/chat/docs/javascript/)
299291

292+
- [React](https://getstream.io/chat/react-chat/tutorial/)
293+
- [React Native](https://getstream.io/chat/react-native-chat/tutorial/)
294+
- [Angular](https://getstream.io/chat/angular/tutorial/)
295+
- [Jetpack Compose](https://getstream.io/tutorials/android-chat/)
296+
- [SwiftUI](https://getstream.io/tutorials/ios-chat/)
297+
- [Flutter](https://getstream.io/chat/flutter/tutorial/)
298+
- [Javascript/Bring your own](https://getstream.io/chat/docs/javascript/)
300299

301300
## 👩‍💻 Free for Makers 👨‍💻
302301

@@ -309,7 +308,6 @@ We've closed a [\$38 million Series B funding round](https://techcrunch.com/2021
309308
Our APIs are used by more than a billion end-users, and you'll have a chance to make a huge impact on the product within a team of the strongest engineers all over the world.
310309
Check out our current openings and apply via [Stream's website](https://getstream.io/team/#jobs).
311310

312-
313311
## License
314312

315313
```

packages/react-native-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"android",
2222
"ios",
2323
"cpp",
24-
"*.podspec",
24+
"AIComponentsReactNative.podspec",
25+
"react-native.config.js",
2526
"!ios/build",
2627
"!android/build",
2728
"!android/gradle",

0 commit comments

Comments
 (0)