community: Fix OVHcloud 401 Unauthorized on embedding. (#23260)

They are now rejecting with code 401 calls from users with expired or
invalid tokens (while before they were being considered anonymous).
Thus, the authorization header has to be removed when there is no token.

Related to: #23178

---------

Signed-off-by: Joffref <mariusjoffre@gmail.com>
This commit is contained in:
Mathis Joffre
2024-06-24 18:58:32 +02:00
committed by GitHub
parent 4964ba74db
commit 60103fc4a5
4 changed files with 39 additions and 28 deletions

View File

@@ -7,12 +7,14 @@
"source": [
"# OVHcloud\n",
"\n",
"> In order to use this model you need to create a new token on the AI Endpoints website: https://endpoints.ai.cloud.ovh.net/.\n",
"\n",
"This notebook explains how to use OVHCloudEmbeddings, which is included in the langchain_community package, to embed texts in langchain."
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 4,
"id": "3da0fce0",
"metadata": {},
"outputs": [
@@ -35,6 +37,20 @@
"\"\"\" verify \"\"\"\n",
"print(f\"Embedding generated by OVHCloudEmbeddings: {embed}\")"
]
},
{
"cell_type": "markdown",
"id": "47c9af05-4d25-40f2-9305-7bccf1e14c64",
"metadata": {},
"source": [
"## Further reading\n",
"- [Enhance your applications with AI Endpoints](https://blog.ovhcloud.com/enhance-your-applications-with-ai-endpoints/)\n",
"- [How to use AI Endpoints and LangChain4j](https://blog.ovhcloud.com/how-to-use-ai-endpoints-and-langchain4j/)\n",
"- [LLMs streaming with AI Endpoints and LangChain4j](https://blog.ovhcloud.com/llms-streaming-with-ai-endpoints-and-langchain4j/)\n",
"- [How to use AI Endpoints and LangChain to create a chatbot](https://blog.ovhcloud.com/how-to-use-ai-endpoints-and-langchain-to-create-a-chatbot/)\n",
"- [How to use AI Endpoints, LangChain and Javascript to create a chatbot](https://blog.ovhcloud.com/how-to-use-ai-endpoints-langchain-and-javascript-to-create-a-chatbot/)\n",
"- [RAG chatbot using AI Endpoints and LangChain](https://blog.ovhcloud.com/rag-chatbot-using-ai-endpoints-and-langchain/)"
]
}
],
"metadata": {