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

Add AZURE support #186

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

cristianorevil
Copy link

@cristianorevil cristianorevil commented Dec 14, 2023

This PR add the support for Azure OpenAI Services (Vision & DALLE-3)

Some considerations:

  • Azure parameters are managed only in .env file (not in web interface), I have updated the README file with instructions
  • On Azure the vision ad dalle-3 distributions must be in the same reource and same region
  • If in .env are present OPENAI and AZURE settings, OPENAI has the priority
  • The code probably need some refactor (i am not an high level python developer)

My tests with AZURE are ok, please test also OPENAI

Copy link
Contributor

sweep-ai bot commented Dec 14, 2023

Apply Sweep Rules to your PR?

  • Apply: All new business logic should have corresponding unit tests.
  • Apply: Refactor large functions to be more modular.
  • Apply: Add docstrings to all functions and file headers.


pprint_prompt(prompt_messages)

async def process_chunk(content: str):
pass

if not openai_api_key and not azure_openai_api_key:
raise Exception("OpenAI API or Azure key not found")

if not openai_api_key:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't you swap the condition with azure here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will check if there is one of two, is missing all raise exception (but maybe is better have 2 separate checks)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to rework this a bit today before merging.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR! Excited to get it in.

@aboutmydreams
Copy link

I just need it, thanks for the contribution

@wjurkowlaniec
Copy link

which works better, Azure or OpenAI?

@abi
Copy link
Owner

abi commented Dec 23, 2023

They are the same model. Should work the same.

@aboutmydreams
Copy link

which works better, Azure or OpenAI?

you can upload customized data and set api rate limit in Azure.

@thuzhf
Copy link

thuzhf commented Jan 9, 2024

Great! I just want to know when will this PR be merged...

@abi
Copy link
Owner

abi commented Jan 9, 2024

Sorry for the slowness (catching up after the holidays). Should be merged some time next week.

@thuzhf
Copy link

thuzhf commented Jan 19, 2024

Sorry for the slowness (catching up after the holidays). Should be merged some time next week.

@abi Will this be merged in this week? Waiting for using it...

@abi
Copy link
Owner

abi commented Jan 19, 2024

@thuzhf Azure GPT 4 Vision has low token limits per minute so this hasn't been a priority for me. Have you tried cloning cristianorevil:azure-support and using it directly? You don't need to wait for this to be merged in to use it.

@cobolbaby
Copy link

Since stream requests are already supported and the issue with token limitations has been somewhat improved, can we support Azure now?

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.

7 participants