Skip to content

Commit

Permalink
Update Azure endpoint version to 2024-07-01-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mkht committed Aug 24, 2024
1 parent eaf2fb0 commit 572d27d
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions Private/Get-AzureOpenAIAPIEndpoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Get-AzureOpenAIAPIEndpoint {
)

$ApiVersion = $ApiVersion.Trim()
$DefaultApiVersion = '2024-05-01-preview'
$DefaultApiVersion = '2024-07-01-preview'

$UriBuilder = [System.UriBuilder]::new($ApiBase)
if ($UriBuilder.Path.StartsWith('//', [StringComparison]::Ordinal)) {
Expand All @@ -30,10 +30,11 @@ function Get-AzureOpenAIAPIEndpoint {
$UriBuilder.Path += ('/openai/deployments/{0}/chat/completions' -f $Engine.Replace('/', '').Trim())
$UriBuilder.Query = ('api-version={0}' -f $InnerApiVersion)
@{
Name = 'chat.completion'
Method = 'Post'
Uri = $UriBuilder.Uri
ContentType = 'application/json'
Name = 'chat.completion'
Method = 'Post'
Uri = $UriBuilder.Uri
ContentType = 'application/json'
BatchEndpoint = '/v1/chat/completions'
}
continue
}
Expand All @@ -42,10 +43,11 @@ function Get-AzureOpenAIAPIEndpoint {
$UriBuilder.Path += ('/openai/deployments/{0}/completions' -f $Engine.Replace('/', '').Trim())
$UriBuilder.Query = ('api-version={0}' -f $InnerApiVersion)
@{
Name = 'text.completion'
Method = 'Post'
Uri = $UriBuilder.Uri
ContentType = 'application/json'
Name = 'text.completion'
Method = 'Post'
Uri = $UriBuilder.Uri
ContentType = 'application/json'
BatchEndpoint = '/v1/completions'
}
continue
}
Expand Down Expand Up @@ -195,6 +197,17 @@ function Get-AzureOpenAIAPIEndpoint {
}
continue
}
'Batch' {
$InnerApiVersion = if ($ApiVersion) { $ApiVersion }else { $DefaultApiVersion }
$UriBuilder.Path += '/openai/batches'
@{
Name = 'batches'
Method = 'Post'
Uri = $UriBuilder.Uri
ContentType = 'application/json'
}
continue
}
'VectorStores' {
$InnerApiVersion = if ($ApiVersion) { $ApiVersion }else { $DefaultApiVersion }
$UriBuilder.Path += '/openai/vector_stores'
Expand Down

0 comments on commit 572d27d

Please sign in to comment.