@applica-software-guru/persona-sdk 0.1.40 → 0.1.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -5
- package/bitbucket-pipelines.yml +0 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Persona SDK is the official SDK for the Persona API. It provides a simple and ef
|
|
|
36
36
|
To get started, install the Persona SDK using npm or yarn:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
npm install @applica-guru/persona-sdk
|
|
39
|
+
npm install @applica-software-guru/persona-sdk
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
If you don't already have an assistant-ui-based project, you can create one using the [Assistant UI Getting Started Guide](https://www.assistant-ui.com/docs/getting-started).
|
|
@@ -48,7 +48,13 @@ If you don't already have an assistant-ui-based project, you can create one usin
|
|
|
48
48
|
Here’s an example of how to use the Persona SDK in your chat application:
|
|
49
49
|
|
|
50
50
|
```typescript
|
|
51
|
-
import
|
|
51
|
+
import dynamic from 'next/dynamic';
|
|
52
|
+
|
|
53
|
+
const PersonaRuntimeProvider = dynamic(() => import('@applica-software-guru/persona-sdk').then((mod) => mod.PersonaRuntimeProvider), {
|
|
54
|
+
ssr: false,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const logger = new PersonaConsoleLogger();
|
|
52
58
|
|
|
53
59
|
function Chat() {
|
|
54
60
|
return (
|
|
@@ -72,6 +78,8 @@ function Chat() {
|
|
|
72
78
|
}
|
|
73
79
|
```
|
|
74
80
|
|
|
81
|
+
**Note**: When using WebRTC, it is recommended to import `PersonaRuntimeProvider` dynamically with `ssr: false` (as shown above) to ensure compatibility with server-side rendering frameworks like Next.js.
|
|
82
|
+
|
|
75
83
|
### Development Mode
|
|
76
84
|
|
|
77
85
|
Use the `dev` prop to enable development mode. This redirects all traffic to a local installation of Persona (e.g., `localhost:8000`).
|
|
@@ -142,7 +150,7 @@ The Persona SDK allows you to extend its functionality by creating custom protoc
|
|
|
142
150
|
You can implement your own protocol by extending the `PersonaProtocolBase` class. For example:
|
|
143
151
|
|
|
144
152
|
```typescript
|
|
145
|
-
import { PersonaProtocolBase } from '@applica-guru/persona-sdk';
|
|
153
|
+
import { PersonaProtocolBase } from '@applica-software-guru/persona-sdk';
|
|
146
154
|
|
|
147
155
|
class CustomProtocol extends PersonaProtocolBase {
|
|
148
156
|
// Implement required methods like connect, disconnect, send, etc.
|
|
@@ -154,7 +162,7 @@ class CustomProtocol extends PersonaProtocolBase {
|
|
|
154
162
|
Here’s an example of a custom protocol named `CustomProtocol`:
|
|
155
163
|
|
|
156
164
|
```typescript
|
|
157
|
-
import { PersonaProtocolBase } from '@applica-guru/persona-sdk';
|
|
165
|
+
import { PersonaProtocolBase } from '@applica-software-guru/persona-sdk';
|
|
158
166
|
|
|
159
167
|
class CustomProtocol extends PersonaProtocolBase {
|
|
160
168
|
public getName(): string {
|
|
@@ -183,7 +191,7 @@ class CustomProtocol extends PersonaProtocolBase {
|
|
|
183
191
|
You can create a custom logger by implementing the `PersonaLogger` interface:
|
|
184
192
|
|
|
185
193
|
```typescript
|
|
186
|
-
import { PersonaLogger } from '@applica-guru/persona-sdk';
|
|
194
|
+
import { PersonaLogger } from '@applica-software-guru/persona-sdk';
|
|
187
195
|
|
|
188
196
|
class CustomLogger implements PersonaLogger {
|
|
189
197
|
log(message: string, ...args: unknown[]): void {
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -15,15 +15,5 @@ pipelines:
|
|
|
15
15
|
variables:
|
|
16
16
|
NPM_TOKEN: $NPM_TOKEN
|
|
17
17
|
EXTRA_ARGS: '--access public'
|
|
18
|
-
- echo $SERVICE_ACCOUNT > key.json
|
|
19
|
-
- curl -sSL https://sdk.cloud.google.com | bash > /dev/null
|
|
20
|
-
- export PATH=$PATH:/root/google-cloud-sdk/bin
|
|
21
|
-
- gcloud auth activate-service-account --key-file=key.json
|
|
22
|
-
- rm key.json
|
|
23
|
-
- gcloud config set project persona-ai-1
|
|
24
|
-
- gsutil rm -r gs://persona-cdn/sdk/latest/*
|
|
25
|
-
- gsutil cp -r dist/* gs://persona-cdn/sdk/$VERSION.$BITBUCKET_BUILD_NUMBER
|
|
26
|
-
- gsutil cp -r dist/* gs://persona-cdn/sdk/latest
|
|
27
|
-
- gsutil cp -r dist/* gs://persona-cdn/sdk/$VERSION.$BITBUCKET_BUILD_NUMBER
|
|
28
18
|
- git tag -a "$VERSION.$BITBUCKET_BUILD_NUMBER" -m "Version $VERSION.$BITBUCKET_BUILD_NUMBER"
|
|
29
19
|
- git push origin "$VERSION.$BITBUCKET_BUILD_NUMBER"
|