mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-26 03:48:49 +02:00
Fix Type with new OpenAI Endpoint (#480)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import os
|
||||
from typing import Any
|
||||
from typing import cast
|
||||
|
||||
from langchain.chat_models.openai import ChatOpenAI
|
||||
|
||||
@@ -28,7 +29,8 @@ class OpenAIGPT(LangChainChatLLM):
|
||||
self._llm = ChatOpenAI(
|
||||
model=model_version,
|
||||
openai_api_key=api_key,
|
||||
openai_api_base=kwargs.get('endpoint', ''),
|
||||
# Prefer using None which is the default value, endpoint could be empty string
|
||||
openai_api_base=cast(str, kwargs.get("endpoint")) or None,
|
||||
max_tokens=max_output_tokens,
|
||||
temperature=temperature,
|
||||
request_timeout=timeout,
|
||||
|
Reference in New Issue
Block a user