This SDK utilizes Upstash Redis DB by giving UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN parameters from the console.
One significant advantage of this is that, this SDK uses a REST API. This means, you can run this in serverless platforms, edge or any platform that does not support TCP connections.Cache‚ÄãUpstash Redis can be used as a cache for LLM prompts and responses.To import this cache:from langchain.cache import UpstashRedisCacheTo use with your LLMs:import langchainfrom upstash_redis import RedisURL = "<UPSTASH_REDIS_REST_URL>"TOKEN = "<UPSTASH_REDIS_REST_TOKEN>"langchain.llm_cache = UpstashRedisCache(redis_=Redis(url=URL, token=TOKEN))Memory‚ÄãUpstash Redis can be used to persist LLM conversations.Chat Message History Memory‚ÄãAn example of Upstash Redis for caching conversation message history can be seen in this notebook.PreviousUnstructuredNextUSearchInstallation and SetupIntegrationsCacheMemoryCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
Upstash offers developers serverless databases and messaging platforms to build powerful applications without having to worry about the operational complexity of running databases at scale.
Upstash offers developers serverless databases and messaging platforms to build powerful applications without having to worry about the operational complexity of running databases at scale. ->: This SDK utilizes Upstash Redis DB by giving UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN parameters from the console.
One significant advantage of this is that, this SDK uses a REST API. This means, you can run this in serverless platforms, edge or any platform that does not support TCP connections.Cache‚ÄãUpstash Redis can be used as a cache for LLM prompts and responses.To import this cache:from langchain.cache import UpstashRedisCacheTo use with your LLMs:import langchainfrom upstash_redis import RedisURL = "<UPSTASH_REDIS_REST_URL>"TOKEN = "<UPSTASH_REDIS_REST_TOKEN>"langchain.llm_cache = UpstashRedisCache(redis_=Redis(url=URL, token=TOKEN))Memory‚ÄãUpstash Redis can be used to persist LLM conversations.Chat Message History Memory‚ÄãAn example of Upstash Redis for caching conversation message history can be seen in this notebook.PreviousUnstructuredNextUSearchInstallation and SetupIntegrationsCacheMemoryCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.