Skip to content

Instantly share code, notes, and snippets.

View DaveOkpare's full-sized avatar
👽

David Okpare DaveOkpare

👽
View GitHub Profile
@DaveOkpare
DaveOkpare / README.md
Last active June 6, 2024 17:17
A script that scrapes a website and produces structured output from it.

Here's a sample request and response.

curl --location '127.0.0.1:8000/process/' \
--header 'Content-Type: application/json' \
--data-raw '{"url": "https://news.ycombinator.com/item?id=40224213",
"prompt": "Extract 20 jobs",
"xpath": "//div[@class='\''comment'\'']",
"fields": {
    "company_name": "str",
@DaveOkpare
DaveOkpare / zapier_nla_gmail.py
Last active February 9, 2024 21:06
Automate email replies and drafts with Zapier and Langchain
# pip install -q langchain openai chromadb tiktoken
import os
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.vectorstores import Chroma
from langchain.text_splitter import CharacterTextSplitter
from langchain.llms import OpenAI
from langchain.chains import RetrievalQA, LLMChain, TransformChain, SimpleSequentialChain, SequentialChain
from langchain.document_loaders import TextLoader
from langchain.prompts import PromptTemplate