🔒 chore(llms.py): set password field to False for fields not containing 'key' or 'token' in their name

The openai_api_version field value is no longer set as it is not needed. The password field is now set to False for fields not containing 'key' or 'token' in their name to improve security.
🐛 fix(llms.py): remove setting of openai_api_version field value
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-06-15 09:45:15 -03:00
commit 61a6710adf

View file

@ -12,6 +12,9 @@ class LLMFrontendNode(FrontendNode):
field.name.title().replace("Openai", "OpenAI").replace("_", " ")
).replace("Api", "API")
if "key" not in field.name.lower() and "token" not in field.name.lower():
field.password = False
@staticmethod
def format_azure_field(field: TemplateField):
if field.name == "model_name":
@ -22,7 +25,6 @@ class LLMFrontendNode(FrontendNode):
field.value = "azure"
elif field.name == "openai_api_version":
field.password = False
field.value = "2023-03-15-preview"
@staticmethod
def format_llama_field(field: TemplateField):