Closed scybersec closed 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()
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.
Why is it popular? The Alchemist Quest has remained popular over the years due to its:
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:
Identify Contexts:
Analyze Advisor Insights:
Synthesize Information:
Conclusion and Summary:
Contextual Identification:
Advisor Insights Collation:
"The Alchemist's Quest" can refer to two distinct contexts based on the insights provided:
World of Warcraft (WoW) Alchemy Quests:
The Alchemist Quest Online Puzzle Game:
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)`
If one of the models error out the program should still run with the one's that did give a response back.