langchain如何支持自定义OpenAI地址

import os
import requests
import time
import json
import time
from langchain.llms import OpenAI
 
API_SECRET_KEY = "自定义key";
BASE_URL = "https://地址/v1(一定要有v1)"; #自定义OpenAI的base-url or api_url
 
os.environ["OPENAI_API_KEY"] = API_SECRET_KEY
os.environ["OPENAI_API_BASE"] = BASE_URL
 
def text():
    llm = OpenAI(temperature=0.9)
    text = "What would be a good company name for a company that makes colorful socks?"
    print(llm(text))
 
if __name__ == '__main__':
    text();

参考