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

[a58 bug] Azure OpenAI global variables passed via "--env-file" doesn't work correctly #2183

Open
msmygit opened this issue Jun 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@msmygit
Copy link
Contributor

msmygit commented Jun 15, 2024

Describe the bug
When we pass the global variables via a file which is then passed as python -m langflow run --env-file /path/to/.env command doesn't work and gives the following error:

ValueError: Error building vertex Azure OpenAI Embeddings: Could not connect to AzureOpenAIEmbeddings API.

Browser and Version
n/a

To Reproduce
Steps to reproduce the behavior:

  1. Choose the pre-built Vector Store RAG collection
  2. Replace Open AI embedding/model to Azure OpenAI equivalents
  3. Try to play and you should see errors.

FWIW, if you manually enter the Azure OpenAI values on the component, this works.

Screenshots
n/a

Additional context
n/a

@dosubot dosubot bot added the bug Something isn't working label Jun 15, 2024
Copy link

dosubot bot commented Jun 15, 2024

To resolve the issue of passing global variables via an environment file when using the Azure OpenAI service, ensure that your environment file (.env) includes all the necessary variables listed in the VARIABLES_TO_GET_FROM_ENVIRONMENT array. Here is an example of what your .env file should look like:

OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GOOGLE_API_KEY=your_google_api_key
AZURE_OPENAI_API_KEY=your_azure_openai_api_key
AZURE_OPENAI_API_VERSION=your_azure_openai_api_version
AZURE_OPENAI_API_INSTANCE_NAME=your_azure_openai_api_instance_name
AZURE_OPENAI_API_DEPLOYMENT_NAME=your_azure_openai_api_deployment_name
AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=your_azure_openai_api_embeddings_deployment_name
ASTRA_DB_APPLICATION_TOKEN=your_astra_db_application_token
ASTRA_DB_API_ENDPOINT=your_astra_db_api_endpoint
COHERE_API_KEY=your_cohere_api_key
HUGGINGFACEHUB_API_TOKEN=your_huggingfacehub_api_token
SEARCHAPI_API_KEY=your_searchapi_api_key
SERPAPI_API_KEY=your_serpapi_api_key
VECTARA_CUSTOMER_ID=your_vectara_customer_id
VECTARA_CORPUS_ID=your_vectara_corpus_id
VECTARA_API_KEY=your_vectara_api_key

Make sure that the .env file is correctly formatted and located in the directory where your application expects it. If the connection error persists, double-check that the values in the .env file are correct and that there are no typos or formatting issues [1].

To continue talking to Dosu, mention @dosu.

@msmygit msmygit changed the title [a58 bug] Azure OpenAI global variabled passed via "--env-file" doesn't work correctly [a58 bug] Azure OpenAI global variables passed via "--env-file" doesn't work correctly Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant