avatarRochelle Deans

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

7654

Abstract

-string">"product"</span>], template=<span class="hljs-string">"What is a good name for a company that makes {product}?"</span>,

<span class="hljs-built_in">print</span>(prompt.<span class="hljs-built_in">format</span>(product=<span class="hljs-string">"typing machines"</span>))

llm = OpenAI(temperature=<span class="hljs-number">0.9</span>) text = (prompt.<span class="hljs-built_in">format</span>(product=<span class="hljs-string">"typing machines"</span>)) <span class="hljs-built_in">print</span>(llm(text))</pre></div><p id="107e">⬇️ Notebook view:</p><figure id="8121"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*sNd-kSpCkaenSz159KjRuQ.png"><figcaption></figcaption></figure><p id="0e77">The following prototype is a good example of how LangChain can be used to automate prompt engineering, and leverage LLMs for conversational context:</p><div id="e533"><pre><span class="hljs-keyword">from</span> langchain.llms <span class="hljs-keyword">import</span> OpenAI <span class="hljs-keyword">from</span> langchain.chains <span class="hljs-keyword">import</span> ConversationChain <span class="hljs-keyword">from</span> langchain.chains.conversation.memory <span class="hljs-keyword">import</span> ConversationBufferMemory

llm = OpenAI(temperature=<span class="hljs-number">0</span>) conversation = ConversationChain( llm=llm, verbose=<span class="hljs-literal">True</span>, memory=ConversationBufferMemory() )

conversation.predict(<span class="hljs-built_in">input</span>=<span class="hljs-string">"Hi there!"</span>)</pre></div><p id="e3e8">Response:</p><div id="f542"><pre>> Entering new ConversationChain chain... Prompt after formatting: The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:

Human: Hi there! AI:

> Finished chain. Hi there! It's nice to meet you. My name is AI. What's your name?</pre></div><p id="31b3">Input:</p><div id="3efb"><pre>conversation.predict(<span class="hljs-built_in">input</span>=<span class="hljs-string">"My name is Cobus"</span>)</pre></div><p id="1b3e">Response:</p><div id="8fca"><pre>> Entering new ConversationChain chain... Prompt after formatting: The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.

Current conversation:

Human: Hi there! AI: Hi there! It's nice to meet you. My name is AI. What's your name? Human: My name is Cobus AI:

> Finished chain. Nice to meet you, Cobus! What can I do for you today?</pre></div><p id="bcbb">This approach is not optimal for longer conversations as the prompt size sent to the LLM will just grow too big.</p><p id="fdcf">In this final example, the user is prompted for input and this is used to generate the response, it also illustrates how two chains are combined.</p><div id="f1bf"><pre>title = <span class="hljs-built_in">input</span>(<span class="hljs-string">'What is your title? '</span>) <span class="hljs-built_in">print</span> (<span class="hljs-string">'I have your title as '</span> + title)

era = <span class="hljs-built_in">input</span>(<span class="hljs-string">'Lasty, from what era should the text be? '</span>) <span class="hljs-built_in">print</span> (<span class="hljs-string">'I have your era as '</span> + era)

<span class="hljs-comment"># This is an LLMChain to write a synopsis given a title of a play and the era it is set in.</span> llm = OpenAI(temperature=<span class="hljs-number">.7</span>) template = <span class="hljs-string">"""You are a playwright. Given the title of play and the era it is set in, it is your job to write a synopsis for that title.

Title: {title} Era: {era} Playwright: This is a synopsis for the above play:"""</span> prompt_template = PromptTemplate(input_variables=[<span class="hljs-string">"title"</span>, <span class="hljs-string">'era'</span>], template=template) synopsis_chain = LLMChain(llm=llm, prompt=prompt_template, output_key=<span class="hljs-string">"synopsis"</span>)

<span class="hljs-comment"># This is an LLMChain to write a review of a play given a synopsis.</span> llm = OpenAI(temperature=<span class="hljs-number">.7</span>) template = <span class="hljs-string">"""You are a play critic from the New York Times. Given the synopsis of play, it is your job to write a review for that play.

Play Synopsis: {synopsis} Review from a New York Times play critic of the above play:"""</span> prompt_template = PromptTemplate(input_variables=[<span class="hljs-string">"synopsis"</span>], template=template) review_chain = LLMChain(llm=llm, prompt=prompt_template, output_key=<span class="hljs-string">"review"</span>)

<span class="hljs-comment"># This is the overall chain where we run these two chains in sequence.</span> <span class="hljs-keyword">from</span> langchain.chains <span class="hljs-keyword">import</span> SequentialChain overall_chain = SequentialChain( chains=[synopsis_chain, review_chain], input_variables=[<span class="hljs-string">"era"</span>, <span class="hljs-string">"title"</span>], <span class="hljs-comment"># Here we return multiple variables</span> output_variables=[<span class="hljs-string">"synopsis"</span>, <span class="hljs-string">"review"</span>], verbose=<span class="hljs-literal">True</span>)

review = overall_chain({<span class="hljs-string">"title"</span>:title, <span class="hljs-string">"era"</span>: era}) <span class="hljs-built_in">print</span> (review)</pre></div><p id="bc8d">And the output:</p><div id="b537"><pre>> Entering new SequentialChain chain...

> Finished chain. {'title': 'Tragedy at sunset on the beach', 'era': 'Victorian ', 'synopsis': "\n\nTragedy at Sunset on the Beach is set in the Victorian era and tells the story of a young girl, Amelia, whose search for love and happiness leads her to a fateful encounter with a mysterious stranger on the beach at sunset. While walking along the shore, Amelia meets a man named William, who presents her with a rose as a symbol of his affection. Though she initially resists his advances, Amelia eventually finds herself drawn to William and the two quickly grow close. \n\nHowever, as the sun sets, a secret from William's past is revealed that changes everything. It turns out that William is a wanted criminal and is being pursued by the police. After a tense confrontation, William is arrested and taken away, leaving Amelia heartbroken and alone.\n\nIn the aftermath of their chance encounter, Amelia is forced to grapple with the tragedy of her unrequited love, and the harsh realities of life. Her journey serves as a reminder that love isn't always as simple and straightforward as it may seem.", 'review': '\n\nTragedy at Sunset on the Beach is a captivating tale of love, loss, and the power of the human spirit. The set in the Victorian era allows for a unique perspective on the themes of the story, and the performance by the cast is truly remarkable.\n\nThe story follows Amelia, a young girl whose search for love and happiness leads her to a fateful encounter with a mysterious stranger on the beach at sunset. We watch as Amelia’s relationship with the stranger, William, develops and evolves, only to be cut short when a secret from his past is revealed. This revelation forces Amelia to confront the harsh realities of life and the tragedy of her unrequited love.\n\nThe play is a thought-p

Options

rovoking exploration of love, sacrifice, and the power of human connection. It’s a story that is sure to resonate with audiences who are looking for a story of love, loss, and hope. Highly recommended.'}</pre></div><h1 id="e5a3">In Conclusion</h1><p id="2a02">In the recent past, I have written a number of times on the coming fragmentation and that a single contained Conversational AI framework will not suffice.</p><p id="43a6">Already we are seeing that LLMs are forcing traditional chatbot framework providers to look out ward to technologies they should make provision for.</p><p id="e321">LangChain is software that fills a critical voice which currently exists to make LLMs more conversational.</p><p id="b240"><b><i>⭐️ Please follow me on <a href="https://www.linkedin.com/in/cobusgreyling/">LinkedIn</a> for updates on Conversational AI ⭐️</i></b></p><figure id="10d2"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*lIm_TXh6TC9uGn63lOjZtQ.png"><figcaption></figcaption></figure><p id="42a0"><i>I’m currently the <a href="https://www.linkedin.com/in/cobusgreyling">Chief Evangelist</a> @ <a href="https://www.humanfirst.ai">HumanFirst</a>. I explore and write about all things at the intersection of AI and language; ranging from <a href="https://cobusgreyling.medium.com/the-large-language-model-landscape-9da7ee17710b">LLMs</a>, <a href="https://cobusgreyling.medium.com/the-five-categories-of-conversational-ai-f2410beeaf2f">Chatbots</a>, <a href="https://cobusgreyling.medium.com/three-key-voicebot-design-considerations-7bf25444dfec">Voicebots</a>, Development Frameworks, <a href="https://cobusgreyling.medium.com/testing-complex-utterances-with-the-co-here-humanfirst-integration-145ab4eedd84">Data-Centric latent spaces</a> and more.</i></p><div id="02f7" class="link-block"> <a href="https://www.humanfirst.ai"> <div> <div> <h2>NLU design tooling</h2> <div><h3>“Conversation Designer, Retail, 10k+ employees The tool that turned conversation designers, into NLU designers” ★★★★★…</h3></div> <div><p>www.humanfirst.ai</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*lgMaRGTU1PRX4MB7)"></div> </div> </div> </a> </div><figure id="7278"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*qPfFI9uFl04n1ZUywxH38w.png"><figcaption></figcaption></figure><figure id="9789"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*mwQw4LOeZdWG1AD8RDheXw.jpeg"><figcaption><a href="https://www.linkedin.com/in/cobusgreyling">https://www.linkedin.com/in/cobusgreyling</a></figcaption></figure><figure id="bcbe"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*qPfFI9uFl04n1ZUywxH38w.png"><figcaption></figcaption></figure><div id="525b" class="link-block"> <a href="https://cobusgreyling.medium.com/subscribe"> <div> <div> <h2>Get an email whenever Cobus Greyling publishes.</h2> <div><h3>Get an email whenever Cobus Greyling publishes. By signing up, you will create a Medium account if you don’t already…</h3></div> <div><p>cobusgreyling.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*jN8P0LRxgRrefLMK)"></div> </div> </div> </a> </div><div id="b7d5" class="link-block"> <a href="https://eliza.community"> <div> <div> <h2>Eliza Language Technology Community — Language Technology: Conversational AI, NLP/NLP, CCAI…</h2> <div><h3>ELIZA — Where language technology enthusiasts unite.</h3></div> <div><p>eliza.community</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*yM6mui4LoM4fDMPx)"></div> </div> </div> </a> </div><div id="63e6" class="link-block"> <a href="https://cobusgreyling.medium.com/the-cobus-quadrant-of-nlu-design-4b1654f21d70"> <div> <div> <h2>The Cobus Quadrant™ Of NLU Design</h2> <div><h3>NLU design is vital to planning and continuously improving Conversational AI experiences.</h3></div> <div><p>cobusgreyling.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*yLwyX_HKYjwqFY0IkmesCw.png)"></div> </div> </div> </a> </div><div id="e342" class="link-block"> <a href="https://cobusgreyling.medium.com/the-cobus-quadrant-of-conversation-design-capabilities-9a28c23409cd"> <div> <div> <h2>The Cobus Quadrant™ Of Conversation Design Capabilities</h2> <div><h3>∗ This is part one of a two part series, please also take a look part two, the Cobus Quadrant of NLU Design.</h3></div> <div><p>cobusgreyling.medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*xdvS5qYcZsxll7FEUWRitA.png)"></div> </div> </div> </a> </div><div id="198e" class="link-block"> <a href="https://chat.langchain.dev/"> <div> <div> <h2>LangChain Chat</h2> <div><h3>LangChain documentation chatbot</h3></div> <div><p>chat.langchain.dev</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/)"></div> </div> </div> </a> </div><figure id="a944"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*qPfFI9uFl04n1ZUywxH38w.png"><figcaption></figcaption></figure><div id="8473" class="link-block"> <a href="https://github.com/hwchase17/langchain"> <div> <div> <h2>GitHub - hwchase17/langchain: ⚡ Building applications with LLMs through composability ⚡</h2> <div><h3>⚡ Building applications with LLMs through composability ⚡ pip install langchain Large language models (LLMs) are…</h3></div> <div><p>github.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*JB0ci66QVXXsDtm8)"></div> </div> </div> </a> </div><div id="1e65" class="link-block"> <a href="https://langchain.readthedocs.io/"> <div> <div> <h2>Welcome to LangChain</h2> <div><h3>Large language models (LLMs) are emerging as a transformative technology, enabling developers to build applications…</h3></div> <div><p>langchain.readthedocs.io</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/)"></div> </div> </div> </a> </div><figure id="8d81"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*qPfFI9uFl04n1ZUywxH38w.png"><figcaption></figcaption></figure></article></body>

My Year Without Goals: Quarter 1 Check-In

Do I regret not making goals for the year?

Photo by Persnickety Prints on Unsplash

When the year began, I wrote about my quest to remove myself from my insistent need for the quantifiable, SMART goals by which I defined my success or failure as a human. By all those measures, I kept failing as a human, even though by the measures that mattered, I’d gotten wiser, become a better writer, and learned to work with my neurodiversity instead of fighting it.

Plus, like, survived parenting two kids during the various global crises that have defined their lives so far.

Anyway, for 2022, I didn’t make goals, didn’t make plans, don’t have checklists of things I must accomplish this year. I decided to ask questions of myself instead.

How has it gone, now that a quarter is fully over? Well.

Unfortunately, this worked. It ended up being the right choice for me in myriad ways, not least because the first quarter threw curveballs at me I couldn’t have possibly imagined. Some of them are great, and some less so, but I’m so glad I didn’t hold myself to what I thought life was like three months ago.

Things that weren’t part of the plan

A short list of things I hadn’t anticipated in December 2021:

  • Some agents that had been closed to querying since I started querying my last finished book opened, leading me to send out a few more queries instead of looking into small presses.
  • My usual January 10th deadline for a recurring client got moved to February 15th, and my early April deadline moved to mid-April. My usual ebb and flow was interrupted.
  • I created my own Medium publication dedicated to the fiction writing tips I’d thought about exploring in a book.
  • Instead of just thinking about it, I decided to officially pursue self-publishing my Enchantress book, which has meant some admin work I didn’t expect.
  • A friend who had been a major part of my productivity system over the last few years stepped away for a bit for some Real Life stuff, leaving me in need of a new system.
  • After a bit of flailing, I found a few new systems for helping myself manage my ADHD and productivity.
  • Oh, and I dealt with quarantine, covid scares, actual covid, closed daycares, and non-covid illnesses that threw my non-essential timelines to the wind.

Suffice it to say I’m glad I didn’t officially have goals, because they would have gone very poorly. When my goals go poorly, I get frustrated with myself, and think I need to be doing a better job. I commit to try harder and do better, when trying harder would have done absolutely nothing to, for instance, change the fact that my deadlines moved.

The questions I answered

I asked myself thirteen questions for the first quarter of the year. Of those, eight of them were related to work and side hustles, and the remaining five were related to routines and self-care.

I definitively answered five of them, explored another seven, and set aside two (one after exploring it first) as something I thought I wanted but didn’t — at least not yet.

The ones I definitively answered aren’t interesting. I find this fascinating, because I think it shows me what I was missing in only having SMART goals for the past 15+ years.

What one-on-one work had my focus and time? The work that was sent to me, of course. How can I get Enchantress ready to print out for revisions, and what do I need to know before handwritten revisions can start? I used the same techniques I have for years and managed both parts of this question by mid-February. Do I want to keep querying? Yes, but only to agents I’d already said I wanted to and only just got the chance.

Takeaway: Questions with concrete answers were close to how I used to do goals. They needed my focus to keep me on track with balls that were already rolling, but I didn’t learn anything exciting answering them.

The questions I dropped

I asked two questions that I decided to release from my radar, one without trying and one after trying a bit. The first was “Are there reputable small presses that work in the niche of my last book that I want to query?” The second was “Is there a kind of marketing I don’t find awful, and how can I leverage that for my course?”

As to the first, querying agents again was more important, and then I decided to focus my attention on the Enchantress book while I wait to hear back at publishing’s notoriously glacial pace.

The second I worked on for a bit in weeks when I was less busy. I explored creating a newsletter, preparing short courses with smaller questions, and new pop-up campaigns for my website. All of it I’ve postponed. For one thing, I got a small answer: while there may be marketing I don’t hate, I don’t find any of it enjoyable enough to focus on consistently, the way that initial marketing campaigns need.

I’d love to get my newsletter (which exists here, just without a publishing schedule yet) off the ground, I’d love to write those courses… but unfortunately my day job is more important still, and this isn’t the kind of thing I’d work evenings and weekends for. Also, the dream would be to hire someone to handle my marketing. Maybe one day.

Takeaways: When things change, let them change. Sometimes the worst thing you can do is make yourself follow through with something you no longer want, and releasing it will feel good. Don’t force yourself to do something you hate. Even proven techniques don’t go all that well if you don’t enjoy doing them — that drudgery shows up on the page.

The most interesting lessons are in the maybes

By far, the most rewarding, interesting work I completed in the first quarter didn’t come with easy answers. Most of these questions didn’t come with answers at all, or an item I could successfully check off a to-do list. This is why I consider my experiment to be a huge success. Interesting things happen when you aren’t working toward a specific answer.

These questions included:

  • How many articles do I want to write each month? What publications can I submit to?
  • How do I feel when I prioritize active self-care (yoga, strength training, gymnastics, etc.)?
  • How do I feel when I prioritize stillness in self-care (yin yoga, journal, color, draw, piano, etc.)?
  • What does it look like to clean up while making dinner?
  • What routines can I create to help me clean well and finish projects?
  • How do I feel when I drink at least 64 oz of water a day?

First off, a confession. I lied. I got a sort-of answer to the last question and I don’t like it. Turns out when I drink 64 oz of water a day, I’m thirsty. It isn’t enough. But as someone who was barely managing 24 oz of plain water a day two years ago, I’m happy with the direction this is going. It made it to the interesting part of my list because I expected an answer like “clearer focus” or “I sleep better,” not “I need more than that.”

Beyond water, while I do have some tentative answers and/or definite no’s, what I love about these questions is how they stretched me in directions I didn’t think of when I wrote them.

In January, I hired a personal trainer for six sessions. I was excited to learn how to lift weights, and maybe move that practice to a gym so I could keep up the strength training I started in physical therapy last fall, trying to fix a knee gymnastics broke two decades ago. Unfortunately, my personal trainer knew exactly what I needed and exactly how to work with me. I didn’t think I’d still be seeing her four months later, but I am. So, strength training has ended up as a huge priority for me. I feel amazing when I do it. It’s been easier for me to stick to than yoga ever has.

When I asked questions about publications for Medium, it hadn’t even crossed my mind to make my own publication. But there isn’t really an active publication here dedicated to fiction writing advice (if you know of one, let me know!), I had 25,000 words already written about building a novel layer by layer, and I wanted a place I could send clients to. So I made one. I love that I made one, even though it’s off to a relatively slow start. I’m still experimenting with how many articles a month is sustainable for me along with my main work, but I’m loving finding a sweet spot in the process, while getting some fiction concepts online that I don’t see talked about much.

I’ve also found, to my absolute chagrin, that I am capable of cleaning up while I make dinner. This leads to absolutely unconscionable results like a kitchen that remains in a fairly clean state day to day, a significant improvement in my focus when I’m not scrolling my phone when dinner cooks, and a happier husband.

I re-downloaded Todoist, and I’m enjoying how I can make it work for me, even in their free version. I’ve consistently used it for more than a month now, which is, unfortunately, way up there as a record for me and my inconsistent habits. In combination with my bullet journal, I’ve been able to get things done and keep records of what I do, both of which are so useful for me, when I tend to first procrastinate, and then forget everything I’ve completed once it’s checked off.

Takeaway: When I ask questions with answers in mind, and then disprove my own hypothesis, I’m doing it right. I’m learning new things, figuring out where my limits and interests are, and enjoying the process. Open-ended questions leave room for answering them slant, too — like asking which publications to pursue, and adding “my own” to a list of four others I also write for.

What’s next?

As the second quarter started, I wrote myself more questions, of course. I have 11 of them, only one (my question about what books I want to read and when) repeated from first quarter. Some are refined based on information I learned in the first quarter, e.g., “How do I feel when I start drinking plain water by 9am and drink at least 64 oz of plain water a day?” Some show how I’ve moved on — from drafting and an initial revision to preparing my book for CPs.

I’m really excited to see where these questions take me, even if it’s somewhere I hadn’t meant to go.

If you like my work and would like to read more of it, consider joining Medium with my referral link to get full access to every article on Medium. Using my referral link doesn’t cost you anything extra, but half of the fee goes directly to supporting me each month.

Life
Self Improvement
Writing
Goals
Goal Setting
Recommended from ReadMedium