A wrapper for LangChain to create AI Agents with existing LLMs
Project description
LangChainAgentFactory
LangChainAgentFactory is a Python package that provides a wrapper for LangChain, facilitating the creation of AI Agents with existing Large Language Models (LLMs).
Installation
Install LangChainAgentFactory via pip:
pip install LangChainAgentFactory
Usage
To create a basic chatbot with LangChainAgentFactory:
- set the environment variable OPENAI_API_KEY='YOUR_OPENAI_API_KEY'
Windows
powershell: $env:OPENAI_API_KEY = 'YOUR_OPENAI_API_KEY'
command prompt: set OPENAI_API_KEY=YOUR_OPENAI_API_KEY
MacOS
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
- Create a summarizer, chatbot, summarize a conversation, and count tokens
from LangChainAgentFactory import LangChainAgentFactory
# a separate agent used to summarize conversations
# tracks all prompts and responses and continuously summarizes
summarizer = ConversationSummarizer()
while True:
prompt = input('How can I help you today?')
# count tokens, summarize the conversation up until now, and respond to a user's query:
summarizer.summarize(prompt)
Detailed usage instructions coming soon:
- use ConversationSummaryBufferMemory to better manage token usage and conversation summarization
- create your own custom agents with few shot examples to handle queries
before summarization
- limit the length of example prompts based on current conversation token usage
Upcoming features:
- function calling (give ChatGPT access to call methods in order to perform tasks such as web searches and sending emails)
License
LangChainAgentFactory is released under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file LangChainAgentFactory-0.2.tar.gz.
File metadata
- Download URL: LangChainAgentFactory-0.2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6fde9d680945a840d55145921fe058c750ac11f7b0c845f35f71e35451d3d3d
|
|
| MD5 |
d44fca40c7f8dce45eb4f5ce51a62c4a
|
|
| BLAKE2b-256 |
a396277ca2d36722a6ae2a52ffafc61332f714357c2a2d351e8befc1ea6ec45c
|
File details
Details for the file LangChainAgentFactory-0.2-py3-none-any.whl.
File metadata
- Download URL: LangChainAgentFactory-0.2-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a1fe73f3d2ecd3cccb039cfbd86ee176c0a0daf925c76603b780a13a7bcdec8
|
|
| MD5 |
b2a3f50c5811ebc15957c830a3d5589b
|
|
| BLAKE2b-256 |
bfa1cedc25c208507360bd24b7afd6c2eabee25a331dc1e0f78faf9d51c60334
|