Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
5.94k stars 4.08k forks source link

prepdocs.py: error: argument --openaiservice: expected one argument #680

Open engrharisijaz opened 1 year ago

engrharisijaz commented 1 year ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [X] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

azd auth login azd init -t azure-search-openai-demo azd env set OPENAI_HOST openai azd env set OPENAI_ORGANIZATION Linkers azd env set OPENAI_API_KEY sk-9B1oh0A8f7o2***** azd up

Any log messages given by the failure

Running "prepdocs.py" usage: prepdocs.py [-h] [--datalakestorageaccount DATALAKESTORAGEACCOUNT] [--datalakefilesystem DATALAKEFILESYSTEM] [--datalakepath DATALAKEPATH] [--datalakekey DATALAKEKEY] [--useacls] [--category CATEGORY] [--skipblobs] [--storageaccount STORAGEACCOUNT] [--container CONTAINER] [--storagekey STORAGEKEY] [--tenantid TENANTID] [--searchservice SEARCHSERVICE] [--index INDEX] [--searchkey SEARCHKEY] [--openaihost OPENAIHOST] [--openaiservice OPENAISERVICE] [--openaideployment OPENAIDEPLOYMENT] [--openaimodelname OPENAIMODELNAME] [--novectors] [--disablebatchvectors] [--openaikey OPENAIKEY] [--openaiorg OPENAIORG] [--remove] [--removeall] [--localpdfparser] [--formrecognizerservice FORMRECOGNIZERSERVICE] [--formrecognizerkey FORMRECOGNIZERKEY] [--verbose] [files] prepdocs.py: error: argument --openaiservice: expected one argument

Deploying services (azd deploy)

(✓) Done: Deploying service backend

image

OS and Version?

Windows 11

azd version?

azd version 1.3.1 (commit b5030da0f29ffe98664c40450187fd8a4cb0d157)

Mention any other details that might be useful

I am using non-Azure Open AI instance. The app get deployed by did not generate any response in chat or ask a question mode. Ask a questions also give an Error "No such organization: Linkers. " image

pamelafox commented 1 year ago

Could you go into scripts/prepdocs.ps1 and try making the change from:

--openaiservice $env:AZURE_OPENAI_SERVICE 

to:

--openaiservice `"$env:AZURE_OPENAI_SERVICE`"

And then re-run scripts/prepdocs.ps1 and see if you get the same error?

engrharisijaz commented 1 year ago

[Another error occured](prepdocs.py: error: argument --openaideployment: expected one argument)

So, similarly I have changed

--openaideployment $env:AZURE_OPENAI_EMB_DEPLOYMENT

to:

--openaideployment `"$env:AZURE_OPENAI_EMB_DEPLOYMENT`"

But still Error: No such organization: Linkers. image

pamelafox commented 1 year ago

cc @carlotta94c since this is related to non-Azure OpenAI deployment.

Can you set logging mode to debug in prepdocs.py?

logging.basicConfig(logging.DEBUG)

That will then show you the URL that OpenAI is trying to access, and you can compare that URL to what you expect it to be (perhaps in the OpenAI dashboard?). I don't have a non-Azure OpenAI account yet for replication.

gramster commented 1 year ago

--openaideployment `"$env:AZURE_OPENAI_EMB_DEPLOYMENT`"

Did you misstype that? As the quotes are mismatched.

pamelafox commented 1 year ago

No, that's apparently how Powershell escapes quotes? https://www.delftstack.com/howto/powershell/powershell-escape-single-and-double-quote/

pamelafox commented 1 year ago

@engrharisijaz I haven't seen the error "No such organization" before but I am assuming it comes from the OpenAI server not recognizing your organization. You can also print or log out what's being set on this line:

        openai.organization = args.openaiorg

And make sure it matches what's in your OpenAI account.

github-actions[bot] commented 10 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.