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

Make "Start Audio Recording" hotkey configurable #1263

Open
stephenrs opened this issue Aug 26, 2024 · 14 comments
Open

Make "Start Audio Recording" hotkey configurable #1263

stephenrs opened this issue Aug 26, 2024 · 14 comments
Labels
enhancement New feature or request frontend Pertains to the frontend.

Comments

@stephenrs
Copy link

Is your feature request related to a problem? Please describe.
Currently, the "p" key is mapped by default as a hotkey to start an audio recording. This results in an uncomfortable UX because "p" is a commonly typed character, and every time it is typed, the audio recording graphic pops up.

Describe the solution you'd like
It should be possible to change the hotkey mapping or disable this behavior completely in config.toml by adding a new config variable like "config.features.audio.hotkey_start". The variable should be optional and the behavior should be kept backward compatible by setting the default to "p" in config.py.

Describe alternatives you've considered

  1. Remove the line "useHotkeys('p', startRecording);" from MicButton/index.ts
  2. Make the default hotkey something less common, like "ctrl-p"

Additional context
I have a PR ready for this, tested on 1.1.402, but I can't fully test it until I have a working fork of 1.1.403rc0, see #1262

@dokterbob dokterbob added enhancement New feature or request frontend Pertains to the frontend. and removed needs-triage labels Aug 26, 2024
@dokterbob
Copy link
Collaborator

@stephenrs Thanks for the issue and looking forward to the PR.

Is it possible for you to do testing on this locally, e.g. without a gateway in front of it? That generally provides a more 'supported' scenario anyways.

In addition, I would love to see E2E coverage for this scenario.

@stephenrs
Copy link
Author

@dokterbob Seems like you're referring to what we're discussing on #1262, so I've replied there. Let me know if I've misunderstood.

This particular issue seems like a total production blocker to me though. Can't see why anyone would want to make their users suffer through dealing with the audio UI continually popping up while they are typing. I personally wouldn't, which is my selfish reason for fixing it while trying to help others :)

@puppetm4st3r
Copy link

same problem here, tested on ubuntu and macosx

@jdb78
Copy link
Contributor

jdb78 commented Sep 6, 2024

Same issue here - with copilot - can we add just a setting in the config to at least disable the hotkey if the audio functionality is not even implemented? There is no Microphone button but the 'p' key still triggers the microphone

@jdb78
Copy link
Contributor

jdb78 commented Sep 6, 2024

#1318

@stephenrs stephenrs changed the title Make "Start Audio Recording" hotkey configurable CRITICAL: Make "Start Audio Recording" hotkey configurable Sep 8, 2024
@stephenrs
Copy link
Author

stephenrs commented Sep 8, 2024

I changed the title because this issue makes CL unusable in production for end users, for anyone building a serious project.

If you're planning to use CL for customer support (which is marketed as its #1 use case), releasing it with this problem will almost guarantee that you get more CS requests and unhappy users, not less.

@puppetm4st3r
Copy link

puppetm4st3r commented Sep 9, 2024

temporal workarround (will disable audio feature), look at your index.js inside the

...../python3.10/site-packages/chainlit/copilot/dist/index.js 

(may be diferent in your environment but basically is where you have the chainlit package instaled)

open de index.js find the string qyt("p",i) and replace with /*qyt("p",i)*/

it would has to look like that after editing:
....,i=pt.useCallback(()=>{e||a(b)},[a,b,e]);/*qyt("p",i)*/;const w=p3(E=>E.breakpoints.down("sm"))?"small":"medium";return r!=null&&....

save, restart your app, force browser cache clean up and the problem will be gone.

@stephenrs
Copy link
Author

stephenrs commented Sep 9, 2024

Thanks @puppetm4st3r , and for anyone else who wants/needs this fixed, here's a second option...

I fixed this issue by splitting the copilot code out of the Chainlit project, modifying the source, rebuilding the UI, and serving the copilot/index.js file from a directory inside my app environment, rather than from the chanilit server. This requires a few more steps, but you won't have to modify your site-packages directory (in case you're not comfortable doing this).

This works better in my case, because it also will allow me to fix other problems or make adjustments to the UI.

You can see how to build the UI here: https://github.com/Chainlit/chainlit/blob/main/.github/CONTRIBUTING.md

I removed line 56 from frontend/src/components/organisms/chat/inputBox/MicButton/index.tsx, which looks like this:

useHotkeys('p', startRecording)

You can also remove the import at the top of the file if you don't plan to use the hotkey feature:

import { useHotkeys } from 'react-hotkeys-hook';

@dokterbob
Copy link
Collaborator

dokterbob commented Sep 10, 2024

Thanks for the report and feedback everyone. Would love if it you could quickly try @jdb78's branch, as I'm someone constraint on time over the coming weeks.

Small request to contributors: please refrain from claiming urgency or otherwise suggesting labels, particularly of the capitalized/SCREAMING kind, in issue names as it clutters the communications. It's quite challenging to do triage/prioritise, as it is! I consider it a courtesy or sign of respect not to feel pushed on this. While some things might seem objectively important to you, there might be other issues either on GH or elsewhere which (for perfectly valid reasons, like security) you might not be aware of.

I fixed this issue by splitting the copilot code out of the Chainlit project, modifying the source, rebuilding the UI, and serving the copilot/index.js file from a directory inside my app environment, rather than from the chanilit server. This requires a few more steps, but you won't have to modify your site-packages directory (in case you're not comfortable doing this).

I completely feel your pain here. I really really really want to get #1224 in ASAP as I feel it would unblock a lot of contributions.

@dokterbob dokterbob changed the title CRITICAL: Make "Start Audio Recording" hotkey configurable Make "Start Audio Recording" hotkey configurable Sep 10, 2024
@stephenrs
Copy link
Author

stephenrs commented Sep 11, 2024

@dokterbob One of the best ways to make sure that we don't feel we have to take steps to get your attention to critical issues is to give some indication you are paying attention to them and that you consider them a high priority. And since you have ignored every big picture question I've raised on various issues over the last several weeks, I would consider it a sign of courtesy and respect for you to stop ignoring my questions while simultaneously asking me to donate my time to your company.

Don't forget that I had a pull request ready to address this issue, but you have released 2 consecutive releases that were too broken to test my changes or to serve my use case. So this entire discussion is just a waste of all of our time, caused by you. Let me know if you disagree.

Another good way to eliminate the need to find ways to get your attention is to clarify what the roadmap vision is for this project. Then, it might not seem necessary to get your attention for issues that are indeed objectively critical for anyone building a serious project. Since as it says on your website: "Build production-ready Conversational AI applications in minutes, not weeks", or is that not the truth?

Is the audio UI popping open every time a user types "p" "production-ready" in your opinion Mathijs?

So, I might not be alone in encouraging you to stop whining about how hard things are for you and scolding members of the community because you don't like how they write issues. It would serve the community and produce less friction if you would just do your job and be grateful for all contributions that aim to serve the interests of the community.

I may continue to try to help the members of this community work around the critical issues that you are ignoring so they can move forward with their projects, but I have no interest in donating my time and skills to a VC-funded startup that behaves the way you do. So please stop asking. You raised funding to build a viable product, so build it.

Seems like maybe this project could use some adult supervision :)

@stephenrs
Copy link
Author

stephenrs commented Sep 12, 2024

Again silence from the Chainlit/LiteralAI team, which is no surprise, but it gives me no pleasure.

So, we can all see that the Chainlit team is not interested in discussing the serious and consequential questions surrounding the status of this project, or the serious problems that members of the community are having due to the critical issues that are not being addressed, or the major lies that are on their website. Instead, @dokterbob would prefer to prioritize discussing something as petty and inconsequential as his feelings about capitalized text and how hard it makes his life.

These guys appear to have a concept in their minds of how the world works that has no connection to the way the actual real world works. They also appear to be focused on themselves, not the community, as evidenced by the nearly 400 open issues that are not even being worked on. This project might be setting records for one of the most poorly supported projects on github.

In the real world, if you tell bold lies on your public website while expecting people to trust you with their sensitive LLM data, you are delusional. Do smart people trust liars?

In the real world, when your company achieves VC funding, the responsibility shifts to you to become accountable to and to support the community that helped you get there, not the other way around. These guys don't appear to understand this, so they continue to try to exploit free labor from this community while showing no signs of accountability or interest in helping community members move their projects forward.

Simply for context, because this is not about me, I've taken 3 successful tech startups from idea to market, mentored several others, and seen successes and failures. Success is always a direct function of the people involved. I'm genuinely sad to say that I personally would not invest in these people, they are demonstrably dishonest, lacking in professional integrity, and have not demonstrated a sense of accountability, as far as I can tell.

From what I've seen, my best guess is that they are in the process of quietly abandoning this project in its current form because their prototype is too far from being production-grade and widely adoptable. But they haven't told the community this because they like free labor.

@dokterbob @willydouhard @constantinidan, here's another opportunity to prove me wrong because I'm very happy for you to do so. It serves the interests of the project and the community for us all to be working from the same truth and the same set of facts. Working with a secret plan and ignoring important questions, while taking advantage of community contributions, raises serious questions. So, what's the plan guys?

Perhaps most importantly, what they are building is not hard enough to build, so I think it's safe to assume that other better options will continue to emerge from people who understand how important it is to work to earn trust.

So, perhaps the best thing that can happen for the health of this project is that someone with the time and talent forks it and prioritizes helping community members launch their production-grade projects in the short term. From what I can tell, the longer-term plan should be a complete redesign, including trashing 40-60% of the code base because it is useless clutter that only makes adoption and maintenance harder. Providing a smooth upgrade path for early adopters should be a high priority.

Making the difficult transition from coding in your bedroom to managing a business is where many startups fail. Coding and managing are two very very different things. So, I genuinely wish the Chainlit team the best in navigating this transition, but so far they do not appear to be on the right track.

Fortunately, they are finding this out early, as their cash burn seems to be just beginning, so maybe they have time to shift onto a more solid and trustworthy path, however, their lies and unkind exploitation of the community may follow them.

As always, I'm hoping for the best and I hope you can forgive my blunt honesty.

@dokterbob
Copy link
Collaborator

I'm sorry @stephenrs, I really feel your out of line here. We do not have time to keep reading such long posts, we are doing our best to support the community. Please try and be more respectful of our attention.

@stephenrs
Copy link
Author

stephenrs commented Sep 17, 2024

@dokterbob

Rather than scold me personally day after day, please speak to the points I've raised. You have consistently ignored what I've pointed out, and focused on me personally. This is not about me. It's about the dishonest, self-serving, unethical, and illegal way you have been running your company, and the impact this has had.

Please forget about me and focus on the facts and the open questions. The community deserves to know where you stand.

@stephenrs
Copy link
Author

stephenrs commented Sep 18, 2024

@dokterbob Well?

Is it "out of line" to lie to or mislead the public about a product?

Please don't waste any more of this community's time pointing your finger at me for speaking the truth when you have serious and legitimate questions to answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend Pertains to the frontend.
Projects
None yet
Development

No branches or pull requests

4 participants