This examples demonstrates the core principles of the Retrieval Augmented Generation (RAG) pattern. You learn how to call OpenAI's embeddings endpoint and how to use the RAG model to generate text based on a given prompt.
The sample covers the following topics:
- Calling the embeddings endpoint
- Use the dot product to calculate the similarity between two vectors
- Use the RAG model to generate text based on a given prompt
- Make yourself familiar with the code in src.
- Try the prompts offered by the app (part of main.ts).
- Come up with additional queries about the product models.
- Think about an application of function calling that would be relevant to your business or personal life.
- Combine the RAG model for product search with function calling (e.g. to retrieve pricing information for a product).