Collin Ferry — Tech Blog

NVC.ai

I built an experimental Steamship package to improve your relationship dialogue. Say the same thing but in a kinder way!

Demo running here.

It accepts a phrase and then (hopefully) returns the same sentiment but expressed using Non-Violent Commuication.

image

The crux of the customizability is actually quite simple. I did not fine-tune GPT to understand something as complex and nuanced as communication in a romantic relationship. I just used prompt engineering to focus GPT’s efforts:

class PromptPackage(PackageService):
  
  PROMPT = "Nonviolent Communication is an approach to communication where we cite Observations, Feelings, Needs and Requests. How might one say {phrase} using Non Violent Communication? Just give me the quote."

  @post("generate")
  def generate(self, phrase: str) -> str:
    """Generate text from prompt parameters."""
    llm_config = {
      # Controls length of generated output.
      "max_words": 60,
      # Controls randomness of output (range: 0.0-1.0).
      "temperature": 0.8
    }
    prompt_args = {"phrase": phrase}

    llm = self.client.use_plugin("gpt-3", config=llm_config)
    return llm.generate(self.PROMPT, prompt_args)

Try it out in the UI and then try it out on your romantic partner. I am not liable for any breakups.