Ability to provide different base URL for the open AI LLM endpoint (#475)

This commit is contained in:
Rajeesh 2023-09-26 04:07:07 +10:00 committed by GitHub
parent 8b95e2631d
commit 0c3ecbfa2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,9 +24,11 @@ class OpenAIGPT(LangChainChatLLM):
# server from starting up
if not api_key:
api_key = os.environ.get("OPENAI_API_KEY") or "dummy_api_key"
self._llm = ChatOpenAI(
model=model_version,
openai_api_key=api_key,
openai_api_base=kwargs.get('endpoint', ''),
max_tokens=max_output_tokens,
temperature=temperature,
request_timeout=timeout,