• Gooey.AI
  • API: Impact: Bank.CHAT for Financial literacy


    📖 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": "what's BC?",
      "messages": [
        {
          "role": "user",
          "content": "Hi"
        },
        {
          "role": "assistant",
          "content": "Welcome to Farmer.CHAT. I'm an AI \ud83e\udd16 designed to help farmers and extension agents. Send me a text or \ud83c\udf99\ufe0fvoice note with any farming question and I'll give you an answer based on recommendations and best practices from other farmers like you. I'm constantly trying to improve, so please give me your feedback by tapping the \ud83d\udc4d\ud83c\udffe \ud83d\udc4e\ud83c\udffd buttons.  Now, what would you like to know? \ud83c\udf31"
        },
        {
          "role": "user",
          "content": "Hello"
        },
        {
          "role": "assistant",
          "content": "Hello! How can I assist you today?"
        },
        {
          "role": "user",
          "content": "What saving advice would you have for me?"
        },
        {
          "role": "assistant",
          "content": "According to the financial literacy guide, there are a few ways to save money. One way is to reduce expenses on non-essential items by spending judiciously. For example, if you're drinking 4 cups of tea every day, you could consider reducing it to 2 cups and save the money you would have spent on the extra cups. Another way to save is by depositing your savings in a bank account, as it is safer and your money can grow through interest. It's important to save regularly so that you have enough money for emergencies, unexpected events, lean periods, old age, and for purchasing things you cannot afford from regular income. By maintaining a financial diary, you can track your expenses and identify areas where you can cut back spending and increase savings. Remember, the longer you save, the more your savings will grow."
        }
      ]
    };
    
    async function gooeyAPI() {
      const response = await fetch("https://api.gooey.ai/v2/video-bots?example_id=stpdnoyd", {
        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": "what's BC?",
        "messages": [
            {"role": "user", "content": "Hi"},
            {
                "role": "assistant",
                "content": "Welcome to Farmer.CHAT. I'm an AI 🤖 designed to help farmers and extension agents. Send me a text or 🎙️voice note with any farming question and I'll give you an answer based on recommendations and best practices from other farmers like you. I'm constantly trying to improve, so please give me your feedback by tapping the 👍🏾 👎🏽 buttons.  Now, what would you like to know? 🌱",
            },
            {"role": "user", "content": "Hello"},
            {"role": "assistant", "content": "Hello! How can I assist you today?"},
            {"role": "user", "content": "What saving advice would you have for me?"},
            {
                "role": "assistant",
                "content": "According to the financial literacy guide, there are a few ways to save money. One way is to reduce expenses on non-essential items by spending judiciously. For example, if you're drinking 4 cups of tea every day, you could consider reducing it to 2 cups and save the money you would have spent on the extra cups. Another way to save is by depositing your savings in a bank account, as it is safer and your money can grow through interest. It's important to save regularly so that you have enough money for emergencies, unexpected events, lean periods, old age, and for purchasing things you cannot afford from regular income. By maintaining a financial diary, you can track your expenses and identify areas where you can cut back spending and increase savings. Remember, the longer you save, the more your savings will grow.",
            },
        ],
    }
    
    response = requests.post(
        "https://api.gooey.ai/v2/video-bots?example_id=stpdnoyd",
        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://api.gooey.ai/v2/video-bots?example_id=stpdnoyd' \
      -H "Authorization: bearer $GOOEY_API_KEY" \
      -H 'Content-Type: application/json' \
      -d '{
      "input_prompt": "what'"'"'s BC?",
      "messages": [
        {
          "role": "user",
          "content": "Hi"
        },
        {
          "role": "assistant",
          "content": "Welcome to Farmer.CHAT. I'"'"'m an AI \ud83e\udd16 designed to help farmers and extension agents. Send me a text or \ud83c\udf99\ufe0fvoice note with any farming question and I'"'"'ll give you an answer based on recommendations and best practices from other farmers like you. I'"'"'m constantly trying to improve, so please give me your feedback by tapping the \ud83d\udc4d\ud83c\udffe \ud83d\udc4e\ud83c\udffd buttons.  Now, what would you like to know? \ud83c\udf31"
        },
        {
          "role": "user",
          "content": "Hello"
        },
        {
          "role": "assistant",
          "content": "Hello! How can I assist you today?"
        },
        {
          "role": "user",
          "content": "What saving advice would you have for me?"
        },
        {
          "role": "assistant",
          "content": "According to the financial literacy guide, there are a few ways to save money. One way is to reduce expenses on non-essential items by spending judiciously. For example, if you'"'"'re drinking 4 cups of tea every day, you could consider reducing it to 2 cups and save the money you would have spent on the extra cups. Another way to save is by depositing your savings in a bank account, as it is safer and your money can grow through interest. It'"'"'s important to save regularly so that you have enough money for emergencies, unexpected events, lean periods, old age, and for purchasing things you cannot afford from regular income. By maintaining a financial diary, you can track your expenses and identify areas where you can cut back spending and increase savings. Remember, the longer you save, the more your savings will grow."
        }
      ]
    }'
    

    🎁 Example Response

    {4 Items
    "id"
    :
    string
    "727csf173ufj"
    "url"
    :
    string
    "https://gooey.ai/copilot/"
    "created_at"
    :
    string
    "2024-01-23T16:07:34.376506+00:00"
    "output"
    :
    {13 Items
    "final_prompt"
    :
    [8 Items
    0
    :
    {
    }2 Items
    1
    :
    {
    }2 Items
    2
    :
    {
    }2 Items
    3
    :
    {
    }2 Items
    4
    :
    {
    }2 Items
    5
    :
    {
    }2 Items
    6
    :
    {
    }2 Items
    7
    :
    {
    }2 Items
    ]
    "output_text"
    :
    [1 Items
    0
    :
    string
    "BC stands for Business Correspondent, who are loca"
    ]
    "output_audio"
    :
    [1 Items
    0
    :
    string
    "https://storage.googleapis.com/dara-c1b52.appspot."
    ]
    "output_video"
    :
    [
    ]0 Items
    "raw_input_text"
    :
    string
    "what's BC?"
    "raw_tts_text"
    :
    NULL
    "raw_output_text"
    :
    [1 Items
    0
    :
    string
    "BC stands for Business Correspondent, who are loca"
    ]
    "references"
    :
    [3 Items
    0
    :
    {
    }4 Items
    1
    :
    {
    }4 Items
    2
    :
    {
    }4 Items
    ]
    "final_search_query"
    :
    string
    "BC stands for "Before Christ." It is used to refer"
    "final_keyword_query"
    :
    NULL
    "output_documents"
    :
    NULL
    "reply_buttons"
    :
    NULL
    "finish_reason"
    :
    NULL
    }
    }

    Please Login to generate the $GOOEY_API_KEY