Refactor AzureOpenAIModel.py: Removed unnecessary "required" attribute from input parameters
This commit is contained in:
parent
ec0ea548f2
commit
45b9141adb
1 changed files with 4 additions and 12 deletions
|
|
@ -52,36 +52,28 @@ class AzureChatOpenAIComponent(LCModelComponent):
|
||||||
"display_name": "Model Name",
|
"display_name": "Model Name",
|
||||||
"value": self.AZURE_OPENAI_MODELS[0],
|
"value": self.AZURE_OPENAI_MODELS[0],
|
||||||
"options": self.AZURE_OPENAI_MODELS,
|
"options": self.AZURE_OPENAI_MODELS,
|
||||||
"required": True,
|
|
||||||
},
|
},
|
||||||
"azure_endpoint": {
|
"azure_endpoint": {
|
||||||
"display_name": "Azure Endpoint",
|
"display_name": "Azure Endpoint",
|
||||||
"required": True,
|
|
||||||
"info": "Your Azure endpoint, including the resource.. Example: `https://example-resource.azure.openai.com/`",
|
"info": "Your Azure endpoint, including the resource.. Example: `https://example-resource.azure.openai.com/`",
|
||||||
},
|
},
|
||||||
"azure_deployment": {
|
"azure_deployment": {
|
||||||
"display_name": "Deployment Name",
|
"display_name": "Deployment Name",
|
||||||
"required": True,
|
|
||||||
},
|
},
|
||||||
"api_version": {
|
"api_version": {
|
||||||
"display_name": "API Version",
|
"display_name": "API Version",
|
||||||
"options": self.AZURE_OPENAI_API_VERSIONS,
|
"options": self.AZURE_OPENAI_API_VERSIONS,
|
||||||
"value": self.AZURE_OPENAI_API_VERSIONS[-1],
|
"value": self.AZURE_OPENAI_API_VERSIONS[-1],
|
||||||
"required": True,
|
|
||||||
"advanced": True,
|
"advanced": True,
|
||||||
},
|
},
|
||||||
"api_key": {"display_name": "API Key", "required": True, "password": True},
|
"api_key": {"display_name": "API Key", "password": True},
|
||||||
"temperature": {
|
"temperature": {
|
||||||
"display_name": "Temperature",
|
"display_name": "Temperature",
|
||||||
"value": 0.1,
|
"value": 0.7,
|
||||||
"field_type": "float",
|
|
||||||
"required": True,
|
|
||||||
},
|
},
|
||||||
"max_tokens": {
|
"max_tokens": {
|
||||||
"display_name": "Max Tokens",
|
"display_name": "Max Tokens",
|
||||||
"value": 1000,
|
"value": 1000,
|
||||||
"required": False,
|
|
||||||
"field_type": "int",
|
|
||||||
"advanced": True,
|
"advanced": True,
|
||||||
"info": "Maximum number of tokens to generate.",
|
"info": "Maximum number of tokens to generate.",
|
||||||
},
|
},
|
||||||
|
|
@ -106,9 +98,9 @@ class AzureChatOpenAIComponent(LCModelComponent):
|
||||||
input_value: Text,
|
input_value: Text,
|
||||||
azure_deployment: str,
|
azure_deployment: str,
|
||||||
api_version: str,
|
api_version: str,
|
||||||
api_key: Optional[str] = None,
|
api_key: str,
|
||||||
|
temperature: float,
|
||||||
system_message: Optional[str] = None,
|
system_message: Optional[str] = None,
|
||||||
temperature: float = 0.7,
|
|
||||||
max_tokens: Optional[int] = 1000,
|
max_tokens: Optional[int] = 1000,
|
||||||
stream: bool = False,
|
stream: bool = False,
|
||||||
) -> BaseLanguageModel:
|
) -> BaseLanguageModel:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue