Replies: 1 comment 2 replies
-
Yes, there is a better solution for securing the internal chatbot on your server than using an API key in the configurable fields. You can use Azure Active Directory (AD) tokens for authentication instead of API keys. This method is more secure as it leverages Azure's identity and access management capabilities. Here is an example of how you can configure the Azure AD token in the LangChain framework: client_params = {
"api_version": values["openai_api_version"],
"azure_endpoint": values["azure_endpoint"],
"azure_deployment": values["deployment_name"],
"api_key": None, # Do not use API key
"azure_ad_token": values["azure_ad_token"].get_secret_value()
if values["azure_ad_token"]
else None,
"azure_ad_token_provider": values["azure_ad_token_provider"],
"organization": values["openai_organization"],
"base_url": values["openai_api_base"],
"timeout": values["request_timeout"],
"max_retries": values["max_retries"],
"default_headers": values["default_headers"],
"default_query": values["default_query"],
} Ensure that you have the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Checked other resources
Commit to Help
Example Code
Description
we have many chatbots in the same server
Now I want to security for internal chatbot (not public), so I can add api_key in the configurable (each api_key for one chatbot)
Do you have any better solution?
System Info
langchain==0.2.1
langchain-community==0.0.38
langchain-core==0.2.1
langchain-google-genai==0.0.4
langchain-google-vertexai==0.0.1.post1
langchain-openai==0.0.2
langchain-text-splitters==0.2.0
Python 3.11.0rc1
Platform: linux
Beta Was this translation helpful? Give feedback.
All reactions