Because the api of a third-party service provider is used, the BASE_URL is changed.
export BASE_URL="https://aaa.bbb.ccc/"
However, it has not taken effect, and a 405 error code will be output in the console. By querying the API document, I learned that the third-party API and the API of Open AI are completely consistent.
The problem was discovered by observing the log in the project directory built by WareHouse.
When BASE_URL is not set, that is, under normal circumstances, the request address is
https://api.openai.com/v1/chat/completions
After setting BASE_URL, the request address changes to
https://aaa.bbb.ccc/chat/completions
The v1 part is missing in the middle. In order to verify this guess, I made the following modifications
export BASE_URL="https://aaa.bbb.ccc/v1"
Smooth execution
Because the api of a third-party service provider is used, the BASE_URL is changed.
export BASE_URL="https://aaa.bbb.ccc/"
However, it has not taken effect, and a 405 error code will be output in the console. By querying the API document, I learned that the third-party API and the API of Open AI are completely consistent. The problem was discovered by observing the log in the project directory built by WareHouse. When BASE_URL is not set, that is, under normal circumstances, the request address ishttps://api.openai.com/v1/chat/completions
After setting BASE_URL, the request address changes tohttps://aaa.bbb.ccc/chat/completions
The v1 part is missing in the middle. In order to verify this guess, I made the following modificationsexport BASE_URL="https://aaa.bbb.ccc/v1"
Smooth execution