Skip to content
    WhenandHowtoUseAI@EmirhanAkdeniz1
    main.py
    Packager files
    poetry.lock
    pyproject.toml
    Config files
    .replit
    replit.nix
    ## This is a logical questionnaire on 'When and How to use AI Solutions in your Product'
    ## It is originally published in https://serpapi.com/blog/when-and-how-to-use-ai-solutions-in-your-product/

    indications = ""

    ## Bug Reporting ##

    bug_report_questions = [{
    "question":
    "Does it take time for engineers to report bugs in your feature?"
    }, {
    "question":
    "Does it take time for customers to report bugs in your feature?"
    }]

    bug_report_indications = [{
    "answers": [1, 0],
    "indication":
    "It takes time only for your engineers to report bugs."
    }, {
    "answers": [1, 1],
    "indication":
    "It takes time for both your engineers and customers to report bugs."
    }, {
    "answers": [0, 0],
    "indication":
    "It doesn't take time to report bugs for engineers or customers. You have an automated bug reporting system."
    }, {
    "answers": [1, 1],
    "indication":
    "It takes time only for your customers to report bugs."
    }]

    bug_answers = []
    for question in bug_report_questions:
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    while True:
    answer = input()
    if answer == '':
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    elif answer == "1":
    bug_answers.append(1)
    break
    else:
    bug_answers.append(0)
    break
    print("\n --- \n")

    for bug_report_indication in bug_report_indications:
    if bug_report_indication["answers"] == bug_answers:
    indications = indications + "\n" + bug_report_indication["indication"]
    break

    ## Maintaining ##

    maintainability_questions = [{
    "prequisites": [[1, 0], [1, 1]],
    "question":
    "Does it take some time between bug reporting and fixing the feature of your service that affects the productivity of the customers?"
    }, {
    "prequisites": [[0, 0], [1, 1]],
    "question":
    "Do you have some kind of automated maintenance system that takes less engineer intervention for the feature?"
    }]

    maintainability_indications = [{
    "answers": [1, 1],
    "indication":
    "Your team is spending some time and distupting customer although you have some sort of automated system."
    }, {
    "answers": [1, 0],
    "indication":
    "Your team is doing its usual but still disrupting the customer for some time. You don't have an automated system to alliviate time loss."
    }, {
    "answers": [0, 1],
    "indication":
    "Your team is using an automated system to maintain the feature. Customers are happy with which speed of bug resolution."
    }, {
    "answers": [0, 0],
    "indication":
    "No significant fix time, and not any kind of automated maintenance system? Congratulations! You are most probably fooling yourself."
    }]

    maintainability_answers = []
    for question in maintainability_questions:
    if bug_answers in question["prequisites"]:
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    while True:
    answer = input()
    if answer == '':
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    elif answer == "1":
    maintainability_answers.append(1)
    break
    else:
    maintainability_answers.append(0)
    break
    print("\n --- \n")

    if maintainability_answers == [0, 1]:
    easy_to_maintain = 1
    else:
    easy_to_maintain = 0

    for maintainability_indication in maintainability_indications:
    if maintainability_indication["answers"] == maintainability_answers:
    indications = indications + "\n" + maintainability_indication["indication"]
    break

    ## Customer Demands ##

    customer_wants_precision = 0
    customer_wants_inexpensiveness = 0
    customer_wants_speed = 0

    customer_demand_questions = [{
    "question":
    "Does the customer demand a PRECISE solution for that feature?"
    }, {
    "question":
    "Does the customer demand a CHEAP solution for that feature?"
    }, {
    "question":
    "Does the customer demand a FAST solution for that feature?"
    }]

    customer_demand_indications = [{
    "answers": [1, 0, 0, 1],
    "indication":
    "The Customer demands PRECISION only from the feature, and the feature is EASY to maintain."
    }, {
    "answers": [0, 1, 0, 1],
    "indication":
    "The Customer demands INEXPENSIVENESS only from the feature, and the feature is EASY to maintain."
    }, {
    "answers": [0, 0, 1, 1],
    "indication":
    "The Customer demands INEXPENSIVENESS only from the feature, and the feature is EASY to maintain."
    }, {
    "answers": [1, 0, 0, 0],
    "indication":
    "The Customer demands PRECISION only from the feature, and the feature is HARD to maintain."
    }, {
    "answers": [0, 1, 0, 0],
    "indication":
    "The Customer demands INEXPENSIVENESS only from the feature, and the feature is HARD to maintain."
    }, {
    "answers": [0, 1, 1, 1],
    "indication":
    "The Customer demands INEXPENSIVENESS and FASTNESS from the feature, and the feature is EASY to maintain."
    }, {
    "answers": [1, 0, 1, 1],
    "indication":
    "The Customer demands PRECISION and SPEED from the feature, and the feature is EASY to maintain."
    }, {
    "answers": [1, 1, 0, 1],
    "indication":
    "The Customer demands PRECISION and INEXPENSIVENESS from the feature, and the feature is EASY to maintain."
    }, {
    "answers": [0, 1, 1, 0],
    "indication":
    "The Customer demands INEXPENSIVENESS and FASTNESS from the feature, and the feature is HARD to maintain."
    }, {
    "answers": [1, 0, 1, 0],
    "indication":
    "The Customer demands PRECISION and SPEED from the feature, and the feature is HARD to maintain."
    }, {
    "answers": [1, 1, 0, 0],
    "indication":
    "The Customer demands PRECISION and INEXPENSIVENESS from the feature, and the feature is HARD to maintain."
    }, {
    "answers": [1, 1, 1, 1],
    "indication":
    "The Customer demands PRECISION, INEXPENSIVENESS, and SPEED from the feature, and the feature is EASY to maintain."
    }, {
    "answers": [1, 1, 1, 0],
    "indication":
    "The Customer demands PRECISION, INEXPENSIVENESS, and SPEED from the feature, and the feature is HARD to maintain."
    }]

    customer_answers = []
    for question in customer_demand_questions:
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    while True:
    answer = input()
    if answer == '':
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    elif answer == "1":
    customer_answers.append(1)
    break
    else:
    customer_answers.append(0)
    break
    print("\n --- \n")

    for customer_demand_indication in customer_demand_indications:
    if customer_demand_indication["answers"] == customer_answers + [
    easy_to_maintain
    ]:
    indications = indications + "\n" + customer_demand_indication["indication"]
    break

    customer_answers = customer_answers + [easy_to_maintain]

    ## AI Capabilities ##

    ai_capability_questions = [{
    "question":
    "Does the AI solution provide a more or equally PRECISE result than the feature of your service?",
    }, {
    "question":
    "Does the AI solution provide an INEXPENSIVE result than the feature of your service?"
    }, {
    "question":
    "Does the AI solution provide a FASTER result than the feature of your service?"
    }, {
    "question":
    "Is the AI solution EASY to maintain than the feature of your service?"
    }]

    ai_capability_indications = [
    {
    "answers": [0, 0, 0, 1],
    "indication":
    "AI Solution is better at MAINTAINABILITY. AI solution is worse at PRECISION, PRICE, and SPEED."
    },
    {
    "answers": [1, 0, 0, 0],
    "indication":
    "AI Solution is better at PRECISION. AI solution is worse at MAINTAINABILITY, PRICE, and SPEED."
    },
    {
    "answers": [0, 1, 0, 0],
    "indication":
    "AI Solution is better at PRICE. AI solution is worse at MAINTAINABILITY, PRECISION, and SPEED."
    },
    {
    "answers": [0, 0, 1, 0],
    "indication":
    "AI Solution is better at SPEED. AI solution is worse at MAINTAINABILITY, PRECISION, and PRICE."
    },
    {
    "answers": [0, 1, 0, 1],
    "indication":
    "AI Solution is better at PRICE, and MAINTAINABILITY. AI solution is worse at SPEED, and PRECISION."
    },
    {
    "answers": [0, 1, 1, 0],
    "indication":
    "AI Solution is better at PRICE, and SPEED. AI solution is worse at MAINTAINABILITY, and PRECISION."
    },
    {
    "answers": [1, 0, 0, 1],
    "indication":
    "AI Solution is better at MAINTAINABILITY, and PRECISION. AI solution is worse at PRICE, and SPEED."
    },
    {
    "answers": [1, 0, 1, 0],
    "indication":
    "AI Solution is better at SPEED, and PRECISION. AI solution is worse at PRICE, and MAINTAINABILITY."
    },
    {
    "answers": [1, 1, 0, 0],
    "indication":
    "AI Solution is better at PRICE, and PRECISION. AI solution is worse at SPEED, and MAINTAINABILITY."
    },
    {
    "answers": [0, 1, 0, 1],
    "indication":
    "AI Solution is better at SPEED, and MAINTAINABILITY. AI solution is worse at PRICE, and PRECISION."
    },
    {
    "answers": [1, 1, 0, 1],
    "indication":
    "AI Solution is better at PRECISION, MAINTAINABILITY, and PRICE. AI solution is worse at SPEED."
    },
    {
    "answers": [1, 1, 1, 0],
    "indication":
    "AI Solution is better at PRECISION, SPEED, and PRICE. AI solution is worse at MAINTAINABILITY."
    },
    {
    "answers": [1, 0, 1, 1],
    "indication":
    "AI Solution is better at PRECISION, SPEED, and MAINTAINABILITY. AI solution is worse at PRICE."
    },
    {
    "answers": [0, 1, 1, 1],
    "indication":
    "AI Solution is better at PRICE, SPEED, and MAINTAINABILITY. AI solution is worse at PRECISION."
    },
    {
    "answers": [1, 1, 1, 1],
    "indication":
    "AI Solution is better at PRICE, SPEED, MAINTAINABILITY, and PRECISION."
    },
    ]

    ai_answers = []
    for question in ai_capability_questions:
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    while True:
    answer = input()
    if answer == '':
    print("\n --- \n")
    print(question["question"])
    print("1) YES\n2) NO \n --- \n")
    elif answer == "1":
    ai_answers.append(1)
    break
    else:
    ai_answers.append(0)
    break
    print("\n --- \n")

    if ai_answers[3] == 1:
    ai_is_easy_to_maintain = 1
    else:
    ai_is_easy_to_maintain = 0

    for ai_indication in ai_capability_indications:
    if ai_indication["answers"] == ai_answers:
    indications = indications + "\n" + ai_indication["indication"]
    break

    ## General Indications ##


    def check_both_maintainability(easy_to_maintain, ai_is_easy_to_maintain):
    if ai_is_easy_to_maintain == 1 and easy_to_maintain == 1:
    both_maintainability = "easy"
    elif ai_is_easy_to_maintain and easy_to_maintain == 0:
    both_maintainability = "hard"
    else:
    both_maintainability = "nope"

    return both_maintainability


    def give_full_indications(indications, results, both_maintainability):
    if results[0:3].count(0) == 1:
    if results[0] == 0:
    indications = indications + "\n" + "You can use the precision of AI as a supportive tool for tasks such as bug reporting or maintenance to enhance your current feature."
    else:
    indications + "\n" + "There is no need for an AI for now."
    elif results[0:3].count(0) == 2:
    if results[0] == 1 or results[0] == -1:
    if results[3] == -1:
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for a higher price to compansate for maintainability. You need to make sure that the maintainability cost isn't more than the profit."
    elif results[3] == 0 and both_maintainability == "hard":
    indications = indications + "\n" + "You already have a hard maintenance. Having hard maintenance on AI for anything will complicate things"
    elif results[3] == 0 and both_maintainability == "easy":
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for same or a higher price for profit. Your maintainability is easy as is, so it's time to turn it into a advantage."
    elif results[3] == 1:
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for same or a higher price for profit."
    elif results[0] == 0:
    if results[3] == -1:
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for a higher price to compansate for maintainability. You need to make sure that the maintainability cost isn't more than the profit."
    elif results[3] == 0 and both_maintainability == "hard":
    indications = indications + "\n" + "You already have a hard maintenance. Having hard maintenance on AI for anything will complicate things"
    elif results[3] == 0 and both_maintainability == "easy":
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for same or a higher price for profit. Your maintainability is easy as is, so it's time to turn it into a advantage. Alternatively, you can use the precision of AI as a supportive tool for tasks such as bug reporting or maintenance to enhance your current feature."
    elif results[3] == 1:
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for same or a higher price for profit. Alternatively, you can use the precision of AI as a supportive tool for tasks such as bug reporting or maintenance to enhance your current feature."
    else:
    if results[3] == -1:
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for a higher price to compansate for maintainability. You need to make sure that the maintainability cost isn't more than the profit."
    elif results[3] == 0 and both_maintainability == "hard":
    indications = indications + "\n" + "You already have a hard maintenance. Having hard maintenance on AI for anything will complicate things"
    elif results[3] == 0 and both_maintainability == "easy":
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for same or a higher price for profit. Your maintainability is easy as is, so it's time to turn it into a advantage."
    elif results[3] == 1:
    indications = indications + "\n" + "You need to make a market research to see if a subgroup is demaning such traits as a separate feature for same or a higher price for profit."
    elif results[0:3].count(0) == 3:
    if results[3] == -1:
    indications = indications + "\n" + "You need to wait for better maintainability and jump on the boat with AI. Try doing some other integrations in your company to create culture."
    elif results[3] == 0 and both_maintainability == "hard":
    indications = indications + "\n" + "You already have a hard maintenance. Having hard maintenance on AI for anything will complicate things."
    elif results[3] == 0 and both_maintainability == "easy":
    indications = indications + "\n" + "You need to start transforming the feature of your product with AI. Your maintainability is easy as is, so it's time to turn it into a advantage, and make a gradual but fast change."
    elif results[3] == 1:
    indications = indications + "\n" + "You need to start transforming the feature of your product with AI. There is no better condition than this."
    elif results[0:3].count(-1) == 3:
    indications + "\n" + "There is no need for an AI for now."
    elif results[0:3].count(1) == 3:
    indications + "\n" + "No demand, you are fooling yourself."

    return indications


    both_maintainability = check_both_maintainability(easy_to_maintain,
    ai_is_easy_to_maintain)

    results = []
    for ai, customer in zip(ai_answers, customer_answers):
    results.append(ai - customer)

    indications = give_full_indications(indications, results, both_maintainability)

    print(indications)