Closes#32. Enable Users / Deployments to change the host where
OpenAI API calls are directed to. This enables project like
[Helicone](https://www.helicone.ai/) (Observability of LLM ops)
for tracking prompt/responses quality in real-time.
Configuration:
- User: App > Settings > Advanced > API host (e.g. "oai.hconeai.com")
- Deployment: set the 'API_API_HOST=...' environment variable
User takes precedence over deployment over api.openai.com. Realtime
switching in chat apps works well.
Note: the Helicone team is fixing dashboard reporting for 'streaming'
over the /v1/chat/completions endpoint.
The package makes the App slower to load, and I am not
aware of people using the Code
Execution feature
If someone still wants it, we can quickly revert
this commit and add it back (or you can use an older
official/preview build on Vercel)
Adapt speech recognition to begin as 'false' and dynamically update state.
UX: the button can now be dynamic (no hydration issues). Differentiated
mobile vs desktop look.
I need to use the 'useCallback' function to pass the onResult callback,
otherwise the code loops (as the callback function will get recreated
every time, and it's circular).
The keys are stored within the localStorage of the browser.
The string is passed to the backend as a parameter in the REST
API call (to '/api/chat'), where it has priority over other
keys set in the OPENAI_API_KEY of the backend.