Processing text

LLMs are very capable text processors. You can use them for a variety of text related tasks. Below is a subset of common use cases and patterns of using them.

Reasoning

Making models reason through its response is a powerful technique that improves the quality of responses. By adding a thoughts field as the first field in the output schema you can make the model first express how it thinks about forming the response, this is called chain of thought.

Planning

It is possible to further improve reasoning by also adding a steps field to the output schema. This lets the model first be very diligent about the steps it needs to take to solve the problem, thereby improving the final answer.

Extracting information

You can use LLMs to extract structured data from text and images. This can be usedful to make these entities programmable.

Here is a simple example where we extract a structured Room object from a text string.

Selecting from options

You can use LLMs to make decisions, perform selection and reason about them. This can be useful for building things like recommendation systems and next steps.

Here we have an example of providing a recommendation of additional things for a user to buy based on past purchase history

Performing classification

You can use LLMs to classify text and images. This can be useful to solve various categorization problems.

Here is an example of classifies an input text, thought of as being a support request, into one of the four categories: Bug, Feature Request, Question or Unknown.