Skip to content

Direct Calling

What is direct calling?

This is simply just the ability to ask the AI model a question, the same as you would do when using ChatGPT or another web client.

This is just included for completeness, so we provided more technical patterns of AI, but also the most straight forward use case too.

Tutorial

We are simply just going to ask a question:

Tell me about the game film Aladdin in under 100 words

To do this you can just simply use this curl command (ensure you have a valid token):

curl --location 'https://ai.jellyfaas.com/query-service/v1/query' --header 'jfwt: <token>' 
--header 'Content-Type: application/json' \
--data '{
    "query": "Tell me about the game film Aladdin in under 100 words"
}'

you will get a result :

{
    "answer": "\"Disney's Aladdin\" is a platforming game based on the 1992 animated film. Players control Aladdin as he traverses various levels inspired by the movie, including the Cave of Wonders and Agrabah's marketplace. Gameplay involves jumping, collecting treasure, and fighting enemies like Abu and the Cave of Wonders' guardian. Aladdin can use items like the magic carpet and his scimitar to overcome obstacles. The game features catchy music from the film and a classic side-scrolling platforming style. \n",
    "query": "Tell me about the game film Aladdin in under 100 words",
    "spanId": "hbPwsvONg",
    "messages": null
}

Using the SDK's

Other query options

REST Options, you can optionally set these when using the SDK too (see the SDK docs):

Key Required Description
query Y The query to ask
ai_platform N Optional of Gemini (default, part of the product, or you can use your own) or OpenAI ChatGPT.
api+key N If you want to bring your own Secret key (for Gemini, or ChatGTP [required])
structured_output N Base64 encoded JSON Schema representing the requested output model