I'm encountering issues using embeddings with the OpenAI API call module and would appreciate some assistance. Is this functionality supported? My preference is to avoid third-party modules.
I've attempted this multiple times and consistently receive an error similar to: "The operation failed with an error. [400] We could not parse the JSON body of your request. (HINT: This likely means you aren’t using your HTTP library correctly. The OpenAI API expects a JSON payload, but what was sent was not valid JSON. If you have trouble figuring out how to fix this, please contact us through our help center at help.openai.com.)"
This is how I'm attempting it:
It seems there might be an issue with how the request was configured. Here’s a suggestion for what you can try:
Remove the fields you previously set for header 2 and 3. Instead, place them within the request body like this:
json
{
"input": "Your text string goes here",
"model": "text-embedding-3-small"
}
I recommend reviewing the callin.io learning modules that cover API requests. This should be very beneficial for you moving forward.
Hope this helps!
Thank you for your assistance, but unfortunately, the same error persists.
Do you have any further suggestions?
Input
Bundle 1Collection
URL v1/embeddings
Body {“input”: “Your text string goes here”,“model”: “text-embedding-3-small”}
Method POST
HeadersArray
1Collection
Key Content-Type
Value application/json
I also attempted removing the "{", and tried with and without line breaks; all attempts resulted in the same error. I would appreciate any help. Thank you.
I was able to resolve this with your assistance.
I manually substituted the characters " with the same character " and, surprisingly, it functioned correctly. I'm not sure of the exact reason, but it did work. Thank you!