Gathering detailed insights and metrics for @yourgpt/llmspark-nodejs
Gathering detailed insights and metrics for @yourgpt/llmspark-nodejs
npm install @yourgpt/llmspark-nodejs
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
200%
3
Compared to previous week
Last month
-15.4%
11
Compared to previous month
Last year
33,400%
335
Compared to previous year
4
7
This @yourgpt/llmspark-nodejs package provides convenient access to the LLM Spark REST API from JavaScript. It allows you to interact with the API and harness the power of AI for various tasks.
You can install this package using npm:
1npm install @yourgpt/llmspark-nodejs
Visit https://llmspark.yourgpt.ai and generate your API keys
1const { LLMSpark } = require("@yourgpt/llmspark-nodejs"); 2 3const api = new LLMSpark({ 4 apiKey: 'My Api Key' 5});
The code below shows how to get started using the stream function with the stream set to true.
1const main = async () => { 2 let data = await api.generate({ 3 deployment_uid: "d5b67a9c-2768-4b06-b0b1-5eca4a15a0e", 4 variables: { "query_str":"how are you doing?"}, 5 tags: ["user-123"], 6 stream: true 7 }}); 8 9 for await(const stream of result.getOutput()){ 10 console.log(stream) 11 } 12 console.log(data.getMetrics()); // for getting metrics 13 console.log(data.getNodes()); // for getting nodes 14 15}; 16 17 main();
The code below shows how to get started using the stream function with the default stream set to false.
1const main = async () => { 2 let data = await api.generate({ 3 deployment_uid: "d5b67a9c-2768-4b06-b0b1-5eca4a15a0e", 4 variables: { "query_str":"how are you doing?" }, 5 tags: ["user-123"] 6 }}); 7 8 console.log(data.getOutput()); // for getting output 9 console.log(data.getMetrics()); // for getting metrics 10 console.log(data.getNodes()); // for getting nodes 11 12}; 13 14 main();
1const search = async () => { 2 let data = await api.search({limit: 3, query: "what information you have?"}); 3 return data; 4}; 5 6search();
No vulnerabilities found.
No security vulnerabilities found.