Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge chatgpt-api #847

Merged
merged 5 commits into from
Apr 2, 2023
Merged

Merge chatgpt-api #847

merged 5 commits into from
Apr 2, 2023

Conversation

RealTong
Copy link
Collaborator

@RealTong RealTong commented Apr 2, 2023

No description provided.

RealTong and others added 5 commits March 23, 2023 16:07
- Add GPT3Tokenizer library for tokenization
- Add a default response when GPT response is empty
- Add a check for blocked words in GPT response
- Change temperature parameter to `0.6`
- Add error handling for OpenAI API request
- Return OpenAI response as a string
- Add check for token limit before adding a user or assistant message
- Delete messages when token limit is exceeded

[src/utils.ts]
- Add the GPT3Tokenizer library for tokenization
- Add a function to calculate the number of tokens in a chat message
- Add a function to check if the number of tokens exceeds the limit for the current model
[src/bot.ts]
- Add a default response when the GPT response is empty
- Add a check for blocked words in the GPT response
[src/openai.ts]
- Change the temperature parameter to `0.6`
- Add error handling for the OpenAI API request
- Return the OpenAI response as a string
[package.json]
- Add `gpt3-tokenizer` package
[src/data.ts]
- Add a check for token limit before adding a user or assistant message
- Delete messages starting from the second one if token limit is exceeded
- Import `isTokenOverLimit` from `./utils.js`
- Remove initialization of `initState`
[package-lock.json]
- Add `gpt3-tokenizer` package
- Add `array-keyed-map` package
- Increase version of `dotenv` package
- Increase version of `openai` package
- Increase version of `google-protobuf` package
- Increase returned recordings from `10` to `100`
Support custom api

✅ Closes: #840
@RealTong RealTong merged commit 1ee9bb5 into main Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants