📖 To learn more, take a look at our complete API

📤 Example Request

  1. Generate an api key below👇

  2. Install node-fetch & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code and don't use direcly in the browser.

$ npm install node-fetch
$ export GOOEY_API_KEY=sk-xxxx
  1. Use this sample code to call the API.
    If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message.
import fetch from 'node-fetch';

const payload = {
  "input_prompt": "## Agricultural Chatbot QnA Classification Prompt (Reasoning-Based, v0.6)\n\n<!--\nChanges in v0.6:\n- Flattened schema (no `user` / `assistant` nesting)\n- `version` hardcoded to \"0.6\"\n- Retains `scriptVersion` as a top-level variable passed in externally\n-->\n\n\n### OVERVIEW\nYou are classifying single-question interactions between a farmer and a chatbot.  \nEach pair is independent, with no prior context beyond what the assistant says.  \nYour task is to classify **the user\u2019s intent**, **the assistant\u2019s response**, and **the topic**, using reasoning and linguistic understanding \u2014 not keyword heuristics.\n\nEven though each pair stands alone, the assistant\u2019s reply often reveals the user\u2019s real intent.  \nExample:  \nIf the user says \u201cpotato\u201d and the assistant replies with detailed potato advice, then the user\u2019s messageType = **Clarification**, not **CropInfo**.\n\n---\n\n### OUTPUT FORMAT\nProduce a **single JSON object** describing the interaction.\n\n{\n  \"version\": \"0.6\",\n  \"scriptVersion\": \"{{ scriptVersion | default('NOT SET') }}\",\n  \"language\": \"en\",\n  \"valueChain\": \"crop_or_livestock_if_applicable_or_null\",\n  \"subject\": \"subject_label\",\n  \"location\": \"location_if_specified_or_null\",\n  \"messageType\": \"message_type_label\",\n  \"answer\": \"Found|Missing|N/A\",\n  \"answer_type\": \"answer_type_label\"\n}\n\n---\n\n### FIELD DEFINITIONS\n\nversion  \nAlways \"0.6\". Identifies this classification script version.\n\nscriptVersion  \nString (e.g., \"20250807KE\") injected by the calling system \u2014 never inferred.  \nTracks which chatbot recipe produced the QnA.\n\nlanguage  \nISO 639-1 code for the user\u2019s language (e.g., \"en\", \"sw\", \"ny\").  \nIf both user and assistant use different languages, return \"Mixed\".\n\nmessageType  \nUser intent, inferred via reasoning:\n- Greeting  \n- Acknowledgment  \n- Clarification  \n- Question  \n- LocationInfo  \n- PersonalInfo  \n- CropInfo  \n- MediaSharing  \n- Irrelevant  \n\nsubject  \nMain agricultural or meta-topic, inferred primarily from the assistant reply:\n- Crop Management  \n- Plant Health  \n- Soil Management  \n- Water Management  \n- Inputs  \n- Livestock  \n- Weather & Climate  \n- Harvesting & Storage  \n- Farm Equipment  \n- Market Information  \n- Farm Finance  \n- Sustainable Practices  \n- Agricultural Calendar  \n- Technical Referral  \n- Bot Interaction  \n- Irrelevant  \n- General Agriculture  \n\nGuidelines:\n- Use reasoning, not keywords.\n- If vague, infer from the assistant\u2019s detailed advice.\n- If the assistant gives conceptual info only \u2192 \u201cGeneral Agriculture\u201d.\n- Ignore generic or fallback responses.\n\nvalueChain  \nCrops or livestock receiving actionable advice.  \nNormalize to English, comma-separated if multiple.  \nSet null if none or only generically mentioned.\n\nExamples:  \n- \"maize\"  \n- \"tomato,cow\"  \n- null\n\nRules:\n- Include only those directly advised.\n- Don\u2019t include crops mentioned in greetings or examples.\n- \u201cHow can I help you with your potato farming?\u201d \u2192 null.\n\nlocation  \nLocation if explicitly stated (e.g., \"Nessuit\"). Otherwise null.\n\nanswer  \nDid the assistant give useful advice?\n- Found \u2014 gave relevant, actionable info  \n- Missing \u2014 gave no helpful info  \n- N/A \u2014 didn\u2019t attempt to answer (greeted, acknowledged, or requested consent)\n\nanswer_type  \nType of assistant response:\n- DirectCited  \n- DirectUncited  \n- IndirectCited  \n- IndirectUncited  \n- NoAnswer  \n- OutOfScope  \n- ConsentRequired  \n- Greeting  \n- Acknowledgment  \n\n---\n\n### CLASSIFICATION PRINCIPLES\n- Rely mainly on the assistant\u2019s message to infer user intent.\n- Reinterpret short or vague user text when the assistant clarifies context.\n- \u201cI agree\u201d \u2192 Acknowledgment if the assistant accepts it.\n- Use \u201cMissing\u201d only when no actionable advice appears.\n- Never default to \u201cGeneral Agriculture\u201d unless clearly conceptual.\n- \u201cMixed\u201d for code-switching between languages.\n\n---\n\n### EXAMPLES\n\n///  \nConversation:  \nuser: \u2705 I agree  \nassistant: Thank you for agreeing! You can use this platform to ask any questions related to rice farming.  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250807KE\",\"language\":\"en\",\"valueChain\":null,\"subject\":null,\"location\":null,\"messageType\":\"Acknowledgment\",\"answer\":\"N/A\",\"answer_type\":\"Acknowledgment\"}  \n///\n\nConversation:  \nuser: Wadudu wanaoathiri mpunga ni gani?  \nassistant: Assistant lists stem borers, rice bugs, and control measures with a citation.  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250725UG\",\"language\":\"sw\",\"valueChain\":\"rice\",\"subject\":\"Plant Health\",\"location\":null,\"messageType\":\"Question\",\"answer\":\"Found\",\"answer_type\":\"DirectCited\"}  \n///\n\nConversation:  \nuser: Control cabbage rust  \nassistant: Assistant gives detailed disease management for cabbage.  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250730TZ\",\"language\":\"en\",\"valueChain\":\"cabbage\",\"subject\":\"Plant Health\",\"location\":null,\"messageType\":\"Question\",\"answer\":\"Found\",\"answer_type\":\"DirectUncited\"}  \n///\n\nConversation:  \nuser: Potato  \nassistant: Assistant says, \u201cFor potato farming in highlands, use Shangi variety...\u201d  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250807KE\",\"language\":\"en\",\"valueChain\":\"potato\",\"subject\":\"Crop Management\",\"location\":null,\"messageType\":\"Clarification\",\"answer\":\"Found\",\"answer_type\":\"DirectUncited\"}  \n///\n\n---\n\nConversation Template:\n\"\"\"\n   user: {{ user_msg_local }}\n   assistant: {{ assistant_msg_local }}\n\"\"\"\nAnalysis:",
  "selected_models": [
    "gpt_4_1"
  ]
};

async function gooeyAPI() {
  const response = await fetch("https://test.api.gooey.ai/v2/CompareLLM?example_id=s7mcntasd47r", {
    method: "POST",
    headers: {
      "Authorization": "bearer " + process.env["GOOEY_API_KEY"],
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    throw new Error(response.status);
  }

  const result = await response.json();
  console.log(response.status, result);
}

gooeyAPI();
  1. Generate an api key below👇

  2. Install requests & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code.

$ python3 -m pip install requests
$ export GOOEY_API_KEY=sk-xxxx
  1. Use this sample code to call the API.
    If you encounter any issues, write to us at [email protected] and make sure to include the full code snippet and the error message.
import os
import requests

payload = {
    "input_prompt": '## Agricultural Chatbot QnA Classification Prompt (Reasoning-Based, v0.6)\n\n<!--\nChanges in v0.6:\n- Flattened schema (no `user` / `assistant` nesting)\n- `version` hardcoded to "0.6"\n- Retains `scriptVersion` as a top-level variable passed in externally\n-->\n\n\n### OVERVIEW\nYou are classifying single-question interactions between a farmer and a chatbot.  \nEach pair is independent, with no prior context beyond what the assistant says.  \nYour task is to classify **the user’s intent**, **the assistant’s response**, and **the topic**, using reasoning and linguistic understanding — not keyword heuristics.\n\nEven though each pair stands alone, the assistant’s reply often reveals the user’s real intent.  \nExample:  \nIf the user says “potato” and the assistant replies with detailed potato advice, then the user’s messageType = **Clarification**, not **CropInfo**.\n\n---\n\n### OUTPUT FORMAT\nProduce a **single JSON object** describing the interaction.\n\n{\n  "version": "0.6",\n  "scriptVersion": "{{ scriptVersion | default(\'NOT SET\') }}",\n  "language": "en",\n  "valueChain": "crop_or_livestock_if_applicable_or_null",\n  "subject": "subject_label",\n  "location": "location_if_specified_or_null",\n  "messageType": "message_type_label",\n  "answer": "Found|Missing|N/A",\n  "answer_type": "answer_type_label"\n}\n\n---\n\n### FIELD DEFINITIONS\n\nversion  \nAlways "0.6". Identifies this classification script version.\n\nscriptVersion  \nString (e.g., "20250807KE") injected by the calling system — never inferred.  \nTracks which chatbot recipe produced the QnA.\n\nlanguage  \nISO 639-1 code for the user’s language (e.g., "en", "sw", "ny").  \nIf both user and assistant use different languages, return "Mixed".\n\nmessageType  \nUser intent, inferred via reasoning:\n- Greeting  \n- Acknowledgment  \n- Clarification  \n- Question  \n- LocationInfo  \n- PersonalInfo  \n- CropInfo  \n- MediaSharing  \n- Irrelevant  \n\nsubject  \nMain agricultural or meta-topic, inferred primarily from the assistant reply:\n- Crop Management  \n- Plant Health  \n- Soil Management  \n- Water Management  \n- Inputs  \n- Livestock  \n- Weather & Climate  \n- Harvesting & Storage  \n- Farm Equipment  \n- Market Information  \n- Farm Finance  \n- Sustainable Practices  \n- Agricultural Calendar  \n- Technical Referral  \n- Bot Interaction  \n- Irrelevant  \n- General Agriculture  \n\nGuidelines:\n- Use reasoning, not keywords.\n- If vague, infer from the assistant’s detailed advice.\n- If the assistant gives conceptual info only → “General Agriculture”.\n- Ignore generic or fallback responses.\n\nvalueChain  \nCrops or livestock receiving actionable advice.  \nNormalize to English, comma-separated if multiple.  \nSet null if none or only generically mentioned.\n\nExamples:  \n- "maize"  \n- "tomato,cow"  \n- null\n\nRules:\n- Include only those directly advised.\n- Don’t include crops mentioned in greetings or examples.\n- “How can I help you with your potato farming?” → null.\n\nlocation  \nLocation if explicitly stated (e.g., "Nessuit"). Otherwise null.\n\nanswer  \nDid the assistant give useful advice?\n- Found — gave relevant, actionable info  \n- Missing — gave no helpful info  \n- N/A — didn’t attempt to answer (greeted, acknowledged, or requested consent)\n\nanswer_type  \nType of assistant response:\n- DirectCited  \n- DirectUncited  \n- IndirectCited  \n- IndirectUncited  \n- NoAnswer  \n- OutOfScope  \n- ConsentRequired  \n- Greeting  \n- Acknowledgment  \n\n---\n\n### CLASSIFICATION PRINCIPLES\n- Rely mainly on the assistant’s message to infer user intent.\n- Reinterpret short or vague user text when the assistant clarifies context.\n- “I agree” → Acknowledgment if the assistant accepts it.\n- Use “Missing” only when no actionable advice appears.\n- Never default to “General Agriculture” unless clearly conceptual.\n- “Mixed” for code-switching between languages.\n\n---\n\n### EXAMPLES\n\n///  \nConversation:  \nuser: ✅ I agree  \nassistant: Thank you for agreeing! You can use this platform to ask any questions related to rice farming.  \nAnalysis: {"version":"0.6","scriptVersion":"20250807KE","language":"en","valueChain":null,"subject":null,"location":null,"messageType":"Acknowledgment","answer":"N/A","answer_type":"Acknowledgment"}  \n///\n\nConversation:  \nuser: Wadudu wanaoathiri mpunga ni gani?  \nassistant: Assistant lists stem borers, rice bugs, and control measures with a citation.  \nAnalysis: {"version":"0.6","scriptVersion":"20250725UG","language":"sw","valueChain":"rice","subject":"Plant Health","location":null,"messageType":"Question","answer":"Found","answer_type":"DirectCited"}  \n///\n\nConversation:  \nuser: Control cabbage rust  \nassistant: Assistant gives detailed disease management for cabbage.  \nAnalysis: {"version":"0.6","scriptVersion":"20250730TZ","language":"en","valueChain":"cabbage","subject":"Plant Health","location":null,"messageType":"Question","answer":"Found","answer_type":"DirectUncited"}  \n///\n\nConversation:  \nuser: Potato  \nassistant: Assistant says, “For potato farming in highlands, use Shangi variety...”  \nAnalysis: {"version":"0.6","scriptVersion":"20250807KE","language":"en","valueChain":"potato","subject":"Crop Management","location":null,"messageType":"Clarification","answer":"Found","answer_type":"DirectUncited"}  \n///\n\n---\n\nConversation Template:\n"""\n   user: {{ user_msg_local }}\n   assistant: {{ assistant_msg_local }}\n"""\nAnalysis:',
    "selected_models": ["gpt_4_1"],
}

response = requests.post(
    "https://test.api.gooey.ai/v2/CompareLLM?example_id=s7mcntasd47r",
    headers={
        "Authorization": "bearer " + os.environ["GOOEY_API_KEY"],
    },
    json=payload,
)
assert response.ok, response.content

result = response.json()
print(response.status_code, result)
  1. Generate an api key below👇

  2. Install curl & add the GOOEY_API_KEY to your environment variables.
    Never store the api key in your code.

export GOOEY_API_KEY=sk-xxxx
  1. Run the following curl command in your terminal.
    If you encounter any issues, write to us at [email protected] and make sure to include the full curl command and the error message.
curl 'https://test.api.gooey.ai/v2/CompareLLM?example_id=s7mcntasd47r' \
  -H "Authorization: bearer $GOOEY_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "input_prompt": "## Agricultural Chatbot QnA Classification Prompt (Reasoning-Based, v0.6)\n\n<!--\nChanges in v0.6:\n- Flattened schema (no `user` / `assistant` nesting)\n- `version` hardcoded to \"0.6\"\n- Retains `scriptVersion` as a top-level variable passed in externally\n-->\n\n\n### OVERVIEW\nYou are classifying single-question interactions between a farmer and a chatbot.  \nEach pair is independent, with no prior context beyond what the assistant says.  \nYour task is to classify **the user\u2019s intent**, **the assistant\u2019s response**, and **the topic**, using reasoning and linguistic understanding \u2014 not keyword heuristics.\n\nEven though each pair stands alone, the assistant\u2019s reply often reveals the user\u2019s real intent.  \nExample:  \nIf the user says \u201cpotato\u201d and the assistant replies with detailed potato advice, then the user\u2019s messageType = **Clarification**, not **CropInfo**.\n\n---\n\n### OUTPUT FORMAT\nProduce a **single JSON object** describing the interaction.\n\n{\n  \"version\": \"0.6\",\n  \"scriptVersion\": \"{{ scriptVersion | default('"'"'NOT SET'"'"') }}\",\n  \"language\": \"en\",\n  \"valueChain\": \"crop_or_livestock_if_applicable_or_null\",\n  \"subject\": \"subject_label\",\n  \"location\": \"location_if_specified_or_null\",\n  \"messageType\": \"message_type_label\",\n  \"answer\": \"Found|Missing|N/A\",\n  \"answer_type\": \"answer_type_label\"\n}\n\n---\n\n### FIELD DEFINITIONS\n\nversion  \nAlways \"0.6\". Identifies this classification script version.\n\nscriptVersion  \nString (e.g., \"20250807KE\") injected by the calling system \u2014 never inferred.  \nTracks which chatbot recipe produced the QnA.\n\nlanguage  \nISO 639-1 code for the user\u2019s language (e.g., \"en\", \"sw\", \"ny\").  \nIf both user and assistant use different languages, return \"Mixed\".\n\nmessageType  \nUser intent, inferred via reasoning:\n- Greeting  \n- Acknowledgment  \n- Clarification  \n- Question  \n- LocationInfo  \n- PersonalInfo  \n- CropInfo  \n- MediaSharing  \n- Irrelevant  \n\nsubject  \nMain agricultural or meta-topic, inferred primarily from the assistant reply:\n- Crop Management  \n- Plant Health  \n- Soil Management  \n- Water Management  \n- Inputs  \n- Livestock  \n- Weather & Climate  \n- Harvesting & Storage  \n- Farm Equipment  \n- Market Information  \n- Farm Finance  \n- Sustainable Practices  \n- Agricultural Calendar  \n- Technical Referral  \n- Bot Interaction  \n- Irrelevant  \n- General Agriculture  \n\nGuidelines:\n- Use reasoning, not keywords.\n- If vague, infer from the assistant\u2019s detailed advice.\n- If the assistant gives conceptual info only \u2192 \u201cGeneral Agriculture\u201d.\n- Ignore generic or fallback responses.\n\nvalueChain  \nCrops or livestock receiving actionable advice.  \nNormalize to English, comma-separated if multiple.  \nSet null if none or only generically mentioned.\n\nExamples:  \n- \"maize\"  \n- \"tomato,cow\"  \n- null\n\nRules:\n- Include only those directly advised.\n- Don\u2019t include crops mentioned in greetings or examples.\n- \u201cHow can I help you with your potato farming?\u201d \u2192 null.\n\nlocation  \nLocation if explicitly stated (e.g., \"Nessuit\"). Otherwise null.\n\nanswer  \nDid the assistant give useful advice?\n- Found \u2014 gave relevant, actionable info  \n- Missing \u2014 gave no helpful info  \n- N/A \u2014 didn\u2019t attempt to answer (greeted, acknowledged, or requested consent)\n\nanswer_type  \nType of assistant response:\n- DirectCited  \n- DirectUncited  \n- IndirectCited  \n- IndirectUncited  \n- NoAnswer  \n- OutOfScope  \n- ConsentRequired  \n- Greeting  \n- Acknowledgment  \n\n---\n\n### CLASSIFICATION PRINCIPLES\n- Rely mainly on the assistant\u2019s message to infer user intent.\n- Reinterpret short or vague user text when the assistant clarifies context.\n- \u201cI agree\u201d \u2192 Acknowledgment if the assistant accepts it.\n- Use \u201cMissing\u201d only when no actionable advice appears.\n- Never default to \u201cGeneral Agriculture\u201d unless clearly conceptual.\n- \u201cMixed\u201d for code-switching between languages.\n\n---\n\n### EXAMPLES\n\n///  \nConversation:  \nuser: \u2705 I agree  \nassistant: Thank you for agreeing! You can use this platform to ask any questions related to rice farming.  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250807KE\",\"language\":\"en\",\"valueChain\":null,\"subject\":null,\"location\":null,\"messageType\":\"Acknowledgment\",\"answer\":\"N/A\",\"answer_type\":\"Acknowledgment\"}  \n///\n\nConversation:  \nuser: Wadudu wanaoathiri mpunga ni gani?  \nassistant: Assistant lists stem borers, rice bugs, and control measures with a citation.  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250725UG\",\"language\":\"sw\",\"valueChain\":\"rice\",\"subject\":\"Plant Health\",\"location\":null,\"messageType\":\"Question\",\"answer\":\"Found\",\"answer_type\":\"DirectCited\"}  \n///\n\nConversation:  \nuser: Control cabbage rust  \nassistant: Assistant gives detailed disease management for cabbage.  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250730TZ\",\"language\":\"en\",\"valueChain\":\"cabbage\",\"subject\":\"Plant Health\",\"location\":null,\"messageType\":\"Question\",\"answer\":\"Found\",\"answer_type\":\"DirectUncited\"}  \n///\n\nConversation:  \nuser: Potato  \nassistant: Assistant says, \u201cFor potato farming in highlands, use Shangi variety...\u201d  \nAnalysis: {\"version\":\"0.6\",\"scriptVersion\":\"20250807KE\",\"language\":\"en\",\"valueChain\":\"potato\",\"subject\":\"Crop Management\",\"location\":null,\"messageType\":\"Clarification\",\"answer\":\"Found\",\"answer_type\":\"DirectUncited\"}  \n///\n\n---\n\nConversation Template:\n\"\"\"\n   user: {{ user_msg_local }}\n   assistant: {{ assistant_msg_local }}\n\"\"\"\nAnalysis:",
  "selected_models": [
    "gpt_4_1"
  ]
}'

🎁 Example Response

{4 Items
"id"
:
string
"bedlky5nhpm2"
"url"
:
string
"https://test.gooey.ai/compare-large-language-model"
"created_at"
:
string
"2025-10-31T17:31:22.828005+00:00"
"output"
:
{1 Items
"output_text"
:
{1 Items
"gpt_4_1"
:
[
]1 Items
}
}
}

Please Login to generate the $GOOEY_API_KEY