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

call gpt service #3850

Merged
merged 10 commits into from
Sep 11, 2023
Merged

call gpt service #3850

merged 10 commits into from
Sep 11, 2023

Conversation

yann300
Copy link
Contributor

@yann300 yann300 commented Jun 26, 2023

It adds 2 features:

  1. produce a solitiy error, in the solitiy plugin, check the error and click (ask gpt).
  2. in the settings, activate autocompletion, then right click in the body of a function and click either in "explain this function" or "generate documentation".

it can be called from a plugin using plugin.call('openaigpt', 'message', message)

@gitguardian
Copy link

gitguardian bot commented Jun 26, 2023

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
Once a secret has been leaked into a git repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

@netlify
Copy link

netlify bot commented Jun 26, 2023

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit 94f6958
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/64ff11bca0a1c400089297ee
😎 Deploy Preview https://deploy-preview-3850--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

})
).json()

console.log(result)
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove

).json()

console.log(result)
this.call('terminal', 'log', { type: 'typewritersuccess', value: result.choices[0].message.content })
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe check if the result has choices etc?

async message(prompt): Promise<CreateChatCompletionResponse> {
this.call('terminal', 'log', 'Waiting for GPT answer...')
const result = await (
await fetch('https://openai-gpt.remixproject.org', {
Copy link
Collaborator

Choose a reason for hiding this comment

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

need to handle fetch errors I think

@bunsenstraat
Copy link
Collaborator

when terminal is minimized it doesn't open it.

@yann300 yann300 added the ready-to-review PR ready to review label Aug 31, 2023
@yann300
Copy link
Contributor Author

yann300 commented Aug 31, 2023

when terminal is minimized it doesn't open it.

not sure I get what you mean...
I pushed the other comments.

@bunsenstraat
Copy link
Collaborator

when terminal is minimized it doesn't open it.

not sure I get what you mean... I pushed the other comments.

When you minimise the terminal and then call the gpt the results won't show unless you open the terminal again. would be confusing.

@yann300
Copy link
Contributor Author

yann300 commented Sep 11, 2023

when terminal is minimized it doesn't open it.

not sure I get what you mean... I pushed the other comments.

When you minimise the terminal and then call the gpt the results won't show unless you open the terminal again. would be confusing.

I just pushed a fix.

Copy link
Collaborator

@Aniket-Engg Aniket-Engg left a comment

Choose a reason for hiding this comment

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

This works fine.

But I think there should be improvement in UX to hightlight ASK GPT properly in compilation error card. That can come in a different PR.

@yann300 yann300 merged commit 3d98761 into master Sep 11, 2023
33 checks passed
@yann300 yann300 deleted the test_gpt branch September 11, 2023 16:00
@ryestew ryestew added the documentation-needed Documentation should be updated label Sep 20, 2023
@ryestew
Copy link
Collaborator

ryestew commented Sep 20, 2023

Documentation is needed both in the Remix-ide docs and the docs for plugins:
it can be called from a plugin using plugin.call('openaigpt', 'message', message)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation-needed Documentation should be updated ready-to-review PR ready to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants