Conversation
| String qaStreamedBody(String context, List<Message> chatHistory) { | ||
| String qaStreamedBody(String personality, String context, List<Message> chatHistory) { | ||
| var prompt = ''' | ||
| This is your personality, you should try to answer in this style: $personality |
There was a problem hiding this comment.
Can we do this part of the prompt optional?
| ); | ||
| } | ||
|
|
||
| // FIXME: only supports 1 active plugin. When multiple are active uses the first one |
There was a problem hiding this comment.
nice, is there a way we could have a selector on the chat page so people can select which plugin to chat, maybe like a floating dropdown top right or smth
There was a problem hiding this comment.
I don't get why more than one plugin can be active at a time. It makes more sense to only allow 1 plugin active. Also for the memories. Is there a reason several plugins can be active simultaneously?
There was a problem hiding this comment.
Ideally plugins are used only whenever they are useful, so if you are having a medical conversation, it uses x plugin, entrepreneurship, but that requires better plugin prompt, maybe you could take a look so we filter out useless plugins per memory. It's complex to expect the user will remind before every conversation what plugin they might need, so if you activate many you are set and forget
There was a problem hiding this comment.
btw, how can I find you on discord? would love to chat
There was a problem hiding this comment.
for the multiple plugin case. We can pass all personalities to the system prompt and ask the LLM to choose which one is most relevant for the current conversation. This will fulfill the promise to the user they don't have to remember turning plugins on and off. They choose what they want, and chat layer is flexible enough to understand and adapt. Reduces strain on what is asked by us from the user improving overall UX.
I still think we should limit how many plugins are active at the same time. The more active plugins the more chances of this failing/confusing the LLM. As a measure for now we can limit active plugins to 5.
|
Looking great so far! |
|
I am removing BLE scan by name even though it's out out of scope of this PR as we identified here this change was undone #225 (comment) |
|
Alright this is ready to review @josancamon19 I tested with a single and multiple plugins. I tested the Paul Graham plugin together with other two and asked questions from my memories about neural networks and seems that it selected the right plugin in chat, and the right memory. Now that being said chat will only be as good with plugins if the plugin prompts are well written. The example here is not great for the purpose of steering behavior in a conversation. The prompt is good for generating memories but not so much for driving the personality of the conversation. I see two options.
The prompt itself gives instructions on how to process memories not in how to behave the conversation. LLMs can infer what you mean, but it will drive their behavior stronger if they are actually given a personality based on those instructions. |
|
Will review today @diegoasua |
| Future<List<BTDeviceStruct?>> scanDevices() async { | ||
| List<BTDeviceStruct> foundDevices = await bleFindDevices(); | ||
| var filteredDevices = foundDevices.where((device) => device.name == "Friend").toList(); | ||
| // var filteredDevices = foundDevices.where((device) => device.name == "Friend").toList(); |
There was a problem hiding this comment.
What is the purpose of this change?
There was a problem hiding this comment.
This would show all ble available devices right? as far as I understand, if both options work, why to do it like this is what I don't understand
There was a problem hiding this comment.
No it will not show all BLE devices. If the device is named different from "Friend" it will not show up. When that line is active it is filtering BLE devices by name. It will go through the onboarding screen with a real device as long as its name is "Friend" but not with a simulator. Recently we stopped filtering devices by name and use UUID instead. So this line is not only unnecessary but also prevents us from pairing a simulator.
See #225 (comment)
| await streamApiResponse(ragContext, _callbackFunctionChatStreaming(memoryIds), widget.messages, () { | ||
| widget.messages.last.memoryIds = memoryIds; | ||
| prefs.chatMessages = widget.messages; | ||
| // await streamApiResponse(ragContext, _callbackFunctionChatStreaming(memoryIds), widget.messages, () { |
There was a problem hiding this comment.
To be clear, you mean remove the commented out part?
| } | ||
|
|
||
| String qaStreamedBody(String context, List<Message> chatHistory) { | ||
| String qaStreamedBody(dynamic personality, String context, List<Message> chatHistory) { |
There was a problem hiding this comment.
For now let's use the description as their personality and reformat the plugins so the description has this personality (ish).
|
Also, let's add on chat a plugin selector. Basically, there'd be one of the plugins to select, in a dropdown in the chat in some way, but not automatically, initially let's do it like this, and see how people interact with it |
|
Alright now there is a dropdown in chat that lets you choose which personality to chat with from the list of downloaded plugins. you can only choose one. Give it a spin and let me know. I have only tested it in iOS so it would be good if someone can give it a go in Android too. @josancamon19 ready for review |
| Future<List<BTDeviceStruct?>> scanDevices() async { | ||
| List<BTDeviceStruct> foundDevices = await bleFindDevices(); | ||
| var filteredDevices = foundDevices.where((device) => device.name == "Friend").toList(); | ||
| // var filteredDevices = foundDevices.where((device) => device.name == "Friend").toList(); |
There was a problem hiding this comment.
This would show all ble available devices right? as far as I understand, if both options work, why to do it like this is what I don't understand
| } | ||
|
|
||
| String qaStreamedBody(String context, List<Message> chatHistory) { | ||
| String qaStreamedBody( |
There was a problem hiding this comment.
This would show all ble available devices right? as far as I understand, if both options work, why to do it like this is what I don't understand
I answered this above but I want to make sure this is clear, so copy pasting the response here again:
No it will not show all BLE devices. If the device is named different from "Friend" it will not show up. When that line is active it is filtering BLE devices by name. It will go through the onboarding screen with a real device as long as its name is "Friend" but not with a simulator. Recently we stopped filtering devices by name and use UUID instead. So this line is not only unnecessary but also prevents us from pairing a simulator.
See #225 (comment)
There was a problem hiding this comment.
re: linting
ack that will apply that rule
There was a problem hiding this comment.
I wanted to add, Dart docs suggests we should not use more than 80 characters per line as it affects readability.
| @@ -14,6 +14,8 @@ import 'package:friend_private/backend/preferences.dart'; | |||
| import 'package:friend_private/pages/chat/widgets/ai_message.dart'; | |||
There was a problem hiding this comment.
This should be a dropdown that goes on the Appbar only when chat page is selected.
No bottom sheet, a dropdown.
It should contain the plugin name + plugin picture.
It should look good, and match the current design.
When there are no plugins enabled it should have that default dropdown item, and a 2nd one with enable plugins click, that opens the plugins page.
There was a problem hiding this comment.
sounds good. I appreciate these more clear deliverables. They guide development better
|
ready for another round of reviews @josancamon19 . What's new:
|
| ), | ||
| ), | ||
| // Text(['Memories', 'Device', 'Chat'][_selectedIndex]), | ||
| if (_controller!.index == 2) |
There was a problem hiding this comment.
This looks bad, I don't see how this fits with current designs besides de border gradient.
And let's please remove the padding GPT comments.
Put this in a separate widget.
Finally, please put this component in a separate function, could be inside same file.
Remove the "Default" and put only "View Plugins"
Also, messages answered with plugin personality should have the plugin id as optional field in db, and instead of the message sender icon we have on the left of ai message it should use the plugin image as the sender.
There was a problem hiding this comment.
Please explain how you want the widget to look like. If you don't set specific deliverables I don't know what you want. You say it looks ugly and doesn't fit in current app designs. Is it the font? Spacing? Size? Palette? I can iterate on it but I need to know what you want. Otherwise this is not going to work. Please advise
|
Closing PR, as I don't see significant progress, and reassigning ticket. |

First take at integrating plugins into chat.