mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-01 13:26:15 +00:00
``` https://api\.python\.langchain\.com/en/latest/([^/]*)/langchain_([^.]*)\.(.*)\.html([^"]*) https://python.langchain.com/v0.2/api_reference/$2/$1/langchain_$2.$3.html$4 ``` --------- Co-authored-by: Bagatur <baskaryan@gmail.com>
203 lines
5.6 KiB
Plaintext
203 lines
5.6 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "raw",
|
|
"metadata": {
|
|
"vscode": {
|
|
"languageId": "raw"
|
|
}
|
|
},
|
|
"source": [
|
|
"---\n",
|
|
"sidebar_label: __ModuleName__ByteStore\n",
|
|
"---"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"# __ModuleName__ByteStore\n",
|
|
"\n",
|
|
"- TODO: Make sure API reference link is correct.\n",
|
|
"\n",
|
|
"This will help you get started with __ModuleName__ [key-value stores](/docs/concepts/#key-value-stores). For detailed documentation of all __ModuleName__ByteStore features and configurations head to the [API reference](https://python.langchain.com/v0.2/api_reference/core/stores/langchain_core.stores.__module_name__ByteStore.html).\n",
|
|
"\n",
|
|
"- TODO: Add any other relevant links, like information about models, prices, context windows, etc. See https://python.langchain.com/v0.2/docs/integrations/stores/in_memory/ for an example.\n",
|
|
"\n",
|
|
"## Overview\n",
|
|
"\n",
|
|
"- TODO: (Optional) A short introduction to the underlying technology/API.\n",
|
|
"\n",
|
|
"### Integration details\n",
|
|
"\n",
|
|
"- TODO: Fill in table features.\n",
|
|
"- TODO: Remove JS support link if not relevant, otherwise ensure link is correct.\n",
|
|
"- TODO: Make sure API reference links are correct.\n",
|
|
"\n",
|
|
"| Class | Package | Local | [JS support](https://js.langchain.com/v0.2/docs/integrations/stores/_package_name_) | Package downloads | Package latest |\n",
|
|
"| :--- | :--- | :---: | :---: | :---: | :---: |\n",
|
|
"| [__ModuleName__ByteStore](https://api.python.langchain.com/en/latest/stores/__module_name__.stores.__ModuleName__ByteStore.html) | [__package_name__](https://api.python.langchain.com/en/latest/__package_name_short_snake___api_reference.html) | ✅/❌ | ✅/❌ |  |  |\n",
|
|
"\n",
|
|
"## Setup\n",
|
|
"\n",
|
|
"- TODO: Update with relevant info.\n",
|
|
"\n",
|
|
"To create a __ModuleName__ byte store, you'll need to create a/an __ModuleName__ account, get an API key, and install the `__package_name__` integration package.\n",
|
|
"\n",
|
|
"### Credentials\n",
|
|
"\n",
|
|
"- TODO: Update with relevant info, or omit if the service does not require any credentials.\n",
|
|
"\n",
|
|
"Head to (TODO: link) to sign up to __ModuleName__ and generate an API key. Once you've done this set the __MODULE_NAME___API_KEY environment variable:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"import getpass\n",
|
|
"import os\n",
|
|
"\n",
|
|
"if not os.getenv(\"__MODULE_NAME___API_KEY\"):\n",
|
|
" os.environ[\"__MODULE_NAME___API_KEY\"] = getpass.getpass(\"Enter your __ModuleName__ API key: \")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"### Installation\n",
|
|
"\n",
|
|
"The LangChain __ModuleName__ integration lives in the `__package_name__` package:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"%pip install -qU __package_name__"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Instantiation\n",
|
|
"\n",
|
|
"Now we can instantiate our byte store:\n",
|
|
"\n",
|
|
"- TODO: Update model instantiation with relevant params."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from __module_name__ import __ModuleName__ByteStore\n",
|
|
"\n",
|
|
"kv_store = __ModuleName__ByteStore(\n",
|
|
" # params...\n",
|
|
")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## Usage\n",
|
|
"\n",
|
|
"- TODO: Run cells so output can be seen.\n",
|
|
"\n",
|
|
"You can set data under keys like this using the `mset` method:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"kv_store.mset(\n",
|
|
" [\n",
|
|
" [\"key1\", b\"value1\"],\n",
|
|
" [\"key2\", b\"value2\"],\n",
|
|
" ]\n",
|
|
")\n",
|
|
"\n",
|
|
"kv_store.mget(\n",
|
|
" [\n",
|
|
" \"key1\",\n",
|
|
" \"key2\",\n",
|
|
" ]\n",
|
|
")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"And you can delete data using the `mdelete` method:"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": null,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"kv_store.mdelete(\n",
|
|
" [\n",
|
|
" \"key1\",\n",
|
|
" \"key2\",\n",
|
|
" ]\n",
|
|
")\n",
|
|
"\n",
|
|
"kv_store.mget(\n",
|
|
" [\n",
|
|
" \"key1\",\n",
|
|
" \"key2\",\n",
|
|
" ]\n",
|
|
")"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## TODO: Any functionality specific to this key-value store provider\n",
|
|
"\n",
|
|
"E.g. extra initialization. Delete if not relevant."
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "markdown",
|
|
"metadata": {},
|
|
"source": [
|
|
"## API reference\n",
|
|
"\n",
|
|
"For detailed documentation of all __ModuleName__ByteStore features and configurations, head to the API reference: https://api.python.langchain.com/en/latest/stores/__module_name__.stores.__ModuleName__ByteStore.html"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"name": "python",
|
|
"version": "3.10.5"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|