Skip to main content

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:

  1. 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

  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

LangChainAgentFactory-0.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

LangChainAgentFactory-0.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

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

Hashes for LangChainAgentFactory-0.2.tar.gz
Algorithm Hash digest
SHA256 a6fde9d680945a840d55145921fe058c750ac11f7b0c845f35f71e35451d3d3d
MD5 d44fca40c7f8dce45eb4f5ce51a62c4a
BLAKE2b-256 a396277ca2d36722a6ae2a52ffafc61332f714357c2a2d351e8befc1ea6ec45c

See more details on using hashes here.

File details

Details for the file LangChainAgentFactory-0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for LangChainAgentFactory-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2a1fe73f3d2ecd3cccb039cfbd86ee176c0a0daf925c76603b780a13a7bcdec8
MD5 b2a3f50c5811ebc15957c830a3d5589b
BLAKE2b-256 bfa1cedc25c208507360bd24b7afd6c2eabee25a331dc1e0f78faf9d51c60334

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page