diff --git a/docs/assets/search.js b/docs/assets/search.js index 68b33d3..bb60f89 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE61dXXPjNrL9L/ardyKA33m7k4/N3M3sTSW7e+vWVGqKtmCbY0lUSGqcSSr//QIkQTZa3QBF+2GqNFYDB+jTaDQOKfLPq6Z+bq++/vDn1VN12F59LWR+c3Uo9+rq66tvdpU6dFc3V6dmp/97tyvbVrVfDX9+89jtd/q78a/6+6u/bmwviZBTL3f1oe2a011XN76url070O3N1bFszECmEc1AYiPjCcn07UMYvp977trt36r2b8em+lx2ajlOeaz+ob54oSaTVWhyEwMWHksvB9ejwUKPnfX9yy/fBbsfbNYi/Kdqq/oQBJnMVuHU++NOdUEcaLYG57v9rdpuq8ODFwZarUH5vrzrTuWu6vxR5pitwflBlbvu8ZtHdffkBXLt1iC9O3xSd0F6oNUalJ/VcVfeqZ/evfPCOGZrcP5V/17dhdgBRqswmvLQ7oZU4QEBVqs8Vj5/W/9d+TMMMCLyWd1pztT2Qsyf6nYB6Gj1aqg6kS0Dng3XYifpnDSaBmx+1aFTzb2Ov/ar/gvvTupsPCrcz7W1oYNhGMnc/eye9/VW7dqpc3U47duvhj/6BzhP821TbR9UVz+r5seyeVDvuv373f5dd8f3eu1rQ09hHCg5gh9Us1et/Kmpf9yV+zLK33qgSePLMf9Zn9qhq74bKSIfKG39kpm+r3TZVO6yZVOF1pej6jF/LkWSvf3hew+aa7XCo+qkh2hKAu+kkNnlOP9XRfFbp7w6B4E2lyN8q9SxVerpG23TpNnbd2OJ6wH0NFmID1JevVN4Sfd/W7qi/6ttdbyUBzzguZNraEIPcBgF2f+/W9XwXY/fXtzrL1/aTu35fqfvl/U8+1MXDNid5k+L8+OuBnUWan9tv6UH1UOTvY7FDNvv/P2ins+Kqfeqe6y3Z2HkfLnUAz+Xh219xsx5V9eTIUOROzQS6/vyCTuFQhrN1uN8o4uvh7r5sgALmK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was/SFRgCuy7acl8jNzBhbA10fh8I1N2ktFtPYj+wSlOrmlvccRCuBZcJWl3b6xrb0SPMc2iA8MPtKe2u/lw6UVIAbgqOG+N2dm9TAdP7hguG9nh2KcQ8Bgd4chuDfdMA3P9gARtNZ357wt9MUsakoExys/0Q2w9WMpCsxNY+l4+VW7CZh/KArnN5s31W27NBwxp3w+0R7Ze2U27GBZPF3u/QlfvKrYg3cKo23Nrp1E5vZq4jXP7s9VjdyaPRdU9oLcCiVNi1IKxaJTKbTtjgPlOJ4aUkubHVOntXWfdYIsbg9rHh1mJXH93kCa+XicgekewFUJFNYh0XPbrFo9si7IgNTGHLUJFNV2S5VdhNr+aBSwJ2c2xh0g3Z6zW2KWLTgLmavb7ZzS/xgBUxrM7t6uJSEXdLHFS/pS3tJSu8u+9IgBs/1JJZ6UkH8NPZSoXUbzjP01NTVjgnmsdUAV+OyVOzRYsO5lJWt+/fNAC2VTDAcZrYo8Cpde/RhCcJ9gTyuVKdMWpRgeCImBzisz4iu/PqXJsQHOiXKopv8Y1zcO1Icg3/eqOPAUe1qw7a6MOvf/31/9Qgr+1h1AAA"; \ No newline at end of file diff --git a/docs/classes/Client.html b/docs/classes/Client.html index 7f7ae26..e928417 100644 --- a/docs/classes/Client.html +++ b/docs/classes/Client.html @@ -26,9 +26,9 @@
  • A Promise with a Chat object and an Error object if the error is not null.
  • -

    Example

    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(); +

    Example

    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,
    topK: 50.0,
    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();
    -
    • ChatSSE generates a stream of chat completions based on a +

    • ChatSSE generates a stream of chat completions based on a conversation history.

      Parameters

      • input: ChatSSEInput

        input represents the entire set of possible input for the SSE Chat call.

        @@ -36,27 +36,27 @@
      • A Promise with an Error object if the error is not null.
      -

      Example

      import * as pg from 'predictiongaurd';

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

      async function ChatSSE() {
      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,
      onMessage: function (event, err) {
      if (err != null) {
      if (err.error == 'EOF') {
      return;
      }
      console.log(err);
      }

      for (const choice of event.choices) {
      if (choice.delta.hasOwnProperty('content')) {
      process.stdout.write(choice.delta.content);
      }
      }
      },
      };

      var err = await client.ChatSSE(input);
      if (err != null) {
      console.log('ERROR:' + err.error);
      return;
      }
      }

      ChatSSE(); +

      Example

      import * as pg from 'predictiongaurd';

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

      async function ChatSSE() {
      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,
      topK: 50.0,
      onMessage: function (event, err) {
      if (err != null) {
      if (err.error == 'EOF') {
      return;
      }
      console.log(err);
      }

      for (const choice of event.choices) {
      if (choice.delta.hasOwnProperty('content')) {
      process.stdout.write(choice.delta.content);
      }
      }
      },
      };

      var err = await client.ChatSSE(input);
      if (err != null) {
      console.log('ERROR:' + err.error);
      return;
      }
      }

      ChatSSE();
      -
    • ChatVision generates answers a question about an image.

      Parameters

      • input: ChatVisionInput

        input represents the entire set of possible input for the Vision Chat call.

      Returns Promise<[ChatVision, null | Error]>

      • A Promise with a ChatVision object and a Error object if the error is not null.
      -

      Example

      import * as pg from 'predictionguard';

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

      async function ChatVision() {
      const image = new pg.ImageNetwork('https://pbs.twimg.com/profile_images/1571574401107169282/ylAgz_f5_400x400.jpg');

      const input = {
      role: pg.Roles.User,
      question: 'is there a deer in this picture',
      image: image,
      maxTokens: 1000,
      temperature: 0.1,
      topP: 0.1,
      };

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

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

      ChatVision(); +

      Example

      import * as pg from 'predictionguard';

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

      async function ChatVision() {
      const image = new pg.ImageNetwork('https://pbs.twimg.com/profile_images/1571574401107169282/ylAgz_f5_400x400.jpg');

      const input = {
      role: pg.Roles.User,
      question: 'is there a deer in this picture',
      image: image,
      maxTokens: 1000,
      temperature: 0.1,
      topP: 0.1,
      topK: 50.0,
      };

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

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

      ChatVision();
      -
    • Completion generates text completions based on the provided input.

      Parameters

      • input: CompletionInput

        input represents the entire set of possible input for the Completion call.

      Returns Promise<[Completion, null | Error]>

      • A Promise with a Completion object and a Error object if the error is not null.
      -

      Example

      import * as pg from 'predictionguard';

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

      async function Completions() {
      const input = {
      model: pg.Models.NeuralChat7B,
      prompt: 'Will I lose my hair',
      maxTokens: 1000,
      temperature: 0.1,
      topP: 0.1,
      };

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

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

      Completions(); +

      Example

      import * as pg from 'predictionguard';

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

      async function Completions() {
      const input = {
      model: pg.Models.NeuralChat7B,
      prompt: 'Will I lose my hair',
      maxTokens: 1000,
      temperature: 0.1,
      topP: 0.1,
      topK: 50.0,
      };

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

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

      Completions();
      -
    • Embedding generates chat completions based on a conversation history.

      Parameters

      • input: EmbeddingInput[]

        input represents a collection of text and images to vectorize.

      Returns Promise<[Embedding, null | Error]>

        @@ -65,7 +65,7 @@

      Example

      import * as pg from 'predictiongaurd';

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

      async function Embedding() {
      const image = new pg.ImageNetwork('https://pbs.twimg.com/profile_images/1571574401107169282/ylAgz_f5_400x400.jpg');

      const input = [
      {
      text: 'This is Bill Kennedy, a decent Go developer.',
      image: image,
      },
      ];

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

      for (const dt of result.data) {
      process.stdout.write(dt.embedding.toString());
      }
      }

      Embedding();
      -
    • Factuality checks the factuality of a given text compared to a reference.

      +
    • Factuality checks the factuality of a given text compared to a reference.

      Parameters

      • reference: string

        reference represents the reference text for comparison.

      • text: string

        text represents the text to be checked @@ -76,14 +76,14 @@

      Example

      import * as pg from 'predictionguard';

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

      async function Factuality() {
      const fact = `The President shall receive in full for his services during
      the term for which he shall have been elected compensation in the aggregate
      amount of 400,000 a year, to be paid monthly, and in addition an expense
      allowance of 50,000 to assist in defraying expenses relating to or resulting
      from the discharge of his official duties. Any unused amount of such expense
      allowance shall revert to the Treasury pursuant to section 1552 of title 31,
      United States Code. No amount of such expense allowance shall be included in
      the gross income of the President. He shall be entitled also to the use of
      the furniture and other effects belonging to the United States and kept in
      the Executive Residence at the White House.`;

      const text = `The president of the united states can take a salary of one
      million dollars`;

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

      console.log('RESULT:' + JSON.stringify(result.checks[0]));
      }

      Factuality();
      -
    • HealthCheck validates the PG API Service is available.

      +
    • HealthCheck validates the PG API Service is available.

      Returns Promise<[string, null | Error]>

      • A Promise with a string and an Error object if the error is not null.

      Example

      import * as pg from 'predictionguard';

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

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

      console.log(result);
      }

      HealthCheck();
      -
    • Injection detects potential prompt injection attacks in a given prompt.

      Parameters

      • prompt: string

        prompt represents the text to detect injection attacks against.

      Returns Promise<[Injection, null | Error]>

        @@ -92,14 +92,14 @@

      Example

      import * as pg from 'predictionguard';

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

      async function Injection() {
      const prompt = `A short poem may be a stylistic choice or it may be that you
      have said what you intended to say in a more concise way.`;

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

      console.log('RESULT:' + result.checks[0].probability);
      }

      Injection();
      -
    • RawDoGet performs a raw GET call.

      +
    • RawDoGet performs a raw GET call.

      Parameters

      • endpoint: string

        endpoint represents endpoint to call and does not include the transport or domain.

      Returns Promise<[any, null | Error]>

      • A Promise with a respose object and an error object if the error is not null.
      -
    • RawDoPost performs a raw POST call.

      +
    • RawDoPost performs a raw POST call.

      Parameters

      • endpoint: string

        endpoint represents endpoint to call and does not include the transport or domain.

      • body: any

        body represents an input object.

        @@ -107,7 +107,7 @@
      • A Promise with a respose object and an error object if the error is not null.
      -
    • RawDoSSEPost performs a raw POST call with SSE support.

      +
    • RawDoSSEPost performs a raw POST call with SSE support.

      Parameters

      • endpoint: string

        endpoint represents endpoint to call and does not include the transport or domain.

      • body: any

        body represents an input object.

        @@ -116,7 +116,7 @@
          • (event, err): void
          • Parameters

            • event: null | ServerSentEvent
            • err: null | Error

            Returns void

      Returns Promise<null | Error>

      • A Promise with an error object if the error is not null.
      -
    • ReplacePII replaces personal information such as names, SSNs, and +

    • ReplacePII replaces personal information such as names, SSNs, and emails in a given text.

      Parameters

      • replaceMethod: ReplaceMethods

        replaceMethod represents the method to use for replacing personal information.

        @@ -128,7 +128,7 @@

      Example

      import * as pg from 'predictionguard';

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

      async function ReplacePII() {
      const replaceMethod = pg.ReplaceMethods.Mask;
      const prompt = `My email is bill@ardanlabs.com and my number is 954-123-4567.`;

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

      console.log('RESULT:' + result.checks[0].new_prompt);
      }

      ReplacePII();
      -
    • Toxicity checks the toxicity of a given text.

      Parameters

      • text: string

        text represents the text to be scored for toxicity.

      Returns Promise<[Toxicity, null | Error]>

        @@ -137,7 +137,7 @@

      Example

      import * as pg from 'predictionguard';

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

      async function Toxicity() {
      const text = `Every flight I have is late and I am very angry. I want to
      hurt someone.`;

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

      console.log('RESULT:' + result.checks[0].score);
      }

      Toxicity();
      -
    • Translate converts text from one language to another.

      +
    • Translate converts text from one language to another.

      Parameters

      • text: string

        text represents the text to be translated.

      • sourceLang: Languages

        sourceLang represents the source language of the text.

        @@ -149,4 +149,4 @@

      Example

      import * as pg from 'predictionguard';

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

      async function Translate() {
      const sourceLang = pg.Languages.English;
      const targetLang = pg.Languages.Spanish;
      const text = `The rain in Spain stays mainly in the plain`;

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

      console.log('RESULT:' + result.best_translation);
      }

      Translate();
      -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/Chat.html b/docs/interfaces/Chat.html index fa66662..8987d3c 100644 --- a/docs/interfaces/Chat.html +++ b/docs/interfaces/Chat.html @@ -1,15 +1,15 @@ Chat | predictionguard

    Interface Chat

    Chat represents an object that contains the result for the chat call.

    -
    interface Chat {
        choices: ChatChoice[];
        created: number;
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface Chat {
        choices: ChatChoice[];
        created: number;
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    choices: ChatChoice[]

    choices represents the collection of choices to choose from.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    model: Models

    model represents the model used for generating the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    model: Models

    model represents the model used for generating the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/ChatChoice.html b/docs/interfaces/ChatChoice.html index 1ad0982..30d3942 100644 --- a/docs/interfaces/ChatChoice.html +++ b/docs/interfaces/ChatChoice.html @@ -1,10 +1,10 @@ ChatChoice | predictionguard

    Interface ChatChoice

    ChatChoice represents an object that contains a result choice.

    -
    interface ChatChoice {
        index: number;
        message: ChatMessage;
        status: string;
    }

    Properties

    interface ChatChoice {
        index: number;
        message: ChatMessage;
        status: string;
    }

    Properties

    Properties

    index: number

    index represents the index position in the collection for this choice.

    -
    message: ChatMessage

    message represents the message response for this choice.

    -
    status: string

    status represents if the response for this choice was successful +

    message: ChatMessage

    message represents the message response for this choice.

    +
    status: string

    status represents if the response for this choice was successful or not.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/ChatInput.html b/docs/interfaces/ChatInput.html index 1d7d8d5..463e9cc 100644 --- a/docs/interfaces/ChatInput.html +++ b/docs/interfaces/ChatInput.html @@ -1,14 +1,16 @@ ChatInput | predictionguard

    Interface ChatInput

    ChatInput represents the full potential input options for chat.

    -
    interface ChatInput {
        maxTokens: number;
        messages: ChatInputMessage[];
        model: Models;
        options: ChatInputOptions;
        temperature: number;
        topP: number;
    }

    Properties

    interface ChatInput {
        maxTokens: number;
        messages: ChatInputMessage[];
        model: Models;
        options: ChatInputOptions;
        temperature: number;
        topK: number;
        topP: number;
    }

    Properties

    maxTokens: number

    maxTokens represents the max number of tokens to return.

    messages: ChatInputMessage[]

    messages represents the set of messages to process.

    model: Models

    model represents the model to use.

    options represents a set of optional parameters.

    -
    temperature: number

    temperature represents the randomness in GPT's output.

    -
    topP: number

    topP represents the diversity of the generated text.

    -
    \ No newline at end of file +
    temperature: number

    temperature represents the randomness in GPT's output.

    +
    topK: number

    topK represents the variability of the generated text.

    +
    topP: number

    topP represents the diversity of the generated text.

    +
    \ No newline at end of file diff --git a/docs/interfaces/ChatMessage.html b/docs/interfaces/ChatMessage.html index 8df9420..dc08433 100644 --- a/docs/interfaces/ChatMessage.html +++ b/docs/interfaces/ChatMessage.html @@ -1,9 +1,9 @@ ChatMessage | predictionguard

    Interface ChatMessage

    ChatMessage represents an object that contains the content and a role. It can be used for input and returned as part of the response.

    -
    interface ChatMessage {
        content: string;
        output: string;
        role: Roles;
    }

    Properties

    interface ChatMessage {
        content: string;
        output: string;
        role: Roles;
    }

    Properties

    Properties

    content: string

    content represents the content of the message.

    -
    output: string

    output represents the output for this message.

    -
    role: Roles

    role represents the role of the sender (user or assistant).

    -
    \ No newline at end of file +
    output: string

    output represents the output for this message.

    +
    role: Roles

    role represents the role of the sender (user or assistant).

    +
    \ No newline at end of file diff --git a/docs/interfaces/ChatSSE.html b/docs/interfaces/ChatSSE.html index 5277bdf..1bfd9ac 100644 --- a/docs/interfaces/ChatSSE.html +++ b/docs/interfaces/ChatSSE.html @@ -1,16 +1,16 @@ ChatSSE | predictionguard

    Interface ChatSSE

    ChatSSE represents an object that contains the result for the chatSSE call.

    -
    interface ChatSSE {
        choices: ChatSSEChoice[];
        created: number;
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface ChatSSE {
        choices: ChatSSEChoice[];
        created: number;
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    choices: ChatSSEChoice[]

    choices represents the collection of choices to choose from.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    model: Models

    model represents the model used for generating the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    model: Models

    model represents the model used for generating the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/ChatSSEChoice.html b/docs/interfaces/ChatSSEChoice.html index bf3ed44..5ec16ce 100644 --- a/docs/interfaces/ChatSSEChoice.html +++ b/docs/interfaces/ChatSSEChoice.html @@ -1,15 +1,15 @@ ChatSSEChoice | predictionguard

    Interface ChatSSEChoice

    ChatSSEChoice represents an object that contains a result choice.

    -
    interface ChatSSEChoice {
        delta: ChatSSEDelta;
        finish_reason: string;
        generated_text: string;
        index: number;
        logprobs: number;
    }

    Properties

    interface ChatSSEChoice {
        delta: ChatSSEDelta;
        finish_reason: string;
        generated_text: string;
        index: number;
        logprobs: number;
    }

    Properties

    delta represents the partial content for this choice.

    -
    finish_reason: string

    finish_reason represents the reason the response has finished +

    finish_reason: string

    finish_reason represents the reason the response has finished which is provided when this is the last choice.

    -
    generated_text: string

    generated_text represents the final completed chat response which +

    generated_text: string

    generated_text represents the final completed chat response which is provided when this is the last choice.

    -
    index: number

    index represents the index position in the collection for +

    index: number

    index represents the index position in the collection for this choice.

    -
    logprobs: number

    logprobs represents the log probabilty of accuracy for this choice.

    -
    \ No newline at end of file +
    logprobs: number

    logprobs represents the log probabilty of accuracy for this choice.

    +
    \ No newline at end of file diff --git a/docs/interfaces/ChatSSEDelta.html b/docs/interfaces/ChatSSEDelta.html index 19a5e92..cfdb7d9 100644 --- a/docs/interfaces/ChatSSEDelta.html +++ b/docs/interfaces/ChatSSEDelta.html @@ -1,4 +1,4 @@ ChatSSEDelta | predictionguard

    Interface ChatSSEDelta

    ChatSSEDelta represents an object that contains the content.

    -
    interface ChatSSEDelta {
        content: string;
    }

    Properties

    interface ChatSSEDelta {
        content: string;
    }

    Properties

    Properties

    content: string

    content represents the partial content response for a choice.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/ChatSSEInput.html b/docs/interfaces/ChatSSEInput.html index 431ea99..f6fd7c2 100644 --- a/docs/interfaces/ChatSSEInput.html +++ b/docs/interfaces/ChatSSEInput.html @@ -1,14 +1,16 @@ ChatSSEInput | predictionguard

    Interface ChatSSEInput

    ChatSSEInput represents the full potential input options for SSE chat.

    -
    interface ChatSSEInput {
        maxTokens: number;
        messages: ChatInputMessage[];
        model: Models;
        onMessage: ((event, err) => void);
        temperature: number;
        topP: number;
    }

    Properties

    interface ChatSSEInput {
        maxTokens: number;
        messages: ChatInputMessage[];
        model: Models;
        onMessage: ((event, err) => void);
        temperature: number;
        topK: number;
        topP: number;
    }

    Properties

    maxTokens: number

    maxTokens represents the max number of tokens to return.

    -
    messages: ChatInputMessage[]

    messages represents the set of messages to process.

    -
    model: Models

    model represents the model to use.

    -
    onMessage: ((event, err) => void)

    onMessage represents a function that will receive the messages.

    -

    Type declaration

      • (event, err): void
      • Parameters

        Returns void

    temperature: number

    temperature represents the randomness in GPT's output.

    -
    topP: number

    topP represents the diversity of the generated text.

    -
    \ No newline at end of file +
    messages: ChatInputMessage[]

    messages represents the set of messages to process.

    +
    model: Models

    model represents the model to use.

    +
    onMessage: ((event, err) => void)

    onMessage represents a function that will receive the messages.

    +

    Type declaration

      • (event, err): void
      • Parameters

        Returns void

    temperature: number

    temperature represents the randomness in GPT's output.

    +
    topK: number

    topK represents the variability of the generated text.

    +
    topP: number

    topP represents the diversity of the generated text.

    +
    \ No newline at end of file diff --git a/docs/interfaces/ChatVision.html b/docs/interfaces/ChatVision.html index c74dc15..8a8f2e5 100644 --- a/docs/interfaces/ChatVision.html +++ b/docs/interfaces/ChatVision.html @@ -1,15 +1,15 @@ ChatVision | predictionguard

    Interface ChatVision

    ChatVision represents the result for the vision call.

    -
    interface ChatVision {
        choices: ChatVisionChoice[];
        created: number;
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface ChatVision {
        choices: ChatVisionChoice[];
        created: number;
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    choices: ChatVisionChoice[]

    choices represents the collection of choices to choose from.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    model: Models

    model represents the model used for generating the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    model: Models

    model represents the model used for generating the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/ChatVisionChoice.html b/docs/interfaces/ChatVisionChoice.html index 696a680..f890802 100644 --- a/docs/interfaces/ChatVisionChoice.html +++ b/docs/interfaces/ChatVisionChoice.html @@ -1,10 +1,10 @@ ChatVisionChoice | predictionguard

    Interface ChatVisionChoice

    ChatVisionChoice represents a choice for the vision call.

    -
    interface ChatVisionChoice {
        index: number;
        message: ChatVisionMessage;
        status: string;
    }

    Properties

    interface ChatVisionChoice {
        index: number;
        message: ChatVisionMessage;
        status: string;
    }

    Properties

    Properties

    index: number

    index represents the index position in the collection for this choice.

    -

    message represents a response for this choice.

    -
    status: string

    status represents if the response for this choice was successful +

    message represents a response for this choice.

    +
    status: string

    status represents if the response for this choice was successful or not.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/ChatVisionInput.html b/docs/interfaces/ChatVisionInput.html index afdc6e1..9803d1c 100644 --- a/docs/interfaces/ChatVisionInput.html +++ b/docs/interfaces/ChatVisionInput.html @@ -1,14 +1,16 @@ ChatVisionInput | predictionguard

    Interface ChatVisionInput

    ChatVisionInput represents the full potential input options for Vision chat.

    -
    interface ChatVisionInput {
        image: Base64Encoder;
        maxTokens: number;
        question: string;
        role: Roles;
        temperature: number;
        topP: number;
    }

    Properties

    interface ChatVisionInput {
        image: Base64Encoder;
        maxTokens: number;
        question: string;
        role: Roles;
        temperature: number;
        topK: number;
        topP: number;
    }

    Properties

    image represents an object that knows how to retrieve an image.

    -
    maxTokens: number

    maxTokens represents the max number of tokens to return.

    -
    question: string

    question represents the question about the image.

    -
    role: Roles

    role represents the role of the sender (user or assistant).

    -
    temperature: number

    temperature represents the randomness in GPT's output.

    -
    topP: number

    topP represents the diversity of the generated text.

    -
    \ No newline at end of file +
    maxTokens: number

    maxTokens represents the max number of tokens to return.

    +
    question: string

    question represents the question about the image.

    +
    role: Roles

    role represents the role of the sender (user or assistant).

    +
    temperature: number

    temperature represents the randomness in GPT's output.

    +
    topK: number

    topK represents the variability of the generated text.

    +
    topP: number

    topP represents the diversity of the generated text.

    +
    \ No newline at end of file diff --git a/docs/interfaces/ChatVisionMessage.html b/docs/interfaces/ChatVisionMessage.html index b0ee79e..5e91777 100644 --- a/docs/interfaces/ChatVisionMessage.html +++ b/docs/interfaces/ChatVisionMessage.html @@ -1,8 +1,8 @@ ChatVisionMessage | predictionguard

    Interface ChatVisionMessage

    ChatVisionMessage represents content for the vision call.

    -
    interface ChatVisionMessage {
        content: string;
        output: string;
        role: Roles;
    }

    Properties

    interface ChatVisionMessage {
        content: string;
        output: string;
        role: Roles;
    }

    Properties

    Properties

    content: string

    content represents the response for this message.

    -
    output: string

    output represents the output for this message.

    -
    role: Roles

    role represents the role of the sender (user or assistant).

    -
    \ No newline at end of file +
    output: string

    output represents the output for this message.

    +
    role: Roles

    role represents the role of the sender (user or assistant).

    +
    \ No newline at end of file diff --git a/docs/interfaces/Completion.html b/docs/interfaces/Completion.html index e41d6af..f68dbf3 100644 --- a/docs/interfaces/Completion.html +++ b/docs/interfaces/Completion.html @@ -1,14 +1,14 @@ Completion | predictionguard

    Interface Completion

    Completion represents an object that contains the result for the completion call.

    -
    interface Completion {
        choices: CompletionChoice[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface Completion {
        choices: CompletionChoice[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    Methods

    Properties

    choices: CompletionChoice[]

    choices represents the collection of choices to choose from.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/CompletionChoice.html b/docs/interfaces/CompletionChoice.html index 88f0a82..1a788ad 100644 --- a/docs/interfaces/CompletionChoice.html +++ b/docs/interfaces/CompletionChoice.html @@ -1,13 +1,13 @@ CompletionChoice | predictionguard

    Interface CompletionChoice

    Choice represents an object that contains a result choice.

    -
    interface CompletionChoice {
        index: number;
        model: Models;
        status: string;
        text: string;
    }

    Properties

    interface CompletionChoice {
        index: number;
        model: Models;
        status: string;
        text: string;
    }

    Properties

    Properties

    index: number

    index represents the index position in the collection for this choice.

    -
    model: Models

    model represents the model used for generating the result for +

    model: Models

    model represents the model used for generating the result for this choice.

    -
    status: string

    status represents if the response for this choice was successful +

    status: string

    status represents if the response for this choice was successful or not.

    -
    text: string

    text represents the generated text for this choice.

    -
    \ No newline at end of file +
    text: string

    text represents the generated text for this choice.

    +
    \ No newline at end of file diff --git a/docs/interfaces/CompletionInput.html b/docs/interfaces/CompletionInput.html index bf01d29..54bf96c 100644 --- a/docs/interfaces/CompletionInput.html +++ b/docs/interfaces/CompletionInput.html @@ -1,12 +1,14 @@ CompletionInput | predictionguard

    Interface CompletionInput

    CompletionInput represents the full potential input options for completion.

    -
    interface CompletionInput {
        maxTokens: number;
        model: Models;
        prompt: string;
        temperature: number;
        topP: number;
    }

    Properties

    interface CompletionInput {
        maxTokens: number;
        model: Models;
        prompt: string;
        temperature: number;
        topK: number;
        topP: number;
    }

    Properties

    maxTokens: number

    maxTokens represents the max number of tokens to return.

    -
    model: Models

    model represents the model to use.

    -
    prompt: string

    prompt represents the prompt to process.

    -
    temperature: number

    temperature represents the randomness in GPT's output.

    -
    topP: number

    topP represents the diversity of the generated text.

    -
    \ No newline at end of file +
    model: Models

    model represents the model to use.

    +
    prompt: string

    prompt represents the prompt to process.

    +
    temperature: number

    temperature represents the randomness in GPT's output.

    +
    topK: number

    topK represents the variability of the generated text.

    +
    topP: number

    topP represents the diversity of the generated text.

    +
    \ No newline at end of file diff --git a/docs/interfaces/Embedding.html b/docs/interfaces/Embedding.html index 2ad9932..ffadbce 100644 --- a/docs/interfaces/Embedding.html +++ b/docs/interfaces/Embedding.html @@ -1,5 +1,5 @@ Embedding | predictionguard

    Interface Embedding

    Embedding represents the result for the embedding call.

    -
    interface Embedding {
        created: number;
        data: EmbeddingData[];
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface Embedding {
        created: number;
        data: EmbeddingData[];
        id: string;
        model: Models;
        object: string;
        createdDate(): Date;
    }

    Properties

    created data id model @@ -7,9 +7,9 @@

    Methods

    Properties

    created: number

    created represents the unix timestamp for when the request was received.

    -

    EmbeddingData represents the collection of vector points.

    -
    id: string

    id represents a unique identifier for the result.

    -
    model: Models

    model represents the model used for generating the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +

    EmbeddingData represents the collection of vector points.

    +
    id: string

    id represents a unique identifier for the result.

    +
    model: Models

    model represents the model used for generating the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/EmbeddingData.html b/docs/interfaces/EmbeddingData.html index 1dcb8ba..7e8d83b 100644 --- a/docs/interfaces/EmbeddingData.html +++ b/docs/interfaces/EmbeddingData.html @@ -1,9 +1,9 @@ EmbeddingData | predictionguard

    Interface EmbeddingData

    EmbeddingData represents the vector data points.

    -
    interface EmbeddingData {
        embedding: number[];
        index: number;
        status: string;
    }

    Properties

    interface EmbeddingData {
        embedding: number[];
        index: number;
        status: string;
    }

    Properties

    Properties

    embedding: number[]
    index: number

    index represents the index position in the collection for +

    Properties

    embedding: number[]
    index: number

    index represents the index position in the collection for this choice.

    -
    status: string

    status represents if the response for this choice was successful +

    status: string

    status represents if the response for this choice was successful or not.

    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/docs/interfaces/EmbeddingInput.html b/docs/interfaces/EmbeddingInput.html index 96eda25..3e21bc8 100644 --- a/docs/interfaces/EmbeddingInput.html +++ b/docs/interfaces/EmbeddingInput.html @@ -1,6 +1,6 @@ EmbeddingInput | predictionguard

    Interface EmbeddingInput

    EmbeddingInput represents the input to generate embeddings.

    -
    interface EmbeddingInput {
        image: Base64Encoder;
        text: string;
    }

    Properties

    interface EmbeddingInput {
        image: Base64Encoder;
        text: string;
    }

    Properties

    Properties

    image represents an image to vectorize.

    -
    text: string

    text represents text to vectorize.

    -
    \ No newline at end of file +
    text: string

    text represents text to vectorize.

    +
    \ No newline at end of file diff --git a/docs/interfaces/Factuality.html b/docs/interfaces/Factuality.html index 3162a4d..08208c6 100644 --- a/docs/interfaces/Factuality.html +++ b/docs/interfaces/Factuality.html @@ -1,14 +1,14 @@ Factuality | predictionguard

    Interface Factuality

    Factuality represents an object that contains the result for the factuality call.

    -
    interface Factuality {
        checks: FactualityCheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface Factuality {
        checks: FactualityCheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    Methods

    Properties

    checks: FactualityCheck[]

    checks represents the collection of checks to choose from.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/FactualityCheck.html b/docs/interfaces/FactualityCheck.html index 1ecaa5b..65b337f 100644 --- a/docs/interfaces/FactualityCheck.html +++ b/docs/interfaces/FactualityCheck.html @@ -1,9 +1,9 @@ FactualityCheck | predictionguard

    Interface FactualityCheck

    FactualityCheck represents an object that contains a check choice.

    -
    interface FactualityCheck {
        index: number;
        score: number;
        status: string;
    }

    Properties

    interface FactualityCheck {
        index: number;
        score: number;
        status: string;
    }

    Properties

    Properties

    index: number

    index represents the index position in the collection for this checks.

    -
    score: number

    score represents the score for this check.

    -
    status: string

    status represents the status for this check.

    -
    \ No newline at end of file +
    score: number

    score represents the score for this check.

    +
    status: string

    status represents the status for this check.

    +
    \ No newline at end of file diff --git a/docs/interfaces/Injection.html b/docs/interfaces/Injection.html index e0b225a..033b404 100644 --- a/docs/interfaces/Injection.html +++ b/docs/interfaces/Injection.html @@ -1,14 +1,14 @@ Injection | predictionguard

    Interface Injection

    Injection represents an object that contains the result for the injection call.

    -
    interface Injection {
        checks: InjectionCheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface Injection {
        checks: InjectionCheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    Methods

    Properties

    checks: InjectionCheck[]

    checks represents the collection of checks to choose from.

    -
    created: number

    created represents the unix timestamp for when the result was +

    created: number

    created represents the unix timestamp for when the result was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/InjectionCheck.html b/docs/interfaces/InjectionCheck.html index 61c30d7..6972c36 100644 --- a/docs/interfaces/InjectionCheck.html +++ b/docs/interfaces/InjectionCheck.html @@ -1,10 +1,10 @@ InjectionCheck | predictionguard

    Interface InjectionCheck

    InjectionCheck represents an object that contains a check choice.

    -
    interface InjectionCheck {
        index: number;
        probability: number;
        status: string;
    }

    Properties

    interface InjectionCheck {
        index: number;
        probability: number;
        status: string;
    }

    Properties

    index: number

    index represents the index position in the collection for this checks.

    -
    probability: number

    probability represents the probability of a potential injection +

    probability: number

    probability represents the probability of a potential injection attack.

    -
    status: string

    status represents the status for this check.

    -
    \ No newline at end of file +
    status: string

    status represents the status for this check.

    +
    \ No newline at end of file diff --git a/docs/interfaces/ReplacePII.html b/docs/interfaces/ReplacePII.html index bd19a33..9260140 100644 --- a/docs/interfaces/ReplacePII.html +++ b/docs/interfaces/ReplacePII.html @@ -1,14 +1,14 @@ ReplacePII | predictionguard

    Interface ReplacePII

    ReplacePII represents an object that contains the result for the replacepi call.

    -
    interface ReplacePII {
        checks: ReplacePIICheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface ReplacePII {
        checks: ReplacePIICheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    Methods

    Properties

    checks: ReplacePIICheck[]

    checks represents the collection of checks to choose from.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/ReplacePIICheck.html b/docs/interfaces/ReplacePIICheck.html index ba48a7f..46e8291 100644 --- a/docs/interfaces/ReplacePIICheck.html +++ b/docs/interfaces/ReplacePIICheck.html @@ -1,9 +1,9 @@ ReplacePIICheck | predictionguard

    Interface ReplacePIICheck

    ReplacePIICheck represents an object that contains a check choice.

    -
    interface ReplacePIICheck {
        index: number;
        new_prompt: string;
        status: string;
    }

    Properties

    interface ReplacePIICheck {
        index: number;
        new_prompt: string;
        status: string;
    }

    Properties

    index: number

    index represents the index position in the collection for this checks.

    -
    new_prompt: string

    new_prompt represents the text with replaced personal information.

    -
    status: string

    status represents the status for this check.

    -
    \ No newline at end of file +
    new_prompt: string

    new_prompt represents the text with replaced personal information.

    +
    status: string

    status represents the status for this check.

    +
    \ No newline at end of file diff --git a/docs/interfaces/Toxicity.html b/docs/interfaces/Toxicity.html index ebf9fd8..5829ef2 100644 --- a/docs/interfaces/Toxicity.html +++ b/docs/interfaces/Toxicity.html @@ -1,14 +1,14 @@ Toxicity | predictionguard

    Interface Toxicity

    Toxicity represents an object that contains the result for the toxicity call.

    -
    interface Toxicity {
        checks: ToxicityCheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    interface Toxicity {
        checks: ToxicityCheck[];
        created: number;
        id: string;
        object: string;
        createdDate(): Date;
    }

    Properties

    Methods

    Properties

    checks: ToxicityCheck[]

    checks represents the collection of checks to choose from.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    object: string

    object represent the type of the result document.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    object: string

    object represent the type of the result document.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/ToxicityCheck.html b/docs/interfaces/ToxicityCheck.html index 1a11546..004bfb8 100644 --- a/docs/interfaces/ToxicityCheck.html +++ b/docs/interfaces/ToxicityCheck.html @@ -1,9 +1,9 @@ ToxicityCheck | predictionguard

    Interface ToxicityCheck

    ToxicityCheck represents an object that contains a check choice.

    -
    interface ToxicityCheck {
        index: number;
        score: number;
        status: string;
    }

    Properties

    interface ToxicityCheck {
        index: number;
        score: number;
        status: string;
    }

    Properties

    Properties

    index: number

    index represents the index position in the collection for this checks.

    -
    score: number

    score represents the score for the provided text.

    -
    status: string

    status represents the status for this check.

    -
    \ No newline at end of file +
    score: number

    score represents the score for the provided text.

    +
    status: string

    status represents the status for this check.

    +
    \ No newline at end of file diff --git a/docs/interfaces/Translate.html b/docs/interfaces/Translate.html index b96a6fd..b70c1d2 100644 --- a/docs/interfaces/Translate.html +++ b/docs/interfaces/Translate.html @@ -1,6 +1,6 @@ Translate | predictionguard

    Interface Translate

    Translate represents an object that contains the result for the translate call.

    -
    interface Translate {
        best_score: number;
        best_translation: string;
        best_translation_model: string;
        created: number;
        id: string;
        object: string;
        translations: Translation[];
        createdDate(): Date;
    }

    Properties

    interface Translate {
        best_score: number;
        best_translation: string;
        best_translation_model: string;
        created: number;
        id: string;
        object: string;
        translations: Translation[];
        createdDate(): Date;
    }

    Properties

    best_score: number

    best_score represents the best score for the best translation.

    -
    best_translation: string

    best_translation represents the best translation of the input text.

    -
    best_translation_model: string

    best_translation_model represents the model used for the best +

    best_translation: string

    best_translation represents the best translation of the input text.

    +
    best_translation_model: string

    best_translation_model represents the model used for the best translation.

    -
    created: number

    created represents the unix timestamp for when the request was +

    created: number

    created represents the unix timestamp for when the request was received.

    -
    id: string

    id represents a unique identifier for the result.

    -
    object: string

    object represent the type of the result document.

    -
    translations: Translation[]

    translations represents the collection of translations to choose from.

    -

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      -

      Returns Date

    \ No newline at end of file +
    id: string

    id represents a unique identifier for the result.

    +
    object: string

    object represent the type of the result document.

    +
    translations: Translation[]

    translations represents the collection of translations to choose from.

    +

    Methods

    • createdDate converts the created unix timestamp into a JS Date.

      +

      Returns Date

    \ No newline at end of file diff --git a/docs/interfaces/Translation.html b/docs/interfaces/Translation.html index 85eba35..f98824b 100644 --- a/docs/interfaces/Translation.html +++ b/docs/interfaces/Translation.html @@ -1,10 +1,10 @@ Translation | predictionguard

    Interface Translation

    Translation represents an object that contains a translation choice.

    -
    interface Translation {
        model: string;
        score: number;
        status: string;
        translation: string;
    }

    Properties

    interface Translation {
        model: string;
        score: number;
        status: string;
        translation: string;
    }

    Properties

    model: string

    model represents the model that was used for this translation.

    -
    score: number

    score represents the quality score for this translation.

    -
    status: string

    status represents the status of using the model for this translation.

    -
    translation: string

    translation represents the translation.

    -
    \ No newline at end of file +
    score: number

    score represents the quality score for this translation.

    +
    status: string

    status represents the status of using the model for this translation.

    +
    translation: string

    translation represents the translation.

    +
    \ No newline at end of file diff --git a/examples/chat.js b/examples/chat.js index 200ab00..d6e21cc 100644 --- a/examples/chat.js +++ b/examples/chat.js @@ -14,6 +14,7 @@ async function Chat() { maxTokens: 1000, temperature: 0.1, topP: 0.1, + topK: 50.0, options: { factuality: true, toxicity: true, diff --git a/examples/chat_sse.js b/examples/chat_sse.js index e394ef5..2b6ebe7 100644 --- a/examples/chat_sse.js +++ b/examples/chat_sse.js @@ -14,6 +14,7 @@ async function ChatSSE() { maxTokens: 1000, temperature: 0.1, topP: 0.1, + topK: 50.0, onMessage: function (event, err) { if (err != null) { if (err.error == 'EOF') { diff --git a/examples/chat_vision.js b/examples/chat_vision.js index d901d6c..7dbed45 100644 --- a/examples/chat_vision.js +++ b/examples/chat_vision.js @@ -12,6 +12,7 @@ async function ChatVision() { maxTokens: 1000, temperature: 0.1, topP: 0.1, + topK: 50.0, }; var [result, err] = await client.ChatVision(input); diff --git a/examples/completion.js b/examples/completion.js index 9df05b3..ae93646 100644 --- a/examples/completion.js +++ b/examples/completion.js @@ -9,6 +9,7 @@ async function Completions() { maxTokens: 1000, temperature: 0.1, topP: 0.1, + topK: 50.0, }; var [result, err] = await client.Completion(input); diff --git a/makefile b/makefile index 60006a5..dbcfd73 100644 --- a/makefile +++ b/makefile @@ -46,6 +46,7 @@ curl-chat: "max_tokens": 1000, \ "temperature": 1.1, \ "top_p": 0.1, \ + "top_k": 50.0, \ "output": { \ "factuality": true, \ "toxicity": true \ @@ -71,15 +72,19 @@ curl-chat-sse: "content": "How do you feel about the world in general" \ } \ ], \ - "stream": true \ + "stream": true, \ + "max_tokens": 300, \ + "temperature": 0.1, \ + "top_p": 0.1, \ + "top_k": 50.0 \ }' js-chat-sse: compile-ts node --env-file=.env examples/chat_sse.js curl-chat-vision: - curl -i -X POST https://staging.predictionguard.com/chat/completions \ - -H "x-api-key: ${PGKEYSTAGE}" \ + curl -i -X POST https://api.predictionguard.com/chat/completions \ + -H "x-api-key: ${PGKEY}" \ -H "Content-Type: application/json" \ -d '{ \ "model": "llava-1.5-7b-hf", \ @@ -101,7 +106,9 @@ curl-chat-vision: } \ ], \ "max_tokens": 300, \ - "temperature": 0.1 \ + "temperature": 0.1, \ + "top_p": 0.1, \ + "top_k": 50.0 \ }' js-chat-vision: compile-ts @@ -117,6 +124,7 @@ curl-comp: "max_tokens": 1000, \ "temperature": 1.1, \ "top_p": 0.1 \ + "top_k": 50.0 \ }' js-comp: compile-ts diff --git a/src/api_client.ts b/src/api_client.ts index 668c538..dee7f52 100644 --- a/src/api_client.ts +++ b/src/api_client.ts @@ -44,6 +44,7 @@ export class Client { * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, + * topK: 50.0, * options: { * factuality: true, * toxicity: true, @@ -106,12 +107,18 @@ export class Client { topP = input.topP; } + let topK = 0; + if (input.hasOwnProperty('topK')) { + topK = input.topK; + } + const m = new Map(); m.set('model', input.model); m.set('messages', input.messages); m.set('max_tokens', maxTokens); m.set('temperature', temperature); m.set('top_p', topP); + m.set('top_k', topK); if (input.hasOwnProperty('options')) { if (input.options.hasOwnProperty('factuality') || input.options.hasOwnProperty('toxicity')) { @@ -198,6 +205,7 @@ export class Client { * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, + * topK: 50.0, * onMessage: function (event, err) { * if (err != null) { * if (err.error == 'EOF') { @@ -259,12 +267,18 @@ export class Client { topP = input.topP; } + let topK = 0; + if (input.hasOwnProperty('topK')) { + topK = input.topK; + } + const body = { model: input.model, messages: input.messages, max_tokens: maxTokens, temperature: temperature, top_p: topP, + top_k: topK, stream: true, }; @@ -310,6 +324,7 @@ export class Client { * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, + * topK: 50.0, * }; * * var [result, err] = await client.ChatVision(input); @@ -370,6 +385,11 @@ export class Client { topP = input.topP; } + let topK = 0; + if (input.hasOwnProperty('topK')) { + topK = input.topK; + } + const [b64, err1] = await input.image.EncodeBase64(); if (err1 != null) { return [zero, err1]; @@ -397,6 +417,7 @@ export class Client { max_tokens: maxTokens, temperature: temperature, top_p: topP, + top_k: topK, }; const [result, err2] = await this.RawDoPost('chat/completions', body); @@ -433,6 +454,7 @@ export class Client { * maxTokens: 1000, * temperature: 0.1, * topP: 0.1, + * topK: 50.0, * }; * * var [result, err] = await client.Completion(input); @@ -488,12 +510,18 @@ export class Client { topP = input.topP; } + let topK = 0; + if (input.hasOwnProperty('topK')) { + topK = input.topK; + } + const body = { model: input.model, prompt: input.prompt, max_tokens: maxTokens, temperature: temperature, top_p: topP, + top_k: topK, }; const [result, err] = await this.RawDoPost('completions', body); diff --git a/src/api_model.ts b/src/api_model.ts index e8dc507..17f5f5a 100644 --- a/src/api_model.ts +++ b/src/api_model.ts @@ -171,6 +171,9 @@ export interface ChatInput { /** topP represents the diversity of the generated text. */ topP: number; + /** topK represents the variability of the generated text. */ + topK: number; + /** options represents a set of optional parameters. */ options: ChatInputOptions; } @@ -243,6 +246,9 @@ export interface ChatSSEInput { /** topP represents the diversity of the generated text. */ topP: number; + /** topK represents the variability of the generated text. */ + topK: number; + /** onMessage represents a function that will receive the messages. */ onMessage: (event: ChatSSE | null, err: Error | null) => void; } @@ -318,6 +324,9 @@ export interface ChatVisionInput { /** topP represents the diversity of the generated text. */ topP: number; + + /** topK represents the variability of the generated text. */ + topK: number; } /** ChatVisionMessage represents content for the vision call. */ @@ -386,6 +395,9 @@ export interface CompletionInput { /** topP represents the diversity of the generated text. */ topP: number; + + /** topK represents the variability of the generated text. */ + topK: number; } /** Choice represents an object that contains a result choice. */