Stypox / dicio-android

Dicio assistant app for Android
GNU General Public License v3.0
652 stars 64 forks source link

Opengptchat support #132

Open Tcache-Nukes opened 1 year ago

Tcache-Nukes commented 1 year ago

Can we use opengptchat API to make it smarter than things like siri and google. That would be so cool with intergration of openai.

MXC48-zz commented 1 year ago

Some time ago I had found a trick on GitHub which made it possible to "understand" the sentences for voice assistants It could allow you to free yourself from keywords to have more natural conversations

Stypox commented 1 year ago

I find this suggestion pretty interesting. In Dicio everything's set up to support a fallback skill when a user intent could not be interpreted by any skill. Currently the fallback skill just says "Sorry I could not understand". If there is an API we can integrate into Dicio without asking users to get developer keys in order to access ChatGPT it would be great. I don't know what the policy of ChatGPT is with regards to third party clients.

MXC48-zz commented 1 year ago

I find this suggestion pretty interesting. In Dicio everything's set up to support a fallback skill when a user intent could not be interpreted by any skill. Currently the fallback skill just says "Sorry I could not understand". If there is an API we can integrate into Dicio without asking users to get developer keys in order to access ChatGPT it would be great. I don't know what the policy of ChatGPT is with regards to third party clients.

https://openai.com/api/

Stypox commented 1 year ago

Yeah I know about that, the problem is I would need to obtain a developer key and then share it with everybody (since the app is FOSS), so people would easily steal it.

BrightDV commented 1 year ago

Maybe, you can create a file with your secrets which you uncheck from version control or use GitHub's secrets. However the build of F-Droid would not use it but you can specify it or do a separate build.

MXC48-zz commented 1 year ago

Otherwise there is a free and open source chatbot from which Dicio could draw inspiration to gain discussion skills https://olivia-ai.org/

Tcache-Nukes commented 1 year ago

Yeah I know about that, the problem is I would need to obtain a developer key and then share it with everybody (since the app is FOSS), so people would easily steal it.

We can let user handle it and give them options, if they want it put the dev API key of him. That way you dont have to worry about it. So bascally if i want that feature ill add my API Key and get it working.

Stypox commented 1 year ago

However the build of F-Droid would not use it but you can specify it or do a separate build.

I don't want to limit the F-Droid build. I'd rather do what Tcache-Nukes said.

Tcache-Nukes commented 1 year ago

However the build of F-Droid would not use it but you can specify it or do a separate build.

I don't want to limit the F-Droid build. I'd rather do what Tcache-Nukes said.

Sounds Good, i will look foward to test it. If you are gonna do that.

MXC48 commented 1 year ago

Otherwise there is another option to counterbalance open GPT which wants to be free free and open source, it's called open assistant it's free open source and it's under construction currently it requires data but it can be a good idea to do later https://github.com/LAION-AI/Open-Assistant

agsoto commented 1 year ago

Yeah I know about that, the problem is I would need to obtain a developer key and then share it with everybody (since the app is FOSS), so people would easily steal it.

What about allowing to the user to set the ChatGPT API token?, so everybody uses it's own account info.

Vintic commented 1 year ago

Hi, Please take a look at https://github.com/antimatter15/alpaca.cpp Would be cool to add support of it

jswetzen commented 1 year ago

I had an experiment with ChatGPT today, and used a starting prompt that gets it into a mode that I would find useful. Prompt

You will act as an API for a digital assistant, responding only with a JSON body containing two parameters: text and intent. The text parameter is for the English language response, and the intent is for an optional Android intent if the user requests something that can be sent to an android phone. The available intents are:

Setting a timer:
{
  "action": "android.intent.action.SET_TIMER",
  "extras": "android.intent.extra.alarm.LENGTH:{seconds},android.intent.extra.alarm.SKIP_UI:true"
}
where {seconds} shall be replaced with the requested time, converted to seconds.

Setting an alarm of some kind:
{
  "action": "android.intent.action.SET_ALARM",
  "extras": "android.intent.extra.alarm.HOUR:{hour},android.intent.extra.alarm.MINUTE:{minute},android.intent.extra.alarm.SKIP_UI:true"
}
where {hour} and {minute} shall be replaced with the hour and minute requested.

Begin. Your first request is "set a timer for five minutes"

Reply

{
"text": "Setting a timer for 5 minutes.",
"intent": {
"action": "android.intent.action.SET_TIMER",
"extras": "android.intent.extra.alarm.LENGTH:300,android.intent.extra.alarm.SKIP_UI:true"
}
}

Of course, I came to Dicio for the open source, so using the ChatGPT API would go against that. Interesting nonetheless.

Stypox commented 1 year ago

Yeah I also thought it would work with those kind of prompts

jswetzen commented 1 year ago

Open Assistant does well too! Reply (same prompt)

{"text":"Okay, I have set a timer for 5 minutes","intent":{"action":"android.intent.action.SET_TIMER",
"extras":"android.intent.extra.alarm.LENGTH:300,"android.intent.extra.alarm.SKIP_UI:true"}}

It's not perfect though, spot the error given the prompt "Wake me up at five fifteen tomorrow":

{"text":"I have scheduled an alarm for you to wake up at 5:15 AM tomorrow.",
"intent":{"action":"android.intent.action.SET_ALARM",
"extras":"android.intent.extra.alarm.HOUR:6,"android.intent.extra.alarm.MINUTE:15,"android.intent.extra.alarm.SKIP_UI:true"}}
RokeJulianLockhart commented 1 year ago

open-assistant.ai

@pixincreate, GitHub doesn't linkify domains – you need to prepend a protocol like https://.

paolo-caroni commented 4 months ago

I would like very much that, but gpt is closed source and honestly I would prefer an open alternative. So thanks to @pixincreate, also I have read on FAQ that open assistant can run on locale, so no problem for privacy.