mirror of
https://github.com/hwchase17/langchain
synced 2024-10-29 17:07:25 +00:00
92 lines
1.7 KiB
Plaintext
92 lines
1.7 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "a634365e",
|
|
"metadata": {},
|
|
"source": [
|
|
"# Tencent COS File\n",
|
|
"\n",
|
|
"This covers how to load document object from a `Tencent COS File`."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "85e97267",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"#! pip install cos-python-sdk-v5"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"id": "2f0cd6a5",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"from langchain.document_loaders import TencentCOSFileLoader\n",
|
|
"from qcloud_cos import CosConfig"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "321cc7f1",
|
|
"metadata": {
|
|
"tags": []
|
|
},
|
|
"outputs": [],
|
|
"source": [
|
|
"conf = CosConfig(\n",
|
|
" Region=\"your cos region\",\n",
|
|
" SecretId=\"your cos secret_id\",\n",
|
|
" SecretKey=\"your cos secret_key\",\n",
|
|
")\n",
|
|
"loader = TencentCOSFileLoader(conf=conf, bucket=\"you_cos_bucket\", key=\"fake.docx\")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"id": "4c50d2c7",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"loader.load()"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"id": "0690c40a",
|
|
"metadata": {},
|
|
"source": []
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3 (ipykernel)",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.9.6"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|