llmasaservice-client 0.0.8 → 0.0.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # llmasaservice-client
2
2
 
3
+ ## 0.0.10
4
+
5
+ ### Patch Changes
6
+
7
+ - Removing images from NPM package
8
+
9
+ ## 0.0.9
10
+
11
+ ### Patch Changes
12
+
13
+ - Added next.js / react example
14
+
3
15
  ## 0.0.8
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "llmasaservice-client",
3
3
  "license": "MIT",
4
- "version": "0.0.8",
4
+ "version": "0.0.10",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
package/readme.md CHANGED
@@ -181,3 +181,38 @@ Calling **send** makes a secure call to LLMAsAService where a response is marsha
181
181
  We have pre-built UIs in the works, but for now, you can call send and display the response wherever needed. An additional property **idle"" can be used to disable the send buttons when a response is ongoing. It will be true when idle, false when busy.
182
182
 
183
183
  We also accept Abort functionality, and are in the process of documenting that now. If you need it email help@heycasey.io and we'll sort you out.
184
+
185
+
186
+ ### Next.js / react Example
187
+
188
+ ```typescript
189
+ "use client"; // remove for react
190
+
191
+ import { useLLM } from "llmasaservice-client";
192
+
193
+ export default function Home() {
194
+ const { send, response, idle } = useLLM({
195
+ project_id: "[your project ocde]",
196
+ });
197
+
198
+ const sendChat = async () => {
199
+ const cityInput = document.getElementById("city") as HTMLInputElement;
200
+ if (cityInput) {
201
+ send(
202
+ `Write a short three sentence background on the city called: ${cityInput.value}`
203
+ );
204
+ }
205
+ };
206
+
207
+ return (
208
+ <>
209
+ <input id="city" type="text" placeholder="Enter city name" />
210
+ <button onClick={sendChat} disabled={!idle}>
211
+ Get short background for city
212
+ </button>
213
+ <p>{response}</p>
214
+ </>
215
+ );
216
+ }
217
+ ```
218
+ ![Next / React Example](images/nextexample.png)
package/images/APIKey.png DELETED
Binary file
Binary file
Binary file
Binary file