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