From 1386a39a4e4c4a4ed73f19f9357662feb72569a4 Mon Sep 17 00:00:00 2001 From: Travis Fischer Date: Fri, 2 Dec 2022 18:53:24 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- legacy/readme.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/legacy/readme.md b/legacy/readme.md index 4ab44d45..31738374 100644 --- a/legacy/readme.md +++ b/legacy/readme.md @@ -7,6 +7,7 @@ - [Intro](#intro) - [Auth](#auth) - [Usage](#usage) +- [Example](#example) - [Docs](#docs) - [Todo](#todo) - [Related](#related) @@ -43,7 +44,7 @@ async function example() { } ``` -Which outputs a similar reponse to the following (as a markdown string, including the _\`\`\`python_ code block prefix): +Which outputs a similar reponse to this (as a markdown string, including the _\`\`\`python_ code block prefix): ```python def bubble_sort(lst): @@ -67,12 +68,20 @@ def bubble_sort(lst): return lst ``` -Note that the default functionality is to parse ChatGPT responses as markdown using [html-to-md](https://github.com/stonehank/html-to-md). I've found the markdown quality to work really well in my testing, but if you'd rather output plaintext, you can use: +The default functionality is to parse ChatGPT responses as markdown using [html-to-md](https://github.com/stonehank/html-to-md). I've found the markdown parsing to work really well during my testing, but if you'd rather output plaintext, you can use: ```ts const api = new ChatGPTAPI({ markdown: false }) ``` +## Example + +A full example is included for testing purposes: + +``` +npx tsx src/example.ts +``` + ## Docs See the [auto-generated docs](./docs/classes/ChatGPTAPI.md) for more info on methods parameters.