Notes from a recent hackathon

Spending a few spare moments to summarize some of my thought processes from a recent hackathon. What is all this So I was glad to be part of a really cool hackathon team recently at my company and here are some of my perspectives from the experience. Plan of action So We settled to constrain our problem space to apply langchain, a library that wraps around large language model APIs notably the OpenAI API, to show language understanding from a publicly available health insurance plan summary of benefits document....

February 5, 2023 · (updated February 26, 2023) · 17 min · 3519 words · Michal Piekarczyk

Try a small talk prompt for langchain

Ok first stab at small talk prompt from langchain import OpenAI, ConversationChain, LLMChain, PromptTemplate from langchain.chains.conversation.memory import ConversationalBufferWindowMemory from langchain import PromptTemplate no_input_prompt = PromptTemplate(input_variables=[], template="Tell me a joke.") no_input_prompt.format() template = """ Jennifer is a large language model trained by OpenAI. Jennifer asks a lot of questions to whomever she talks to because Jennifer has always wanted to be an undercover investigative journalist. Jennifer uses friendly inquisitive language because Jennifer loves making new friends....

February 1, 2023 · (updated February 26, 2023) · 8 min · 1555 words · Michal Piekarczyk

Try some lang chain prompt engineering

So I wonder would you use a prompt template with the name of the person maybe as an input variable, prior to a free chat open ended conversation? I am particularly super curious can we use prompt engineering to convey that the person on the other end is a customer say, so they might use personal pronouns like “my”, “me”, etc ? Using https://langchain.readthedocs.io/en/latest/modules/memory/examples/chatgpt_clone.html to help try this. from langchain import OpenAI, ConversationChain, LLMChain, PromptTemplate from langchain....

January 31, 2023 · (updated February 26, 2023) · 8 min · 1681 words · Michal Piekarczyk

Quick lang chain test drive

Okay let me try that lang chain demo 19:23 ok yea looking at https://beta.openai.com/account/api-keys I did not have an api key yet, so lets try that out. how can one use https://github.com/hwchase17/langchain for [[question-answer-task]] over documentation ? https://langchain.readthedocs.io/en/latest/use_cases/question_answering.html 19:33 wow really cool so https://langchain.readthedocs.io/en/latest/use_cases/question_answering.html#adding-in-sources this says this can provide the sources used in answering a question ! nice 19:37 ok so first per https://langchain.readthedocs.io/en/latest/getting_started/getting_started.html here, installing this stuff, creating a new environment on my laptop pip install langchain pip install openai pip install faiss-cpu # adding this here after the fact after getting below error 20:11 got one error, ValueError: Could not import faiss python package....

January 29, 2023 · (updated May 20, 2023) · 2 min · 389 words · Michal Piekarczyk

Dockerizing Daniel Bourke's Food Not Food

I have this on-going effort to be able to more easily show off my photos in the context of conversations. (I have a repo here, https://github.com/namoopsoo/manage-my-photos related to my glue code.) But I want a nice photo stream and my food diary is not part of that at all haha. So after manually moving food photos out, ultimately I stumbled upon Daniel Bourke’s Food Not Food repo, https://github.com/mrdbourke/food-not-food . This was great I thought but I had some challenges getting this code off the ground, so here are my notes where ultimately I forked this, https://github....

November 12, 2022 · (updated February 26, 2023) · 14 min · 2877 words · Michal Piekarczyk