Hi, I’ll say straight away that I recently approached AI.
I have already used the openai API to use chat completions with excellent results.
I wanted to move on to the next step: creating a chatbot that responds based on a context. I know I have to use embeddings but everything I’ve found uses python, which isn’t my language.
I use php and in particular an old version (in fact I don’t use curl). Can anyone help me understand how I can use curl for embedding?
I saw this piece of code from the documentation:
curl https://api.openai.com/v1/embeddings \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": "The food was delicious and the waiter...",
"model": "text-embedding-ada-002",
"encoding_format": "float"
}'
but I don’t understand how to use it in the chatbot and how to do embedding starting from data contained in a website or in a document.