You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @Ala2hhh .
You are missing the "respondWith" or "returnFormat" or "engine" parameter.
Specify any of them to "readerlm-v2".
Also, the instruction is very important for the model to behave.
Try this:
curl -v -X POST https://r.jina.ai/ \
-H "Accept: text/event-stream" \
-H "Content-Type: application/json" \
-H "X-No-Cache: true" \
-d @- <<EOFEOF { "url": "https://news.ycombinator.com/", "instruction": "Extract the specified information from a list of news threads and present it in a structured JSON format.", "jsonSchema": { "type": "object", "properties": { "title": {"type": "string", "description": "News thread title"}, "url": {"type": "string", "description": "Thread URL"}, "summary": {"type": "string", "description": "Article summary"}, "keywords": {"type": "list", "description": "Descriptive keywords"}, "author": {"type": "string", "description": "Thread author"}, "comments": {"type": "integer", "description": "Comment count"} }, "required": ["title", "url", "date", "points", "author", "comments"] }, "respondWith": "readerlm-v2" }EOFEOF
Speaking of this feature, sometimes I find the model crashes by repeating nonsense words or does not yield enough content, in this case, the parameters of the generation, namely repetition_penalty, and potentially others, need to be further tweaked. However, we currently don't expose these parameters to the API.
So for JSON generation, it's better to run the model locally so you can tweak the parameters.
using the Extract by JSON Schema example provided in the paper, and also can be found in colab
is not giving a response with the provided schema and the data of the output is in MD rather than json
here is the curl command:
Am I calling the API incorrectly?
The text was updated successfully, but these errors were encountered: