@innovastudio/contentbox 1.5.87 → 1.5.88
Sign up to get free protection for your applications and to get access to all the features.
package/readme.txt
CHANGED
@@ -1,131 +1,144 @@
|
|
1
|
-
ContentBox.js 5.6.
|
1
|
+
ContentBox.js 5.6.2
|
2
2
|
|
3
|
-
|
3
|
+
Documentation:
|
4
4
|
|
5
5
|
https://demo.innovastudio.com/docs/ContentBox.pdf
|
6
6
|
|
7
|
+
https://demo.innovastudio.com/docs/AI-Assistant.pdf (AI Assistant documentation)
|
7
8
|
|
8
|
-
To try the example:
|
9
9
|
|
10
|
-
|
10
|
+
You can choose to run the HTML, PHP or JavaScript project examples:
|
11
11
|
|
12
|
-
|
12
|
+
A. To try the HTML example:
|
13
13
|
|
14
|
-
|
14
|
+
1. Unzip the project files:
|
15
15
|
|
16
|
-
|
16
|
+
- ContentBox/
|
17
17
|
|
18
|
+
2. Open terminal, go to the project directory and install the required server dependencies.
|
19
|
+
The example is using Node.js server.
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
1. Install the project dependencies:
|
21
|
+
> cd ContentBox
|
22
22
|
|
23
23
|
> npm install
|
24
24
|
|
25
|
-
|
26
|
-
|
25
|
+
Note: To run this command, you need to have NPM installed.
|
26
|
+
Download & install NPM from https://nodejs.org/en/download/.
|
27
|
+
|
28
|
+
3. Run the server:
|
29
|
+
|
30
|
+
> node server.js
|
31
|
+
|
32
|
+
3. Open from your browser:
|
33
|
+
|
34
|
+
http://localhost:8081/example.html
|
35
|
+
|
36
|
+
|
37
|
+
B. To try the PHP Example, open from your browser:
|
27
38
|
|
28
|
-
|
39
|
+
http://localhost/.../public/example.php
|
40
|
+
|
41
|
+
If you're using Visual Studio Code, you can use the PHP Server extension.
|
42
|
+
|
43
|
+
|
44
|
+
C. To try the JavaScript project, install the dependencies and start the project:
|
45
|
+
|
46
|
+
> npm install
|
29
47
|
|
30
48
|
> npm start
|
31
49
|
|
32
|
-
|
50
|
+
A browser window will be opened with the example running.
|
33
51
|
|
34
|
-
|
35
|
-
|
52
|
+
Note:
|
53
|
+
The code for this project is:
|
54
|
+
|
55
|
+
src/index.js
|
36
56
|
|
37
|
-
|
57
|
+
The project is using Node.js server:
|
58
|
+
|
59
|
+
server.js
|
38
60
|
|
39
|
-
- The AI Assistant is an optional feature that you can enable or disable.
|
40
|
-
Please refer to the AI Assistant documentation:
|
41
61
|
|
42
|
-
|
62
|
+
NOTE:
|
43
63
|
|
44
64
|
- To use the AI Assistant:
|
45
65
|
1. Obtain the OpenAI API key from https://openai.com.
|
46
66
|
2. Update the .env file with your API key.
|
47
67
|
|
48
|
-
|
49
|
-
|
50
|
-
$OPENAI_API_KEY = 'YOUR_API_KEY';
|
51
|
-
|
52
|
-
3. Initialization
|
68
|
+
OPENAI_API_KEY=YOUR_API_KEY
|
53
69
|
|
54
|
-
|
55
|
-
sendCommandUrl: '/sendcommand',
|
56
|
-
});
|
70
|
+
Alternatively, if you're using PHP, update the api/config.php file with your API key:
|
57
71
|
|
58
|
-
|
59
|
-
|
60
|
-
const builder = new ContentBox({
|
61
|
-
sendCommandUrl: '/sendcommand',
|
62
|
-
});
|
72
|
+
$OPENAI_API_KEY = 'YOUR_API_KEY';
|
63
73
|
|
64
74
|
- For speech recognition (if dictation is enabled), the browser's built-in
|
65
75
|
speech recognition is used. However, certain browsers may not support this feature.
|
66
76
|
We recommend using Deepgram for browser compatibility and accuracy.
|
67
|
-
Obtain the Deepgram API key from https://deepgram.com.
|
68
|
-
An example of using Deepgram is provided in the example project.
|
69
|
-
Obtain the Deepgram API key and update the .env file with your API key.
|
77
|
+
Obtain the Deepgram API key from https://deepgram.com and update the .env file with your API key.
|
70
78
|
Then enable the 'speechTranscribeUrl' parameter in the ContentBox initialization (src/index.js).
|
71
79
|
|
72
80
|
- To use the AI image generation:
|
73
81
|
1. Obtain the API key from https://getimg.ai/tools/api.
|
74
82
|
2. Update the .env file with your API key.
|
75
83
|
|
84
|
+
GETIMG_API_KEY=YOUR_API_KEY
|
85
|
+
|
76
86
|
Alternatively, if you're using PHP, update the 'api/config.php' file with your API key:
|
77
87
|
|
78
88
|
$GETIMG_API_KEY = 'YOUR_API_KEY';
|
79
89
|
|
80
|
-
|
90
|
+
- To try the examples using S3 Storage:
|
91
|
+
|
92
|
+
A. HTML example
|
93
|
+
|
94
|
+
1. Update the .env file with your S3 storage credentials.
|
95
|
+
|
96
|
+
AWS_KEY=YOUR_KEY
|
97
|
+
AWS_SECRET=YOUR_SECRET
|
98
|
+
AWS_BUCKET=BUCKET_NAME
|
99
|
+
AWS_URL=http://BUCKET_NAME.s3-website-us-east-1.amazonaws.com
|
100
|
+
AWS_REGION=us-east-1
|
101
|
+
|
102
|
+
2. Install the server dependencies:
|
103
|
+
|
104
|
+
> npm install
|
105
|
+
|
106
|
+
3. Run the server:
|
81
107
|
|
82
|
-
|
83
|
-
textToImageUrl: '/texttoimage',
|
84
|
-
upscaleImageUrl: '/upscaleimage',
|
85
|
-
imageAutoUpscale: true,
|
86
|
-
});
|
87
|
-
|
88
|
-
If you're using PHP:
|
108
|
+
> node server-aws.js
|
89
109
|
|
90
|
-
|
91
|
-
textToImageUrl: 'api/texttoimage.php',
|
92
|
-
upscaleImageUrl: 'api/upscaleimage.php',
|
93
|
-
imageAutoUpscale: true,
|
94
|
-
});
|
110
|
+
4. Open from your browser:
|
95
111
|
|
96
|
-
-
|
112
|
+
http://localhost:8081/example-s3.html
|
97
113
|
|
98
|
-
|
114
|
+
B. PHP example
|
99
115
|
|
116
|
+
1. Update the public/api/config.php with your S3 storage credentials.
|
100
117
|
|
101
|
-
|
102
|
-
|
118
|
+
$AWS_KEY = 'YOUR_KEY';
|
119
|
+
$AWS_SECRET = 'YOUR_SECRET';
|
120
|
+
$AWS_BUCKET = 'BUCKET_NAME';
|
121
|
+
$AWS_URL = 'http://BUCKET_NAME.s3-website-us-east-1.amazonaws.com';
|
122
|
+
$AWS_REGION = 'us-east-1';
|
103
123
|
|
104
|
-
|
124
|
+
2. Download the AWS SDK for PHP phar file (aws.phar) from https://github.com/aws/aws-sdk-php/releases
|
125
|
+
and copy it to your project's public/api/ directory.
|
105
126
|
|
106
|
-
|
107
|
-
When you run the project, you can try modifying the source code, and
|
108
|
-
the changes will be applied, and the browser will refresh automatically.
|
127
|
+
3. Open from your browser:
|
109
128
|
|
110
|
-
-
|
129
|
+
http://localhost/.../public/example-s3.php
|
111
130
|
|
112
|
-
{
|
113
|
-
"name": "@innovastudio/contentbox",
|
114
|
-
"type": "module",
|
115
131
|
|
116
|
-
|
132
|
+
- IMPORTANT:
|
117
133
|
|
118
|
-
|
134
|
+
Please add your own security to the API endpoints (public/api/)!
|
119
135
|
|
120
|
-
> npm run build
|
121
136
|
|
122
|
-
|
123
|
-
You can test it by opening: 'public/example.html'.
|
124
|
-
If you're using Visual Studio Code, right-click on the 'example.html' file and select "Open with Live Server".
|
137
|
+
- If you have Source Code package (Super license), please refer to:
|
125
138
|
|
126
|
-
-
|
139
|
+
readme-sourcecode.txt
|
127
140
|
|
128
|
-
|
141
|
+
for additional information.
|
129
142
|
|
130
143
|
|
131
144
|
_____________________________________________
|