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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/app/bots/chatgpt-azure/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.

return fetch(endpoint, {
method: 'POST',
signal,
Expand All @@ -29,6 +29,10 @@ export class ChatGPTAzureApiBot extends AbstractChatGPTApiBot {
}

get name() {
return `ChatGPT (azure/gpt-3.5)`
return `ChatGPT (azure/gpt-4-1106-preview)`
}

getSystemMessage() {
return `You are ChatGPT, a large language model trained by OpenAI. Answer as concisely as possible. Knowledge cutoff: 2023-04. Current date: {current_date}`
}
}