diff --git a/scripts/prepdocs.ps1 b/scripts/prepdocs.ps1 index 46d7f7d005..c58b8cc9dd 100755 --- a/scripts/prepdocs.ps1 +++ b/scripts/prepdocs.ps1 @@ -66,9 +66,9 @@ if ($env:USE_FEATURE_INT_VECTORIZATION) { } if ($env:AZURE_OPENAI_API_KEY) { - $openaiApiKey = $env:AZURE_OPENAI_API_KEY -} else { - $openaiApiKey = $env:OPENAI_API_KEY + $openaiApiKeyArg = "--openaikey $env:AZURE_OPENAI_API_KEY" +} elseif ($env:OPENAI_API_KEY) { + $openaiApiKeyArg = "--openaikey $env:OPENAI_API_KEY" } $cwd = (Get-Location) @@ -81,8 +81,8 @@ $argumentList = "./app/backend/prepdocs.py $dataArg --verbose " + ` "$searchAnalyzerNameArg " + ` "--openaihost `"$env:OPENAI_HOST`" --openaimodelname `"$env:AZURE_OPENAI_EMB_MODEL_NAME`" $openaiDimensionsArg " + ` "--openaiservice `"$env:AZURE_OPENAI_SERVICE`" --openaideployment `"$env:AZURE_OPENAI_EMB_DEPLOYMENT`" " + ` -"--openaicustomurl `"$env:OPENAI_CUSTOM_URL`" " + ` -"--openaikey `"$env:OPENAI_API_KEY`" --openaiorg `"$env:OPENAI_ORGANIZATION`" " + ` +"--openaicustomurl `"$env:AZURE_OPENAI_CUSTOM_URL`" " + ` +"$openaiApiKeyArg --openaiorg `"$env:OPENAI_ORGANIZATION`" " + ` "--documentintelligenceservice $env:AZURE_DOCUMENTINTELLIGENCE_SERVICE " + ` "$searchImagesArg $visionEndpointArg " + ` "$adlsGen2StorageAccountArg $adlsGen2FilesystemArg $adlsGen2FilesystemPathArg " + ` diff --git a/scripts/prepdocs.sh b/scripts/prepdocs.sh index 03150680fc..58f161ee33 100755 --- a/scripts/prepdocs.sh +++ b/scripts/prepdocs.sh @@ -64,9 +64,9 @@ if [ -n "$USE_FEATURE_INT_VECTORIZATION" ]; then fi if [ -n "$AZURE_OPENAI_API_KEY" ]; then - openAiApiKeyArg="$AZURE_OPENAI_API_KEY" + openAiApiKeyArg="--openaikey $AZURE_OPENAI_API_KEY" elif [ -n "$OPENAI_API_KEY" ]; then - openAiApiKeyArg="$OPENAI_API_KEY" + openAiApiKeyArg="--openaikey $OPENAI_API_KEY" fi ./.venv/bin/python ./app/backend/prepdocs.py './data/*' --verbose \ @@ -77,7 +77,7 @@ $searchAnalyzerNameArg \ --openaihost "$OPENAI_HOST" --openaimodelname "$AZURE_OPENAI_EMB_MODEL_NAME" $openAiDimensionsArg \ --openaiservice "$AZURE_OPENAI_SERVICE" --openaideployment "$AZURE_OPENAI_EMB_DEPLOYMENT" \ --openaicustomurl "$AZURE_OPENAI_CUSTOM_URL" \ ---openaikey $openAiApiKeyArg --openaiorg "$OPENAI_ORGANIZATION" \ +$openAiApiKeyArg --openaiorg "$OPENAI_ORGANIZATION" \ --documentintelligenceservice "$AZURE_DOCUMENTINTELLIGENCE_SERVICE" \ $searchImagesArg $visionEndpointArg \ $adlsGen2StorageAccountArg $adlsGen2FilesystemArg $adlsGen2FilesystemPathArg \