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 +12 -0
- package/package.json +1 -1
- package/readme.md +35 -0
- package/images/APIKey.png +0 -0
- package/images/AddLLMService.png +0 -0
- package/images/LLMServicesPage.png +0 -0
- package/images/TestCall.png +0 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
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
|
+

|
package/images/APIKey.png
DELETED
|
Binary file
|
package/images/AddLLMService.png
DELETED
|
Binary file
|
|
Binary file
|
package/images/TestCall.png
DELETED
|
Binary file
|