llmasaservice-ui 0.1.7 → 0.1.9

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.
@@ -0,0 +1,37 @@
1
+ # .github/workflows/deploy-github-pages.yaml
2
+
3
+ # Workflow name
4
+ name: Build and Publish Storybook to GitHub Pages
5
+
6
+ on:
7
+ # Event for the workflow to run on
8
+ push:
9
+ branches:
10
+ - 'main' # Replace with the branch you want to deploy from
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write
15
+ id-token: write
16
+
17
+ # List of jobs
18
+ jobs:
19
+ deploy:
20
+ runs-on: ubuntu-latest
21
+ # Job steps
22
+ steps:
23
+ # Manual Checkout
24
+ - uses: actions/checkout@v4
25
+
26
+ # Set up Node
27
+ - uses: actions/setup-node@v4
28
+ with:
29
+ node-version: '18.x'
30
+
31
+ #👇 Add Storybook build and deploy to GitHub Pages as a step in the workflow
32
+ - uses: bitovi/github-actions-storybook-to-github-pages@v1.0.3
33
+ with:
34
+ install_command: yarn install # default: npm ci
35
+ build_command: yarn build-storybook # default: npm run build-storybook
36
+ path: storybook-static # default: dist/storybook
37
+ checkout: false # default: true
package/README.md CHANGED
@@ -1,2 +1,154 @@
1
1
  # Prebuilt UI chat panel for LLM as a Service
2
2
 
3
+ LLMAsAService.io is a platform to accelerate and securely develop LLM features in your applications and websites.
4
+
5
+ This library offers a pre-built panel for incorporating chat GPT style features in react/nextjs applications.
6
+
7
+ Features
8
+ - Multi-turn style chat interface
9
+ - Open with an initial prompt (for example, after a click on a Summarize button in your application, set the initialPrompt to "Summarize the following text ..." and the panel will automatically show the summary)
10
+ - Light and dark theme
11
+ - Abort functionality
12
+ - Markdown response display
13
+ - Sizable vertically and horizontally to suit your app. use 100vh or 100vw for the height and width to full size the panel in that orientation.
14
+
15
+
16
+ What is LLM as a Service: https://llmasaservice.io
17
+
18
+ Register for a LLM as a Service account and get your unique project id from the integration page https://app.llmasaservice.io/integration
19
+
20
+ Dark mode example:
21
+
22
+ ![Dark Mode](images/darkmode.png)
23
+
24
+ Light mode example:
25
+
26
+ ![Light Mode](images/lightmode.png)
27
+
28
+ System instructios example:
29
+
30
+ ![Brand and personality](images/personalityandbrand.png)
31
+
32
+ see documentation more examples: https://predictabilityatscale.github.io/llmasaservice-ui/?path=/docs/chatpanel--docs
33
+
34
+ ## Installation
35
+
36
+ To install the library, use npm or yarn:
37
+
38
+ ```bash
39
+ # Using npm
40
+ npm install llmasaservice-ui
41
+
42
+ # Using yarn
43
+ yarn add llmasaservice-ui
44
+ ```
45
+
46
+ ## Usage
47
+
48
+ In a React application
49
+
50
+ 1. Import the ChatPanel component
51
+
52
+ ```typescript
53
+ import React from 'react';
54
+ import ChatPanel from 'llmasaservice-ui';
55
+ import "../../node_modules/llmasaservice-ui/dist/index.css"; // default styles for light and dark, or replace with your own
56
+
57
+ const App = () => {
58
+ return (
59
+ <div>
60
+ <h1>My Chat Application</h1>
61
+ <ChatPanel
62
+ project_id="[[get this from the LLMAsAService control panel]]"
63
+ initialPrompt="Give a nice welcome message"
64
+ />
65
+ </div>
66
+ );
67
+ };
68
+
69
+ export default App;
70
+ ```
71
+ 2. Run your application
72
+
73
+ ```bash
74
+ npm start
75
+ ```
76
+
77
+ In a Next.js application
78
+
79
+ 1. Create a new page in pages/chat.js and add the following code
80
+
81
+ ```javascript
82
+ import React from 'react';
83
+ import ChatPanel from 'llmasaservice-ui';
84
+ import "../../node_modules/llmasaservice-ui/dist/index.css"; // default styles for light and dark, or replace with your own
85
+
86
+ const ChatPage = () => {
87
+ return (
88
+ <div>
89
+ <h1>Chat Page</h1>
90
+ <ChatPanel
91
+ project_id="[[your project_id from the llmasaservice control panel]]"
92
+ title="Chat with us"
93
+ initialPrompt="Write a short three sentence background on the city called: Seattle"
94
+ />
95
+ </div>
96
+ );
97
+ };
98
+
99
+ export default ChatPage;
100
+ ```
101
+
102
+
103
+ 2. Run Your Next.js Application:
104
+
105
+ ```bash
106
+ npm run dev
107
+ ```
108
+
109
+ ## Tailwind CSS support
110
+
111
+ If you use tailwind for CSS styling do these additional steps for proper markdown formatting -
112
+
113
+ a) install the Typography:
114
+
115
+ ```bash
116
+ npm install -D @tailwindcss/typography
117
+ ```
118
+
119
+ b) add the plugin to your tailwind.config.js file:
120
+
121
+ ```javascript
122
+ module.exports = {
123
+ theme: {
124
+ // ...
125
+ },
126
+ plugins: [
127
+ require('@tailwindcss/typography'),
128
+ // ...
129
+ ],
130
+ }
131
+ ```
132
+
133
+ c) use prose as the class for the markdownStyle. This example is for dark mode
134
+
135
+ ```javascript
136
+ <ChatPanel
137
+ project_id="[[your project_id from the llmasaservice control panel]]"
138
+ title="Chat with us"
139
+ initialPrompt="Write a short three sentence background on the city called: Seattle"
140
+ theme="dark"
141
+ markdownClass="prose prose-sm !max-w-none dark:prose-invert"
142
+ />
143
+ ```
144
+
145
+ ## Customization
146
+ You can customize the chat panel by passing props to the ChatPanel component. Refer to the library documentation for more details on available props and customization options.
147
+
148
+ See our storybook documentation showing how to theme, size and use the variaous features in this component:
149
+
150
+ https://predictabilityatscale.github.io/llmasaservice-ui/?path=/docs/chatpanel--docs
151
+
152
+
153
+ ## License
154
+ This project is licensed under the MIT License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llmasaservice-ui",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Prebuilt UI components for LLMAsAService.io",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",