awr7 / MoM

0 stars 0 forks source link

Add resiliency logic to the king function #7

Closed scybersec closed 4 months ago

scybersec commented 4 months ago

If one of the models error out the program should still run with the one's that did give a response back.

awr7 commented 4 months ago

I think the threadPoolExecutor() already does that. In the king function we check for exceptions using the try-except block and if a error occurs we log it but the program continues.

relevant part of the code:


    with tqdm(total=len(models), desc="Gathering insights from advisors", unit="task") as progress_bar:
        with concurrent.futures.ThreadPoolExecutor() as executor:
            futures_to_model = {executor.submit(model_func, prompt): model_name for model_name, model_func in models.items()}
            for future in concurrent.futures.as_completed(futures_to_model):
                model_name = futures_to_model[future]
                try:
                    answers[model_name] = future.result()
                    color = color_mapping.get(model_name, RESET_COLOR)
                    print(f"\n{color}{model_name}'s advice:{RESET_COLOR}\n{answers[model_name]}\n")
                except Exception as exc:
                    answers[model_name] = f"{model_name} generated an exception: {exc}"
                    print(f"{RED}{model_name} generated an exception: {exc}{RESET_COLOR}")
                progress_bar.update()
scybersec commented 4 months ago

Here is the response i got after removing the api key from claude and it does indeed work. Also, we already confirmed it works, remember when i ran into that infinite loop and it ran the api usage up for one of the APIs and the king would still give a response.

Terminal:

`shimu@shimul-omen MINGW64 C:/Users/shimu/AppData/Local/Programs/Microsoft VS Code (feature/create-chat-loop) $ python kingArchitecture.py Please enter your prompt (type 'END' on a new line to finish): what is called the alchemist quest

END Gathering insights from advisors: 0%| | 0/4 [00:00<?, ?task/s]claude generated an exception: "Could not resolve authentication method. Expected either api_key or auth_token to be set. Or for one of the X-Api-Key or Authorization headers to be explicitly omitted"

gemini's advice: The Alchemist's Quest

Gathering insights from advisors: 50%|███████████████████████████████████████████████████████████████████ | 2/4 [00:00<00:00, 2.48task/s] mistralai's advice: In the context of World of Warcraft, the Al chemist class has a series of quests that are often referred to as the "Alchemist Recipe" or " Alchemy" quest s.

These quests involve obtaining various rare and exotic ingredients from around the world of A zeroth. These ingredients can then be used to create powerful potions and elixirs that can be used for various purposes in the game.

So, if you 're an Alchem ist in WoW and you're looking for the next rare ingredient to add to your collection , then you might want to check

Gathering insights from advisors: 75%|████████████████████████████████████████████████████████████████████████████████████████████████████▌ | 3/4 [00:01<00:00, 1.74task/s] llama3's advice: The Alchemist Quest !

The Alchemist Quest is a popular online puzzle game that has been around since the early 2000s. It's a point-and-click adventure game that challenges players to solve a series of increasingly difficult puzzles to progress through the game .

Here's a brief overview :

Storyline : The game takes place in a mysterious, ancient laboratory where an alchemist has left behind a series of crypt ic puzzles and riddles. Your goal is to uncover the secrets of the alchemist's quest by solving these puzzles and unlocking new areas of the laboratory .

Game play: The game is divided into several stages, each with its own unique puzzles and challenges. You 'll need to use your problem-solving skills, observation, and logic to overcome obstacles and unlock the next stage.

Puzzle types : The Alchemist Quest features a wide range of puzzle types, including:

1 . Logic puzzles : Use reasoning and deduction to solve problems.

  1. Pattern recognition: Identify patterns and sequences to unlock doors or activate mechanisms .
    1. Cryptography: Decode encrypted messages and symbols to reveal hidden clues .
    2. Physics-based puzzles : Use basic physics principles to manipulate objects and overcome obstacles.
  2. Visual puzzles: Solve puzzles that require attention to detail and visual perception .

Why is it popular? The Alchemist Quest has remained popular over the years due to its:

  1. Addictive gameplay: The puzzles are engaging , challenging, and rewarding to solve. 2 . Atmosphere and immersion: The game's mysterious setting and eerie soundtrack create a captivating atmosphere.
  2. Sense of accomplishment: Sol ving each puzzle gives players a sense of pride and accomplishment.

If you're interested in playing the Alchemist Quest , you can find it online or download it from various platforms . Be warned , though - it can be quite addictive!

Gathering insights from advisors: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:08<00:00, 2.24s/task]

The King's answer:

To solve the problem of understanding what "The Alchemist's Quest" is and its possible contexts, we should first aggregate the insights provided by the advisors, then structure the solution in a clear and logical manner. Here's how we'll approach it:

Step-by-Step Plan

  1. Identify Contexts:

    • Gaming: Check for relevance in video games, both MMORPG and puzzle genres.
    • Puzzles and Lore: Consider any references to alchemy-themed puzzles or quests in games.
  2. Analyze Advisor Insights:

    • Consolidate the advisors' inputs on gaming and puzzles.
    • Investigate any discrepancies or unique insights provided by each advisor.
  3. Synthesize Information:

    • Combine the gathered information to offer a comprehensive view of "The Alchemist's Quest."
  4. Conclusion and Summary:

    • Present a final, clear, and concise definition or description of "The Alchemist's Quest."

Detailed Analysis Based on Advisors' Input

  1. Contextual Identification:

    • Claude’s Insight seemed unrelated to the topic. It discussed an exception from an API, which doesn't assist us in understanding "The Alchemist's Quest."
    • Gemini's and Mistralai's Insights: While Gemini provided a quest-themed title without much information, Mistralai suggested a series of quests in the MMORPG "World of Warcraft" (WoW) pertaining to the alchemist class.
    • Llama3’s Insight: Detailed description of a popular online puzzle game named "The Alchemist Quest."
  2. Advisor Insights Collation:

    • Mistralai specified that in World of Warcraft, alchemists have quests to gather rare ingredients to create potions and elixirs. This is known as the "Alchemy Quests" and involves in-game explorations and crafting.
    • Llama3 elaborated on an entirely different context—a puzzle game named "The Alchemist Quest," which involves point-and-click adventure mechanics and various types of puzzles to solve in a mysterious setting.

Conclusion

"The Alchemist's Quest" can refer to two distinct contexts based on the insights provided:

  1. World of Warcraft (WoW) Alchemy Quests:

    • These are in-game quests for the Alchemist class, where players collect ingredients and create powerful potions and elixirs. It revolves around exploring Azeroth and enhancing one's alchemical prowess^1.
  2. The Alchemist Quest Online Puzzle Game:

    • This is a point-and-click adventure puzzle game with increasing difficulty levels. Players solve logic, pattern recognition, cryptography, physics-based, and visual puzzles to unveil the secrets of an ancient laboratory^2.

Footnotes to Best Advisor Contributions

  1. Mistralai’s advice provided a detailed context for the alchemy quests in World of Warcraft, highlighting their importance and role in the game.
  2. Llama3’s advice provided a clear and comprehensive overview of the online puzzle game, detailing its gameplay, story, and appeal.

By integrating both these pieces of advice, we achieved a holistic understanding of "The Alchemist's Quest" across different platforms and genres.


This structured approach ensures clarity and a comprehensive understanding of the term based on varied expert inputs. (venv)`