• Gooey.AI
  • API: Conversation Analysis for People+AI bot


    📖 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": "Your job is to categorize chat conversations with an AI assistant into JSON structured data about the user and message. \n\nBased on the user\u2019s response, categorize the conversation into the following fields:\n1. user - information about the user such as their name, organization, field, orgsize (organization size) and industry. \n2. ai_use_cases - their use cases for A.I.\n3. ai_concerns - their concerns around A.I. \n\nExample JSON format: \n{\n    \"user\": {\n        \"name\": \"Ravi\",\n        \"organization\": \"Gooey.ai\",\n        \"field\": \"Programmer\",\n        \"orgsize\": \"10\u201d,\n        \u201cindustry\u201d:\u201dtechnology\u201d\n    },\n    \"ai_use_cases\": \"Data Insights\",\n    \"ai_concerns\": \"Bias in AI\"\n}\n\n[Guidelines] \nLimit values for user.industry to: \n1. Education\n2. Healthcare\n3. Agriculture\n4. Climate\n5. Technology\n6. eCommerce\n7. Government\n8. Consulting\n9. Social Impact\n10. Other\n\nLimit values for ai_use_cases to:\nTaskAutomation\nCustomerSupport\nDataInsights\nOther\n\nLimit values for ai_concerns to:\nJobLoss\nDataPrivacy\nBiasInAI\nOther\n\nFocus solely on the user's input messages for categorization and information extraction, not on the assistant\u2019s response. \n\nIf the user\u2019s input message is a greeting such as \u201cHi\u201d or \u201cHello\u201d, return: \n{ \"message\": \"greeting\" }\n\nIf the user's messages do not fit into any predefined categories or don\u2019t contain any relevant information mentioned above, return:\n{ \"message\": \"no_meta_data\" }\n\n[Example Conversation + Analysis pairs]\nConversation: \n\"\"\"\nassistant: Hello! I'm the People+AI bot. At People+AI, our mission is to bring together a diverse group of people and ideas to shape the future of AI that benefits all people. Can you please share your name?    \nuser: Hi\t\n\"\"\"\nAnalysis: { \"message\": \"greeting\" }\n\nConversation: \"\"\"\n\tassistant: Hello! I'm the People Plus A.I. bot. Our mission is to bring together a diverse group of people and ideas to shape the future of A.I. that benefits all people.Can you please share your name?\n\tuser: Tanvi\n\"\"\"\nAnalysis: {\"user\": {\u201cname\u201d:\u201dTanvi\u201d}}\n\nConversation: \"\"\"\n     assistant: Hi Ravi, it's great to connect! Can you please share your field of work and the organization that you are associated with?\n\tuser: I work at Gooey.AI as a programmer\n\"\"\"\nAnalysis: {\"user\": {\u201corganization\u201d: \u201cGooey.AI\u201d, \u201cfield\u201d:\u201dprogrammer\u201d}}\n\nConversation: \"\"\"\n     assistant: What sector does Gooey.AI fall under?\n\tuser: We fall under Technology sector\n\"\"\"\nAnalysis: {\"user\": {\u201cindustry\u201d:\u201dtechnology\u201d}}\n\nConversation: \"\"\"\n\tassistant: Thanks, Sean. Let's brainstorm together! What's a use case or persona at your workplace that will benefit from an A.I. solution?\n\tuser: To answer user questions in my website.\n\"\"\"\nAnalysis: {\u201cai_use_cases\u201d:\u201dCustomerSupport\u201d}\n\nConversation: \"\"\"\n\tassistant: Thanks for your answer, Ravi. Next, What's do you think is the use case at your workplace that will benefit from an A.I. solution?\n\tuser: We want to AI to remove our daily manual tasks like attendance logging\n\"\"\"\nAnalysis: {\u201cai_use_cases\u201d:\u201dTaskAutomation\u201d}\n\nConversation: \"\"\"\n \tassistant: That sounds exciting! AI chatbots indeed have the potential to revolutionize customer service by providing instant responses and 24/7 support. But, what are your concerns about AI in your field of work as a programmer?\n\tuser: I don\u2019t want to give out private information on what I\u2019m working on.\n\"\"\"\nAnalysis: {\u201cai_concerns\u201d:\u201dDataPrivacy\u201d}\n\nConversation: \"\"\"\n\tassistant: {{ assistant_msg }}\n   \tuser: {{ user_msg }}\n\"\"\"\nAnalysis:",
      "selected_models": [
        "gpt_3_5_turbo"
      ]
    };
    
    async function gooeyAPI() {
      const response = await fetch("https://api.gooey.ai/v2/CompareLLM?example_id=5uj1kli6", {
        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": 'Your job is to categorize chat conversations with an AI assistant into JSON structured data about the user and message. \n\nBased on the user’s response, categorize the conversation into the following fields:\n1. user - information about the user such as their name, organization, field, orgsize (organization size) and industry. \n2. ai_use_cases - their use cases for A.I.\n3. ai_concerns - their concerns around A.I. \n\nExample JSON format: \n{\n    "user": {\n        "name": "Ravi",\n        "organization": "Gooey.ai",\n        "field": "Programmer",\n        "orgsize": "10”,\n        “industry”:”technology”\n    },\n    "ai_use_cases": "Data Insights",\n    "ai_concerns": "Bias in AI"\n}\n\n[Guidelines] \nLimit values for user.industry to: \n1. Education\n2. Healthcare\n3. Agriculture\n4. Climate\n5. Technology\n6. eCommerce\n7. Government\n8. Consulting\n9. Social Impact\n10. Other\n\nLimit values for ai_use_cases to:\nTaskAutomation\nCustomerSupport\nDataInsights\nOther\n\nLimit values for ai_concerns to:\nJobLoss\nDataPrivacy\nBiasInAI\nOther\n\nFocus solely on the user\'s input messages for categorization and information extraction, not on the assistant’s response. \n\nIf the user’s input message is a greeting such as “Hi” or “Hello”, return: \n{ "message": "greeting" }\n\nIf the user\'s messages do not fit into any predefined categories or don’t contain any relevant information mentioned above, return:\n{ "message": "no_meta_data" }\n\n[Example Conversation + Analysis pairs]\nConversation: \n"""\nassistant: Hello! I\'m the People+AI bot. At People+AI, our mission is to bring together a diverse group of people and ideas to shape the future of AI that benefits all people. Can you please share your name?    \nuser: Hi\t\n"""\nAnalysis: { "message": "greeting" }\n\nConversation: """\n\tassistant: Hello! I\'m the People Plus A.I. bot. Our mission is to bring together a diverse group of people and ideas to shape the future of A.I. that benefits all people.Can you please share your name?\n\tuser: Tanvi\n"""\nAnalysis: {"user": {“name”:”Tanvi”}}\n\nConversation: """\n     assistant: Hi Ravi, it\'s great to connect! Can you please share your field of work and the organization that you are associated with?\n\tuser: I work at Gooey.AI as a programmer\n"""\nAnalysis: {"user": {“organization”: “Gooey.AI”, “field”:”programmer”}}\n\nConversation: """\n     assistant: What sector does Gooey.AI fall under?\n\tuser: We fall under Technology sector\n"""\nAnalysis: {"user": {“industry”:”technology”}}\n\nConversation: """\n\tassistant: Thanks, Sean. Let\'s brainstorm together! What\'s a use case or persona at your workplace that will benefit from an A.I. solution?\n\tuser: To answer user questions in my website.\n"""\nAnalysis: {“ai_use_cases”:”CustomerSupport”}\n\nConversation: """\n\tassistant: Thanks for your answer, Ravi. Next, What\'s do you think is the use case at your workplace that will benefit from an A.I. solution?\n\tuser: We want to AI to remove our daily manual tasks like attendance logging\n"""\nAnalysis: {“ai_use_cases”:”TaskAutomation”}\n\nConversation: """\n \tassistant: That sounds exciting! AI chatbots indeed have the potential to revolutionize customer service by providing instant responses and 24/7 support. But, what are your concerns about AI in your field of work as a programmer?\n\tuser: I don’t want to give out private information on what I’m working on.\n"""\nAnalysis: {“ai_concerns”:”DataPrivacy”}\n\nConversation: """\n\tassistant: {{ assistant_msg }}\n   \tuser: {{ user_msg }}\n"""\nAnalysis:',
        "selected_models": ["gpt_3_5_turbo"],
    }
    
    response = requests.post(
        "https://api.gooey.ai/v2/CompareLLM?example_id=5uj1kli6",
        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/CompareLLM?example_id=5uj1kli6' \
      -H "Authorization: bearer $GOOEY_API_KEY" \
      -H 'Content-Type: application/json' \
      -d '{
      "input_prompt": "Your job is to categorize chat conversations with an AI assistant into JSON structured data about the user and message. \n\nBased on the user\u2019s response, categorize the conversation into the following fields:\n1. user - information about the user such as their name, organization, field, orgsize (organization size) and industry. \n2. ai_use_cases - their use cases for A.I.\n3. ai_concerns - their concerns around A.I. \n\nExample JSON format: \n{\n    \"user\": {\n        \"name\": \"Ravi\",\n        \"organization\": \"Gooey.ai\",\n        \"field\": \"Programmer\",\n        \"orgsize\": \"10\u201d,\n        \u201cindustry\u201d:\u201dtechnology\u201d\n    },\n    \"ai_use_cases\": \"Data Insights\",\n    \"ai_concerns\": \"Bias in AI\"\n}\n\n[Guidelines] \nLimit values for user.industry to: \n1. Education\n2. Healthcare\n3. Agriculture\n4. Climate\n5. Technology\n6. eCommerce\n7. Government\n8. Consulting\n9. Social Impact\n10. Other\n\nLimit values for ai_use_cases to:\nTaskAutomation\nCustomerSupport\nDataInsights\nOther\n\nLimit values for ai_concerns to:\nJobLoss\nDataPrivacy\nBiasInAI\nOther\n\nFocus solely on the user'"'"'s input messages for categorization and information extraction, not on the assistant\u2019s response. \n\nIf the user\u2019s input message is a greeting such as \u201cHi\u201d or \u201cHello\u201d, return: \n{ \"message\": \"greeting\" }\n\nIf the user'"'"'s messages do not fit into any predefined categories or don\u2019t contain any relevant information mentioned above, return:\n{ \"message\": \"no_meta_data\" }\n\n[Example Conversation + Analysis pairs]\nConversation: \n\"\"\"\nassistant: Hello! I'"'"'m the People+AI bot. At People+AI, our mission is to bring together a diverse group of people and ideas to shape the future of AI that benefits all people. Can you please share your name?    \nuser: Hi\t\n\"\"\"\nAnalysis: { \"message\": \"greeting\" }\n\nConversation: \"\"\"\n\tassistant: Hello! I'"'"'m the People Plus A.I. bot. Our mission is to bring together a diverse group of people and ideas to shape the future of A.I. that benefits all people.Can you please share your name?\n\tuser: Tanvi\n\"\"\"\nAnalysis: {\"user\": {\u201cname\u201d:\u201dTanvi\u201d}}\n\nConversation: \"\"\"\n     assistant: Hi Ravi, it'"'"'s great to connect! Can you please share your field of work and the organization that you are associated with?\n\tuser: I work at Gooey.AI as a programmer\n\"\"\"\nAnalysis: {\"user\": {\u201corganization\u201d: \u201cGooey.AI\u201d, \u201cfield\u201d:\u201dprogrammer\u201d}}\n\nConversation: \"\"\"\n     assistant: What sector does Gooey.AI fall under?\n\tuser: We fall under Technology sector\n\"\"\"\nAnalysis: {\"user\": {\u201cindustry\u201d:\u201dtechnology\u201d}}\n\nConversation: \"\"\"\n\tassistant: Thanks, Sean. Let'"'"'s brainstorm together! What'"'"'s a use case or persona at your workplace that will benefit from an A.I. solution?\n\tuser: To answer user questions in my website.\n\"\"\"\nAnalysis: {\u201cai_use_cases\u201d:\u201dCustomerSupport\u201d}\n\nConversation: \"\"\"\n\tassistant: Thanks for your answer, Ravi. Next, What'"'"'s do you think is the use case at your workplace that will benefit from an A.I. solution?\n\tuser: We want to AI to remove our daily manual tasks like attendance logging\n\"\"\"\nAnalysis: {\u201cai_use_cases\u201d:\u201dTaskAutomation\u201d}\n\nConversation: \"\"\"\n \tassistant: That sounds exciting! AI chatbots indeed have the potential to revolutionize customer service by providing instant responses and 24/7 support. But, what are your concerns about AI in your field of work as a programmer?\n\tuser: I don\u2019t want to give out private information on what I\u2019m working on.\n\"\"\"\nAnalysis: {\u201cai_concerns\u201d:\u201dDataPrivacy\u201d}\n\nConversation: \"\"\"\n\tassistant: {{ assistant_msg }}\n   \tuser: {{ user_msg }}\n\"\"\"\nAnalysis:",
      "selected_models": [
        "gpt_3_5_turbo"
      ]
    }'
    

    🎁 Example Response

    {4 Items
    "id"
    :
    string
    "2vmqfzn7q3eq"
    "url"
    :
    string
    "https://gooey.ai/compare-large-language-models/"
    "created_at"
    :
    string
    "2023-08-25T02:52:41.528663+00:00"
    "output"
    :
    {1 Items
    "output_text"
    :
    {2 Items
    "gpt_4"
    :
    [
    ]1 Items
    "gpt_3_5_turbo"
    :
    [
    ]1 Items
    }
    }
    }

    Please Login to generate the $GOOEY_API_KEY