Content creation using MakerSuite and PaLM API

content-creation-using-makersuite-and-palm-api

How to use LLMs to create content and engage with your audience

Photo by Andrew Neel on Unsplash

Together PaLM API & MakerSuite offer an approachable way to start prototyping and building generative AI applications. The PaLM API is an easy and safe way to build on top of Google’s best language models (family of PaLM models).

The PaLM API is a simple entry point for Google’s large language models, which can be used for a variety of applications. It will provide developers access to models that are optimized for multi-turn use cases, such as content generation and chat, and general purpose models that are optimized for use cases such as summarization, classification, and more

MakerSuite is a browser-based IDE for prototyping with generative language models. MakerSuite lets you quickly try out models and experiment with different prompts, it has features for prompt engineering, synthetic data generation, and custom-model tuning — all supported by robust safety tools.

When you’ve built something you’re happy with, you can easily export it to Python code, and call the same models using the PaLM API

With MakerSuite, you’ll be able to iterate on prompts, augment your dataset with synthetic data, and easily tune custom models. When you’re ready to move to code, MakerSuite will let you export your prompt as code in your favorite languages and frameworks, like Python and Node.js.

In the digital era content creation is essential for people and companies that want to engage with their audience and strengthen their relationships, especially now with new companies, influencers, and products showing up faster than ever. While some companies and influencers invest a lot of money and time into content creation or have a much easier time doing this, it is pretty common that some people are much more technical and don’t have an easy time with content creation, but now, they can use the power of large language models (LLMs) to help with that.

Here we will explore how LLMs can help content creators using tools like MakerSuite and the PaLM API, we will also create an APP to turn this process into a small product.

Prototyping with MakerSuite

MakerSuite’s interface is quite simple and intuitive, right away we can start testing prompts. Below is an example of an initial prompt for content creation, this example could be a real use case for a technical machine learning engineer who wants to create social media learning content to engage with the audience.

In this case, the user wants to create content for the topic “Machine learning models overfit on small datasets”, this will be provided with a default context to guide the model’s output.

Prompt example at MakerSuite

One cool feature of MakerSuite is “Prompt suggestion” (number 1 flag) which provides the user with a few suggestions of optimized versions of the initial prompt, this can be especially useful for people who are starting with the LLMs-based tools.

MakerSuite’s prompt optimization tool

Once the user is satisfied with the prompt, the output can be generated (number 2 flag), shown below highlighted in purple. This output is actually quite good, it would fit well as an Instagram story or something similar, and its paragraphs follow a nice format.

1. Description of the issue and its consequences
2 and 3. A couple of examples
4. Suggestions on how to solve it

Sample output from MakerSuite

In just a few minutes, we developed a prototype for our content creation functionality that works pretty well! The next step would be to create the actual app, but notice that you could use the steps above to experiment with any idea, you can also check this guide to learn all the relevant features to improve your results with MakerSuite.

Creating an APP

MakerSuite is only a web-based tool, so for our app, we will be using the PaLM API which we can easily integrate with other systems, in our case we will build a Python-based app. For our app, we want to keep the same behavior as we got from our experiments, the great news is that MakerSuite allows us to easily export our prototype as code that we can incorporate into our apps and products while keeping the same behavior.

Exporting MakerSuite’s prompt as code.

After we get the code required to produce the desired outputs we will create the actual app, we will use Streamlit as its backbone, the great thing about Streamlit is that it is super simple and intuitive, we can create simple apps in minutes, and it also allows us to customize many aspects of the UI, sharing a public link to the app among many other features. This is how our app looks, just a simple input interface to interact with the PaLM API, the user would provide the topic and click on the “Generate” button.

App’s initial UI

Note: the code used here is open-source and you can find it at its GitHub repository here.

Now let’s see the output of our app. After clicking on the “Generate” button, our backend will send a request to the PaLM API with the prompt and it will return a response from the LLM, similarly to what we did with MakerSuite, but here we have more flexibility, I requested 3 different outputs and I used Streamlit to customize the UI improving the user experience, below you can see the full picture of the second output from the LLM.

App’s output example

The code is quite simple and intuitive so I won’t go over it here, but go ahead and check it here, if you have any questions or suggestions feel free to create an issue or pull request, I will be glad to discuss it there.

Conclusion

We are entering a new era of machine learning helping humans with many tasks where it excels, our current large language models (LLMs) are so powerful that they help humans even with creative tasks, we saw that with MakerSuite we can prototype LLM-based apps in a matter of minutes, and then use its features to develop products aimed for production setups.


Content creation using MakerSuite and PaLM API was originally published in Google Developer Experts on Medium, where people are continuing the conversation by highlighting and responding to this story.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
npm-projects

npm projects

Next Post
demystifying-uselocation-in-reactjs:-a-beginner’s-guide-to-navigation

Demystifying useLocation in ReactJS: A Beginner’s Guide to Navigation

Related Posts