Skip to content

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ardan-bkennedy committed May 30, 2024
1 parent e17974d commit 5d3eb4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ Take a look at the [examples](https://github.com/predictionguard/js-client/tree/

### Docs

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

[API Docs](https://docs.predictionguard.com/docs/getting-started/welcome)
[SDK Docs](https://predictionguard.github.io/js-client)

[API Reference](https://docs.predictionguard.com/api-reference/api-reference/check-api-health)
[PG API Docs](https://docs.predictionguard.com/docs/getting-started/welcome)

### Getting started

Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<pre><code class="language-js"><span class="hl-2">import</span><span class="hl-0"> </span><span class="hl-3">*</span><span class="hl-0"> </span><span class="hl-2">as</span><span class="hl-0"> </span><span class="hl-1">pg</span><span class="hl-0"> </span><span class="hl-2">from</span><span class="hl-0"> </span><span class="hl-4">&#39;predictionguard&#39;</span><span class="hl-0">;</span><br/><br/><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-5">client</span><span class="hl-0"> = </span><span class="hl-3">new</span><span class="hl-0"> </span><span class="hl-1">pg</span><span class="hl-0">.</span><span class="hl-1">chat</span><span class="hl-0">.</span><span class="hl-6">Client</span><span class="hl-0">(</span><span class="hl-4">&#39;https://api.predictionguard.com&#39;</span><span class="hl-0">, </span><span class="hl-1">process</span><span class="hl-0">.</span><span class="hl-1">env</span><span class="hl-0">.</span><span class="hl-5">PGKEY</span><span class="hl-0">);</span><br/><br/><span class="hl-3">async</span><span class="hl-0"> </span><span class="hl-3">function</span><span class="hl-0"> </span><span class="hl-6">Chat</span><span class="hl-0">() {</span><br/><span class="hl-0"> </span><span class="hl-3">const</span><span class="hl-0"> </span><span class="hl-5">input</span><span class="hl-0"> = [</span><br/><span class="hl-0"> {</span><br/><span class="hl-0"> </span><span class="hl-1">role:</span><span class="hl-0"> </span><span class="hl-1">pg</span><span class="hl-0">.</span><span class="hl-1">chat</span><span class="hl-0">.</span><span class="hl-1">Role</span><span class="hl-0">.</span><span class="hl-1">User</span><span class="hl-0">,</span><br/><span class="hl-0"> </span><span class="hl-1">content:</span><span class="hl-0"> </span><span class="hl-4">&#39;How do you feel about the world in general&#39;</span><span class="hl-0">,</span><br/><span class="hl-0"> },</span><br/><span class="hl-0"> ];</span><br/><br/><span class="hl-0"> </span><span class="hl-3">var</span><span class="hl-0"> [</span><span class="hl-1">result</span><span class="hl-0">, </span><span class="hl-1">err</span><span class="hl-0">] = </span><span class="hl-2">await</span><span class="hl-0"> </span><span class="hl-1">client</span><span class="hl-0">.</span><span class="hl-6">Chat</span><span class="hl-0">(</span><span class="hl-1">pg</span><span class="hl-0">.</span><span class="hl-1">chat</span><span class="hl-0">.</span><span class="hl-1">Model</span><span class="hl-0">.</span><span class="hl-1">NeuralChat7B</span><span class="hl-0">, </span><span class="hl-1">input</span><span class="hl-0">, </span><span class="hl-7">1000</span><span class="hl-0">, </span><span class="hl-7">1.1</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-2">if</span><span class="hl-0"> (</span><span class="hl-1">err</span><span class="hl-0"> != </span><span class="hl-3">null</span><span class="hl-0">) {</span><br/><span class="hl-0"> </span><span class="hl-1">console</span><span class="hl-0">.</span><span class="hl-6">log</span><span class="hl-0">(</span><span class="hl-4">&#39;ERROR:&#39;</span><span class="hl-0"> + </span><span class="hl-1">err</span><span class="hl-0">.</span><span class="hl-1">error</span><span class="hl-0">);</span><br/><span class="hl-0"> </span><span class="hl-2">return</span><span class="hl-0">;</span><br/><span class="hl-0"> }</span><br/><br/><span class="hl-0"> </span><span class="hl-1">console</span><span class="hl-0">.</span><span class="hl-6">log</span><span class="hl-0">(</span><span class="hl-4">&#39;RESULT:&#39;</span><span class="hl-0"> + </span><span class="hl-1">result</span><span class="hl-0">.</span><span class="hl-1">model</span><span class="hl-0"> + </span><span class="hl-4">&#39;: &#39;</span><span class="hl-0"> + </span><span class="hl-1">result</span><span class="hl-0">.</span><span class="hl-1">choices</span><span class="hl-0">[</span><span class="hl-7">0</span><span class="hl-0">].</span><span class="hl-1">message</span><span class="hl-0">.</span><span class="hl-1">content</span><span class="hl-0">);</span><br/><span class="hl-0">}</span><br/><br/><span class="hl-6">Chat</span><span class="hl-0">();</span>
</code><button>Copy</button></pre>
<p>Take a look at the <a href="https://github.com/predictionguard/js-client/tree/main/examples">examples</a> directory for more examples.</p>
<a id="md:docs" class="tsd-anchor"></a><h3><a href="#md:docs">Docs</a></h3><p>You can find the Prediction Guard API docs on the Prediction Guard website.</p>
<p><a href="https://docs.predictionguard.com/docs/getting-started/welcome">API Docs</a></p>
<p><a href="https://docs.predictionguard.com/api-reference/api-reference/check-api-health">API Reference</a></p>
<a id="md:docs" class="tsd-anchor"></a><h3><a href="#md:docs">Docs</a></h3><p>You can find the SDK and Prediction Guard docs using these links.</p>
<p><a href="https://predictionguard.github.io/js-client">SDK Docs</a></p>
<p><a href="https://docs.predictionguard.com/docs/getting-started/welcome">PG API Docs</a></p>
<a id="md:getting-started" class="tsd-anchor"></a><h3><a href="#md:getting-started">Getting started</a></h3><p>Once you have your api key you can use the <code>makefile</code> to run curl commands for the different api endpoints. For example, <code>make curl-injection</code> will connect to the injection endpoint and return the injection response. The <code>makefile</code> also allows you to run the different examples such as <code>make js-injection</code> to run the Go injection example.</p>
<p>** Running The Project**</p>
<p>You will need to node before you can run the project. You can follow this <a href="https://nodejs.org/en/download/package-manager">link</a> or use <a href="https://formulae.brew.sh/formula/node">brew</a> which is what I do.</p>
Expand Down

0 comments on commit 5d3eb4a

Please sign in to comment.