Commit ec54a195 authored by Travis Fischer's avatar Travis Fischer

docs: simplify readme

parent c8d4e556
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
- [Auth](#auth) - [Auth](#auth)
- [Install](#install) - [Install](#install)
- [Usage](#usage) - [Usage](#usage)
- [Example](#example)
- [Docs](#docs) - [Docs](#docs)
- [Todo](#todo)
- [Related](#related) - [Related](#related)
- [License](#license) - [License](#license)
...@@ -47,10 +45,10 @@ import { ChatGPTAPI } from 'chatgpt' ...@@ -47,10 +45,10 @@ import { ChatGPTAPI } from 'chatgpt'
async function example() { async function example() {
const api = new ChatGPTAPI() const api = new ChatGPTAPI()
// open chromium and wait until the user has logged in // open chromium and wait until you've logged in
await api.init({ auth: 'blocking' }) await api.init({ auth: 'blocking' })
// send a message and wait for a complete response, then parse it as markdown // send a message and wait for the response
const response = await api.sendMessage( const response = await api.sendMessage(
'Write a python version of bubble sort. Do not include example usage.' 'Write a python version of bubble sort. Do not include example usage.'
) )
...@@ -82,14 +80,12 @@ def bubble_sort(lst): ...@@ -82,14 +80,12 @@ def bubble_sort(lst):
return lst return lst
``` ```
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: The default functionality parses ChatGPT responses as markdown using [html-to-md](https://github.com/stonehank/html-to-md). I've found that this works really well during my testing, but if you'd rather output plaintext, you can use:
```ts ```ts
const api = new ChatGPTAPI({ markdown: false }) const api = new ChatGPTAPI({ markdown: false })
``` ```
## Example
A full [example](./src/example.ts) is included for testing purposes: A full [example](./src/example.ts) is included for testing purposes:
``` ```
...@@ -100,12 +96,6 @@ npx tsx src/example.ts ...@@ -100,12 +96,6 @@ npx tsx src/example.ts
See the [auto-generated docs](./docs/classes/ChatGPTAPI.md) for more info on methods parameters. See the [auto-generated docs](./docs/classes/ChatGPTAPI.md) for more info on methods parameters.
## Todo
- [ ] Add message and conversation IDs
- [ ] Add support for streaming responses
- [ ] Add basic unit tests
## Related ## Related
- Inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross) - Inspired by this [Go module](https://github.com/danielgross/whatsapp-gpt) by [Daniel Gross](https://github.com/danielgross)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment