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
defbubble_sort(lst):
...
...
@@ -67,12 +68,20 @@ def bubble_sort(lst):
returnlst
```
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
constapi=newChatGPTAPI({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.