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 latest Azure OpenAI models #988

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hui2000ji
Copy link

Currently, ChatHub does not support GPT4-1106-preview and other latest Azure OpenAI models.
I tried to use valid API keys for a GPT4-1106-preview deployment, but the model keeps saying that its knowledge cutoff is Sept 2021.

This commit contains modifications that switches the Azure OpenAI Completion API to the latest version. It also changes the name and the system message of the bot to match the GPT4-1106-preview version.

However, it is not suitable for directly merging yet. As Azure OpenAI now supports multiple models, it would be best if users can customize the model version and the system message.

@DmitriyAlergant-T1A
Copy link

Check your default "system" prompt, this is what tells it its model cutoff. You can change it in the extension's settings. The actual underlying model may be fine - check your OpenAI usage and billing page what are you getting billed for.

@hui2000ji
Copy link
Author

I am not billed by OpenAI. I am billed by Azure for using its Azure OpenAI Studio service.

This pull request mainly says that the current Azure API in ChatHub (api-version=2023-03-15-preview) is deprecated and needs an update. The latest version is 2024-02-15-preview, and the 2023-03-15-preview currently used by ChatHub will be retired after April 2, 2024.

Source: https://learn.microsoft.com/en-us/azure/ai-services/openai/reference

@@ -13,7 +13,7 @@ export class ChatGPTAzureApiBot extends AbstractChatGPTApiBot {
}

async fetchCompletionApi(messages: ChatMessage[], signal?: AbortSignal) {
const endpoint = `https://${this.config.azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${this.config.azureOpenAIApiDeploymentName}/chat/completions?api-version=2023-03-15-preview`
const endpoint = `https://${this.config.azureOpenAIApiInstanceName}.openai.azure.com/openai/deployments/${this.config.azureOpenAIApiDeploymentName}/chat/completions?api-version=2023-12-01-preview`

Choose a reason for hiding this comment

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

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.

3 participants