Skip to content

Commit

Permalink
Few minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
dkotter committed Feb 13, 2024
1 parent 0f0c173 commit 633179b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions includes/Classifai/Providers/Azure/OpenAI.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,9 @@ protected function prep_api_url( \Classifai\Features\Feature $feature = null ):
( $feature instanceof ContentResizing ||
$feature instanceof ExcerptGeneration ||
$feature instanceof TitleGeneration ) &&
! empty( $deployment )
$deployment
) {
$endpoint = trailingslashit( $endpoint ) . $this->chat_completion_url;
$endpoint = str_replace( '{deployment-id}', $deployment, $endpoint );
$endpoint = trailingslashit( $endpoint ) . str_replace( '{deployment-id}', $deployment, $this->chat_completion_url );
$endpoint = add_query_arg( 'api-version', $this->chat_completion_api_version, $endpoint );
}

Expand All @@ -268,8 +267,7 @@ protected function prep_api_url( \Classifai\Features\Feature $feature = null ):
protected function authenticate_credentials( string $url, string $api_key, string $deployment ) {
$rtn = false;

$endpoint = trailingslashit( $url ) . $this->completion_url;
$endpoint = str_replace( '{deployment-id}', $deployment, $endpoint );
$endpoint = trailingslashit( $url ) . str_replace( '{deployment-id}', $deployment, $this->chat_completion_url );
$endpoint = add_query_arg( 'api-version', $this->completion_api_version, $endpoint );

$request = wp_remote_post(
Expand Down

0 comments on commit 633179b

Please sign in to comment.