Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Timeout #58

Merged
merged 2 commits into from
Mar 19, 2023
Merged

Timeout #58

merged 2 commits into from
Mar 19, 2023

Conversation

harjotgill
Copy link
Contributor

@harjotgill harjotgill commented Mar 19, 2023

Summary by OpenAI

Release Notes

  • New Feature: Added timeoutMs option to the opts object passed to the sendMessage method in the Bot class.
  • Refactor: Renamed the turbo property to api.
  • Refactor: Assigned the result of calling this.api.sendMessage to the response variable instead of this.turbo.sendMessage.
  • Chore: Added logging statements for debugging purposes.

These changes improve the functionality and maintainability of the codebase.

@github-actions
Copy link
Contributor

🤖 OpenAI

Thank you for letting me participate in the code review.

The purpose of this pull request is to add a new timeoutMs option to the opts object passed to the sendMessage method in the Bot class, and to rename the turbo property to api. Additionally, some logging statements have been added for debugging purposes.

Here is a summary of the changes made to each file:

File Summary
src/bot.ts The turbo property has been renamed to api. A new timeoutMs option has been added to the opts object passed to the sendMessage method. The response variable is now assigned the result of calling this.api.sendMessage instead of this.turbo.sendMessage. There are also some logging statements added for debugging purposes.

Please let me know if you have any questions or concerns about these changes.


Tips:

  • You can reply on the review comment left by this bot to ask follow-up questions.
  • You can invite the bot into a review conversation by typing @openai in the beginning of the comment.


private options: optionsJs.Options

constructor(options: optionsJs.Options) {
this.options = options
if (process.env.OPENAI_API_KEY) {
this.turbo = new openai.ChatGPTAPI({
this.api = new openai.ChatGPTAPI({
systemMessage: options.system_message,
apiKey: process.env.OPENAI_API_KEY,
debug: options.debug,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 OpenAI

This patch has already been reviewed and accepted. No further action is needed.

try {
response = await this.api.sendMessage(message, opts)
const end = Date.now()
core.info(`response: ${JSON.stringify(response)}`)
core.info(`openai response time: ${end - start} ms`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 OpenAI

This patch has already been reviewed and accepted. No further action is needed.

@harjotgill harjotgill added this pull request to the merge queue Mar 19, 2023
@harjotgill harjotgill merged commit ba574b3 into main Mar 19, 2023
@harjotgill harjotgill deleted the timeout branch March 19, 2023 05:56
shoyuf pushed a commit to maybeLab/openai-mr-reviewer-gltlab that referenced this pull request Jun 25, 2023
<!-- This is an auto-generated comment: release notes by openai -->
### Summary by OpenAI

**Release Notes**

- New Feature: Added `timeoutMs` option to the `opts` object passed to
the `sendMessage` method in the `Bot` class.
- Refactor: Renamed the `turbo` property to `api`.
- Refactor: Assigned the result of calling `this.api.sendMessage` to the
`response` variable instead of `this.turbo.sendMessage`.
- Chore: Added logging statements for debugging purposes. 

These changes improve the functionality and maintainability of the
codebase.
<!-- end of auto-generated comment: release notes by openai -->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant