OkGoDoIt / OpenAI-API-dotnet

An unofficial C#/.NET SDK for accessing the OpenAI GPT-3 API
https://www.nuget.org/packages/OpenAI/
Other
1.83k stars 427 forks source link

Custom commands to ChatGPT, such as 'Send Email' #131

Open PHOLAN opened 1 year ago

PHOLAN commented 1 year ago

When receiving a response to a command such as "Send an email to 'pholan@xxxxx.com' with Subject 'Hello' and Content 'Test'"using CreateChatCompletionAsync, the response received is "Dear pholan@hotmail.com,I hope this email finds you well. I am writing to say hello and to test if this email address is working properly..."

How can I identify in my code that I should call my code for sending an email? Then OpenAI API mentions a way to pass parameters with the request that would help me identify the request type, such as "Send Email". Is this implemented? Is there another way of achieving this?

Thanks

DmitryBorodiy commented 1 year ago

I have the same question...

winzig commented 1 year ago

chatGPT is a generative AI API. You send it text, and it sends back text in response.

It doesn't send emails, so can you clarify what you are talking about?

DmitryBorodiy commented 1 year ago

chatGPT is a generative AI API. You send it text, and it sends back text in response.

It doesn't send emails, so can you clarify what you are talking about?

Perhaps he wanted to ask how to add special commands or train chat commands that could have event handling. For example, if a person asks to send a message by mail, then along with the chat response, the corresponding event was somehow processed. I think that the assistant can somehow be trained to respond to commands, generating an argument along with the answer, in which it can be indicated, for example The email address where you want to send the message. Then you can check the argument and extract the necessary data from it or perform some kind of action.

winzig commented 1 year ago

Best bet there would likely be to write a chatGPT plugin https://openai.com/blog/chatgpt-plugins

DmitryBorodiy commented 1 year ago

Best bet there would likely be to write a chatGPT plugin https://openai.com/blog/chatgpt-plugins

As a developer of this library, you can make it so that there is some kind of mechanism or opportunity to train the assistant to open URLs. Thus, you can add an event handler to the chat that will be triggered if the bot tries to open the link. Using the handler argument, you could get the link that the bot wants to open. For example, if a person says, write a message, developers will use the mailto: link, and already in this very event handler do something with this link.