Update BaiduQianfanChatModel and OpenAIModel configurations
This commit is contained in:
parent
45b9141adb
commit
ff3bf645fd
2 changed files with 10 additions and 15 deletions
|
|
@ -43,17 +43,15 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
|||
"AquilaChat-7B",
|
||||
],
|
||||
"info": "https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint",
|
||||
"required": True,
|
||||
"value": "ERNIE-Bot-turbo",
|
||||
},
|
||||
"qianfan_ak": {
|
||||
"display_name": "Qianfan Ak",
|
||||
"required": True,
|
||||
"password": True,
|
||||
"info": "which you could get from https://cloud.baidu.com/product/wenxinworkshop",
|
||||
},
|
||||
"qianfan_sk": {
|
||||
"display_name": "Qianfan Sk",
|
||||
"required": True,
|
||||
"password": True,
|
||||
"info": "which you could get from https://cloud.baidu.com/product/wenxinworkshop",
|
||||
},
|
||||
|
|
@ -98,9 +96,9 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
|||
def build(
|
||||
self,
|
||||
input_value: Text,
|
||||
model: str = "ERNIE-Bot-turbo",
|
||||
qianfan_ak: Optional[str] = None,
|
||||
qianfan_sk: Optional[str] = None,
|
||||
qianfan_ak: str,
|
||||
qianfan_sk: str,
|
||||
model: str,
|
||||
top_p: Optional[float] = None,
|
||||
temperature: Optional[float] = None,
|
||||
penalty_score: Optional[float] = None,
|
||||
|
|
|
|||
|
|
@ -29,30 +29,28 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
"max_tokens": {
|
||||
"display_name": "Max Tokens",
|
||||
"advanced": True,
|
||||
"required": False,
|
||||
},
|
||||
"model_kwargs": {
|
||||
"display_name": "Model Kwargs",
|
||||
"advanced": True,
|
||||
"required": False,
|
||||
},
|
||||
"model_name": {
|
||||
"display_name": "Model Name",
|
||||
"advanced": False,
|
||||
"required": False,
|
||||
"options": [
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-3.5-turbo",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4-vision-preview",
|
||||
"gpt-3.5-turbo-0125",
|
||||
"gpt-3.5-turbo-1106",
|
||||
],
|
||||
"value": "gpt-4-turbo-preview",
|
||||
},
|
||||
"openai_api_base": {
|
||||
"display_name": "OpenAI API Base",
|
||||
"advanced": True,
|
||||
"required": False,
|
||||
"info": (
|
||||
"The base URL of the OpenAI API. Defaults to https://api.openai.com/v1.\n\n"
|
||||
"You can change this to use other APIs like JinaChat, LocalAI and Prem."
|
||||
|
|
@ -60,14 +58,13 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
},
|
||||
"openai_api_key": {
|
||||
"display_name": "OpenAI API Key",
|
||||
"info": "The OpenAI API Key to use for the OpenAI model.",
|
||||
"advanced": False,
|
||||
"required": True,
|
||||
"password": True,
|
||||
},
|
||||
"temperature": {
|
||||
"display_name": "Temperature",
|
||||
"advanced": False,
|
||||
"required": False,
|
||||
"value": 0.1,
|
||||
},
|
||||
"stream": {
|
||||
|
|
@ -85,12 +82,12 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
def build(
|
||||
self,
|
||||
input_value: Text,
|
||||
openai_api_key: str,
|
||||
temperature: float,
|
||||
model_name: str,
|
||||
max_tokens: Optional[int] = 256,
|
||||
model_kwargs: NestedDict = {},
|
||||
model_name: str = "gpt-4-1106-preview",
|
||||
openai_api_base: Optional[str] = None,
|
||||
openai_api_key: Optional[str] = None,
|
||||
temperature: float = 0.7,
|
||||
stream: bool = False,
|
||||
system_message: Optional[str] = None,
|
||||
) -> Text:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue