Giter VIP home page Giter VIP logo

chatgpt-product-recommendation-embeddings's Introduction

How to use ChatGPT API to build a chatbot for product recommendations with embeddings

Cover image

Are you looking to build a chatbot that can recommend products to your customers based on their unique profile?
Here's a step-by-step guide that shows you how to build a chatbot using embeddings to match a user's profile with relevant products from a company's database.


Outline

1. Introduction to embeddings

2. Get OpenAI API keys

3. Create a product dataset

4. Create embeddings for product dataset

5. Create a customer profile dataset

6. Create embeddings for customer profile dataset

7. Create embeddings for customer chat message

8. Get previous purchase data similarities

9. Get product database similarities

10. Create ChatGPT API prompt

11. Create ChatGPT product recommendations


Here's what we'll use:

1. OpenAI API ๐Ÿค–

2. Python ๐Ÿ


Detailed walkthrough

Read blog post for a detailed walkthrough: https://norahsakal.com/blog/chatgpt-product-recommendation-embeddings

Troubleshooting

attributeError: module 'openai' has no attribute 'ChatCompletion'

This probably means that the version of your Python client library for the OpenAI API is lower than 0.27.0.

Run pip install openai --upgrade in your terminal for the latest version and make sure it is at least 0.27.0:

Upgrade OpenAI package


InvalidRequestError: This model's maximum context length is 4096 tokens

This indicates that the input message_object sent to the ChatGPT API has exceeded the maximum allowed length of 4096 tokens.

You will need to shorten the length of your messages to resolve the issue:

Upgrade OpenAI package


Do you need help with getting started with the ChatGPT API? Or do you have other questions?
I'm happy to help, don't hesitate to reach out โžก๏ธ [email protected]

chatgpt-product-recommendation-embeddings's People

Contributors

norahsakal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.