-
Notifications
You must be signed in to change notification settings - Fork 1k
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
call gpt service #3850
Conversation
️✅ 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. 🦉 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. |
✅ Deploy Preview for remixproject ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
}) | ||
).json() | ||
|
||
console.log(result) |
There was a problem hiding this comment.
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 }) |
There was a problem hiding this comment.
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', { |
There was a problem hiding this comment.
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
when terminal is minimized it doesn't open it. |
not sure I get what you mean... |
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. |
There was a problem hiding this 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.
d49271b
to
94f6958
Compare
Documentation is needed both in the Remix-ide docs and the docs for plugins: |
It adds 2 features:
it can be called from a plugin using
plugin.call('openaigpt', 'message', message)