dify icon indicating copy to clipboard operation
dify copied to clipboard

The OPENAI_API_BASE environment variable only takes effect in the chat and model management, but does not take effect when text is vectorized.

Open wertycn opened this issue 3 years ago • 1 comments

Dify version: Self Host

Steps To Reproduce

Configuring the OPENAI_API_BASE variable only takes effect on the chat API, while the embeddings API still makes requests to api.openai.com.

The current behavior

The expected behavior

When text is vectorized, the progress remains at 0. Upon checking the work logs, the following error is shown.

[2023-06-02 17:16:00,124: WARNING/MainProcess] Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f6bf9f2f880>, 'Connection to api.openai.com timed out. (connect timeout=600)')': /v1/engines/text-embedding-ada-002/embeddings

wertycn avatar Jun 02 '23 18:06 wertycn

The issue has been resolved, and the OPENAI_API_BASE environment variable needs to be configured within the worker container as well.

wertycn avatar Jun 03 '23 02:06 wertycn