diff --git a/docs/index.html b/docs/index.html index 3c363f1..1519b00 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,7 +8,7 @@
    $ npm i predictionguard
 

Code Example

-
import * as pg from 'predictionguard';

const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

async function Chat() {
const input = [
{
role: pg.Roles.User,
content: 'How do you feel about the world in general',
},
];

var [result, err] = await client.Chat(pg.Models.NeuralChat7B, input, 1000, 1.1);
if (err != null) {
console.log('ERROR:' + err.error);
return;
}

console.log('RESULT:' + result.model + ': ' + result.choices[0].message.content);
}

Chat(); +
import * as pg from 'predictionguard';

const client = new pg.Client('https://api.predictionguard.com', process.env.PGKEY);

async function Chat() {
const input = {
model: pg.Models.NeuralChat7B,
messages: [
{
role: pg.Roles.User,
content: 'How do you feel about the world in general',
},
],
maxTokens: 1000,
temperature: 0.1,
topP: 0.1,
options: {
factuality: true,
toxicity: true,
pii: pg.PIIs.Replace,
piiReplaceMethod: pg.ReplaceMethods.Random,
},
};

var [result, err] = await client.Chat(input);
if (err != null) {
console.log('ERROR:' + err.error);
return;
}

console.log('RESULT:' + result.createdDate() + ': ' + result.model + ': ' + result.choices[0].message.content);
}

Chat();

Take a look at the examples directory for more examples.

Docs

You can find the SDK and Prediction Guard docs using these links.