jekalmin / extended_openai_conversation

Home Assistant custom component of conversation agent. It uses OpenAI to control your devices.
906 stars 127 forks source link

Organization Header #100

Open TheLolkPlays opened 8 months ago

TheLolkPlays commented 8 months ago

Hi, i don't know how everyone uses API organizations, but theoretically I don't believe there would be any issues using different models as long as your subscription allows it. I don't know if there is a way to do this, but it would be verry nice to be able to add the OpenAI-Organization header in the API calls. https://platform.openai.com/docs/api-reference/organization-optional The only settings I can see are the following: image

An example of usage would be to use 3.5 turbo with personal subscription but gpt-4-1106-preview with a subsctiption?

a-d-r-i-a-n-d commented 8 months ago

You can change the model in Conversation agent setting after the installation.

Screenshot 2024-01-15 at 13 04 48
TheLolkPlays commented 8 months ago

Hey @a-d-r-i-a-n-d, I was not referring to the model :) I was referring to the thought when you have multiple assistants and use multiple models and might want to choose which consumption subscription it uses. Some people might have personal and or organizational consumptions.

This is done rather easily: curl https://api.openai.com/v1/models \ -H "Authorization: Bearer $OPENAI_API_KEY" \ -H "OpenAI-Organization: org-oDeZSVdysKnWSDbAiZ0ACGqK"

https://platform.openai.com/docs/api-reference/organization-optional

However having an optional option to set this would be nice

jekalmin commented 8 months ago

Thanks for reporting an issue.

It would be nice to add an optional parameter, organization. I will work on it soon.

jekalmin commented 7 months ago

organization is now added in 1.0.3-beta1. Please try it and give a feedback.

1