Skip to content

Complwetion is a wrapper around a LLM provider and a Vector DB with common utilities

Notifications You must be signed in to change notification settings

gkteco/complwetion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

complwetion

pypi

Complwetion is a wrapper around an LLM provider and a Vector DB with common utilities like:

  • crawling the web
  • batching text into a list of desired sequence lengths
  • Performing RAG
  • vectorizing lists of sequences
  • connecting to a vector db
  • connecting to a LLM provider

The short term goal of complwetion is to provide an api to do auto-RAG. 1) Wire up a db, 2) Create an index, 3) encode and upsert some information, and 4) call a chat completion api with augmented context

Creating a library for building high performing auto-RAG chat completion backends is the near-longterm goal.

Quickstart

pip install complwetion

Using the Crawler Class

import complwetion.crawler as crawler

url = "https://<full_url_here>"
domain = "<your_domain_here>"

headers = {
  // your headers
}

context = ssl._create_unverified_context()
crawler = crawler.Crawler(headers=headers, context=context, full_url=url, domain=domain)
crawler.crawl()

Using the VectorDBService Class

bot = vector_db_service.VectorDBService(environment="us-west1-gcp-free",
                                        device='cuda',
                                        model='all-MiniLM-L6-v2',
                                        index_name="<your_index_name>",
                                        batch_size=20,
                                        provider_API_key="<your_LLM_provider_api_key>",
                                        vectordb_API_key="<your_vertor_db_api_key>")

init = {"role": "system", "content": "< initilize the bot with persona, task, etc. >"}
response = bot.run_conversation("Do you guys do custom services? if so what are they and how much for each?", init=init)

print(res["choices"][0]["message"]["content"])

Currently, complwetion only supports pincone and openai. These have been hardcoded into the class. Which is shitty.

About

Complwetion is a wrapper around a LLM provider and a Vector DB with common utilities

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages