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

Support custom openai compatible endpoints #18

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

raldone01
Copy link
Contributor

@raldone01 raldone01 commented Jul 14, 2024

Fixes: #16
Includes: #17

Adds German translations.
Should the UNIQUE_ID generation change for example when openai introduces a way to automatically discover all voices old entries should not be affected.
I put in a workaround for upgrades from old versions. Please test that old entries still work.

I can generate audio using openai and openedai-speech.
Both can be configured at the same time.

@raldone01 raldone01 force-pushed the feat/support_custom_endpoints branch from 94a2dba to 0460cd2 Compare July 14, 2024 13:57
@raldone01 raldone01 marked this pull request as ready for review July 14, 2024 14:00
@sfortis sfortis merged commit 537b576 into sfortis:main Jul 17, 2024
2 checks passed
@sfortis
Copy link
Owner

sfortis commented Jul 17, 2024

thanks @raldone01 , i dont have a local endpoint to test but seems good!

@raldone01
Copy link
Contributor Author

@sfortis would you be interested in a pull request to also add stt support?

@qJake
Copy link

qJake commented Jul 18, 2024

Yes! Thanks @sfortis - gonna try this out right now. Hoping that I can ditch my hacked custom component and just stick with this one!

@qJake
Copy link

qJake commented Jul 18, 2024

Oh no it doesn't work! 😥 I'll open a bug for it.

False alarm - used the wrong port number. Works great! Can't wait to see this in 2.4 😁

@sfortis
Copy link
Owner

sfortis commented Jul 19, 2024

@raldone01 actually i'm working (locally) on a STT component that is almost ready (works perfectly from android app, watch, esp32box3, still needs some work on optionflow). Since i want them separate, i'll create a new repo. What about working together on this?

@sfortis
Copy link
Owner

sfortis commented Jul 19, 2024

@qJake great! i'll drop a new release soon! did you spot any issues updating from the existing 2.3 on existing integrations?

I want to also merge a sound processing function using ffmpeg, to normalize, compress, and equalize the response audio so it is better audible on small speakers, like those in watches and esp32 devices. This will be parametrized in config flow/option flow.

@raldone01
Copy link
Contributor Author

@sfortis good that I asked then.
I can help you if you get stuck anywhere.

My plan was to just add a step to the config flow where one selects if a tts or stt device should be added.
Any reason why you want two integrations?
Quite a bit of code could be shared I think.
(If you really want two that's fine too.)

Have you thought about upstreaming the integration to core sometime in the future?
Core is currently working hard on assistants and they might be interested.

I would have used https://github.com/shiipou/openai_stt as the base.

@qJake
Copy link

qJake commented Jul 21, 2024

@qJake great! i'll drop a new release soon! did you spot any issues updating from the existing 2.3 on existing integrations?

I want to also merge a sound processing function using ffmpeg, to normalize, compress, and equalize the response audio so it is better audible on small speakers, like those in watches and esp32 devices. This will be parametrized in config flow/option flow.

I don't use the standard OpenAI TTS so I can't say, but so far all of my automations and TTS-related services appear to be fine!

@defaultsecurity
Copy link

@sfortis
Where can we configure the custom openai endpoint url?

I would like to use:
https://github.com/matatonic/openedai-speech

@defaultsecurity
Copy link

@sfortis Where can we configure the custom openai endpoint url?

I would like to use: https://github.com/matatonic/openedai-speech

Sorry, my bad. I have confused this integration with the OpenAI Conversation integration. Everything seems to be in order. Thank you for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Custom endpoint URL
4 participants