I’m trying to use this endpoints. https://platform.openai.com/docs/guides/classifications I want to classify some text by sentiment.
Dataset sample:
{"prompt": "This film exceeded my expectations. The visuals were stunning, and the performances were top-notch.", "completion": "Positive"}
{"prompt": "I couldn't connect with the characters, and the story felt predictable. Not a memorable movie for me.", "completion": "Negative"}
I added a file using this curl for request and got a successful response:
curl https://api.openai.com/v1/files \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-F purpose="fine-tune" \
-F file="@train.jsonl"
I got this reponse:
"object": "file",
"id": "file-..dcndnjnjdsjn",
"purpose": "fine-tune",
"filename": "train.jsonl",
"bytes": 3208,
"created_at": 1686572774,
"status": "uploaded",
"status_details": null
After adding file succesfully I’m trying to use this file_id in this endpoint:
curl https://api.openai.com/v1/classifications \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"file": "file-hRsoFZ4J3dNoiTeudHesgPoh",
"query": "movie is very good",
"search_model": "ada",
"model": "curie",
"max_examples": 3
}'
Then I got this error constantly:
"error": {
"message": "Invalid URL (POST /v1/classifications)",
"type": "invalid_request_error",
"param": null,
"code": null
}
Am I sending request to the wrong endpoint?