doriandarko / maestro Goto Github PK
View Code? Open in Web Editor NEWA framework for Claude Opus to intelligently orchestrate subagents.
A framework for Claude Opus to intelligently orchestrate subagents.
there is no file generated, after i ran python3 maestro-anyapi.py
Cloned the repo, ran requirements in flask_app folder, setup API keys and "python app.py"
import maestro_anyapi
ModuleNotFoundError: No module named 'maestro_anyapi'
Searched all files and no maestro_anyapi found
What am I doing wrong?
C:\zxcv\maestro-main\maestro-main>python maestro-ollama.py
Please enter your objective with or without a text file path: Make me a snake game
Calling Ollama Orchestrator for your objective
╭─ Ollama Orchestrator ────────────────────────────────────────────────────────────────────────────────────────────────╮
│ The task is complete: │
│ │
│ Since there are no previous sub-task results, I will start by breaking down the objective into the next sub-task. │
│ │
│ Next Sub-Task: │
│ Create a basic structure for the Snake Game, including the game board, snake object, and initial game state. │
│ │
│ Prompt for Subagent: │
│ │
│ "Create a Python program that initializes a 10x10 game board with empty spaces represented by zeros. Define a │
│ 'Snake' class with attributes: │
│ - head
: the current position of the snake's head (initially at coordinates [5, 5]) │
│ - body
: a list of tuples representing the positions of the snake's body parts │
│ - direction
: the initial direction of the snake's movement ('up', 'down', 'left', or 'right') │
│ Set the initial game state by placing the snake on the board and displaying the first frame of the game. The game │
│ should not have any food items (or obstacles) yet. │
│ │
│ Please provide the Python code that accomplishes this task." │
╰──────────────────────────────────────── Sending task to Ollama sub-agent 👇 ─────────────────────────────────────────╯
Calling Ollama to provide the refined final output for your objective:
╭─ Final Output ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Project Name: Snake Game │
│ │
│ Folder Structure: │
│ json │ │ <folder_structure> │ │ { │ │ "game": { │ │ "main.py": null, │ │ "settings.py": null, │ │ "snake.py": null, │ │ "ui.py": null │ │ }, │ │ "assets": { │ │ "images": { │ │ "snake.png": null, │ │ "food.png": null, │ │ "wall.png": null │ │ } │ │ }, │ │ "tests": { │ │ "__init__.py": null, │ │ "test_snake.py": null │ │ } │ │ } │ │ </folder_structure> │ │
│
│ Code Files: │
│ │
│ main.py
: │
│ python │ │ '''Game main function''' │ │ from snake import Snake, Settings │ │ │ │ def main(): │ │ settings = Settings() │ │ snake = Snake(settings) │ │ while True: │ │ # game loop │ │ pass │ │ │ │ if __name__ == "__main__": │ │ main() │ │
│
│ │
│ settings.py
: │
│ python │ │ class Settings: │ │ def __init__(self): │ │ self.board_size = (20, 20) # width, height │ │ self.snake_start_pos = (10, 10) │ │ self.food_spawns_per_frame = 1 │ │
│
│ │
│ snake.py
: │
│ python │ │ from settings import Settings │ │ │ │ class Snake: │ │ def __init__(self, settings): │ │ self.settings = settings │ │ self.body = [(settings.snake_start_pos[0], settings.snake_start_pos[1])] │ │ self.direction = 'right' │ │ │ │ def move(self): │ │ # implement snake movement logic │ │ pass │ │ │ │ def grow(self): │ │ # implement snake growth logic │ │ pass │ │
│
│ │
│ ui.py
: │
│ python │ │ from pygame import init as pygame_init, quit as pygame_quit │ │ from pygame import display as pygame_display │ │ │ │ class UI: │ │ def __init__(self): │ │ pygame_init() │ │ self.display = pygame_display.set_mode((800, 600)) │ │ │ │ def render(self, snake): │ │ # implement rendering logic │ │ pass │ │
│
│ Note: This is a basic outline of the project structure and code files. You will need to fill in the implementation │
│ details for each file. │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Project Folder Creation ────────────────────────────────────────────────────────────────────────────────────────────╮
│ Created project folder: Make_me_a_snake_game │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Folder Creation ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Created folder: Make_me_a_snake_game\game │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: main.py │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: settings.py │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: snake.py │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: ui.py │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Folder Creation ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Created folder: Make_me_a_snake_game\assets │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Folder Creation ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Created folder: Make_me_a_snake_game\assets\images │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: snake.png │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: food.png │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: wall.png │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Folder Creation ────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Created folder: Make_me_a_snake_game\tests │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: init.py │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Missing Code Content ───────────────────────────────────────────────────────────────────────────────────────────────╮
│ Code content not found for file: test_snake.py │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
Refined Final output:
Project Name: Snake Game
Folder Structure:
<folder_structure>
{
"game": {
"main.py": null,
"settings.py": null,
"snake.py": null,
"ui.py": null
},
"assets": {
"images": {
"snake.png": null,
"food.png": null,
"wall.png": null
}
},
"tests": {
"__init__.py": null,
"test_snake.py": null
}
}
</folder_structure>
Code Files:
main.py
:
'''Game main function'''
from snake import Snake, Settings
def main():
settings = Settings()
snake = Snake(settings)
while True:
# game loop
pass
if __name__ == "__main__":
main()
settings.py
:
class Settings:
def __init__(self):
self.board_size = (20, 20) # width, height
self.snake_start_pos = (10, 10)
self.food_spawns_per_frame = 1
snake.py
:
from settings import Settings
class Snake:
def __init__(self, settings):
self.settings = settings
self.body = [(settings.snake_start_pos[0], settings.snake_start_pos[1])]
self.direction = 'right'
def move(self):
# implement snake movement logic
pass
def grow(self):
# implement snake growth logic
pass
ui.py
:
from pygame import init as pygame_init, quit as pygame_quit
from pygame import display as pygame_display
class UI:
def __init__(self):
pygame_init()
self.display = pygame_display.set_mode((800, 600))
def render(self, snake):
# implement rendering logic
pass
Note: This is a basic outline of the project structure and code files. You will need to fill in the implementation
details for each file.
Full exchange log saved to 00-13-42_Make_me_a_snake_game.md
Error also when using Claude's models starting with the new update in the old one it still works in the previous script it still works starting with the new update there are errors all the time
C:\zxcv\maestro-main\maestro-main>python maestro.py
Please enter your objective with or without a text file path: Make me a snake game, including scoring and record keeping, and a 3D graphical interface
Do you want to use search? (y/n): n
Calling Orchestrator for your objective
Input Tokens: 224, Output Tokens: 373
Opus Orchestrator Cost: $0.03
╭─ Opus Orchestrator ──────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Here is the next sub-task to achieve the objective of making a snake game with scoring, record keeping, and a 3D │
│ graphical interface: │
│ │
│ Sub-task: Set up the basic game structure and 3D environment │
│ Create a new Python file and import the necessary libraries for 3D rendering (e.g. Pygame, OpenGL). │
│ Set up a basic game loop structure with initialization, main loop, and cleanup sections. │
│ Create a simple 3D environment using OpenGL primitives to represent the game board. │
│ Implement camera controls to allow the player to view the game board from different angles. │
│ Add basic lighting to the scene to enhance the 3D effect. │
│ │
│ Prompt for subagent: │
│ Your task is to set up the foundation for a 3D snake game using Python and OpenGL. Create a new Python file and │
│ import the required libraries for 3D rendering, such as Pygame and OpenGL. Set up a basic game loop structure with │
│ sections for initialization, the main loop, and cleanup. │
│ │
│ Use OpenGL primitives to create a simple 3D environment representing the game board. The game board should be a │
│ flat, rectangular surface. Implement camera controls that allow the player to view the game board from different │
│ angles using keyboard or mouse input. │
│ │
│ Add basic lighting to the scene to enhance the 3D effect and make the game board more visually appealing. Ensure │
│ that the lighting is balanced and does not obstruct the player's view of the game board. │
│ │
│ Test your code thoroughly to ensure that the game loop runs smoothly, the 3D environment is rendered correctly, and │
│ the camera controls and lighting work as expected. If you encounter any issues or have suggestions for improvement, │
│ please include them in your response. │
╰────────────────────────────────────────────── Sending task to Haiku 👇 ──────────────────────────────────────────────╯
Traceback (most recent call last):
File "C:\zxcv\maestro-main\maestro-main\maestro.py", line 234, in
sub_task_result = haiku_sub_agent(sub_task_prompt, search_query, haiku_tasks, use_search)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\zxcv\maestro-main\maestro-main\maestro.py", line 105, in haiku_sub_agent
haiku_response = client.messages.create(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\z5050\miniconda3\Lib\site-packages\anthropic_utils_utils.py", line 275, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\z5050\miniconda3\Lib\site-packages\anthropic\resources\messages.py", line 678, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\z5050\miniconda3\Lib\site-packages\anthropic_base_client.py", line 1208, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\z5050\miniconda3\Lib\site-packages\anthropic_base_client.py", line 897, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\z5050\miniconda3\Lib\site-packages\anthropic_base_client.py", line 988, in _request
raise self._make_status_error_from_response(err.response) from None
anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages: text content blocks must be non-empty'}}
Calling Opus to provide the refined final output for your objective: Traceback (most recent call last): File "/workspaces/maestro/maestro-groq.py", line 190, in <module> refined_output = opus_refine(objective, [result for _, result in task_exchanges], timestamp, sanitized_objective) File "/workspaces/maestro/maestro-groq.py", line 91, in opus_refine opus_response = client.chat.completions.create( File "/home/codespace/.local/lib/python3.10/site-packages/groq/resources/chat/completions.py", line 283, in create return self._post( File "/home/codespace/.local/lib/python3.10/site-packages/groq/_base_client.py", line 1225, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) File "/home/codespace/.local/lib/python3.10/site-packages/groq/_base_client.py", line 920, in request return self._request( File "/home/codespace/.local/lib/python3.10/site-packages/groq/_base_client.py", line 1018, in _request raise self._make_status_error_from_response(err.response) from None groq.BadRequestError: Error code: 400 - {'error': {'message': 'Please reduce the length of the messages or completion.', 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}}
I tried running the maestro-ollama
file with llama3-8b
model and the model went into a loop where it kept thanking each other in the end. Here's an extract:
Calling Ollama Orchestrator for your objective
╭─ Ollama Orchestrator ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ This conversation between a developer and a code reviewer demonstrates excellent communication skills. The developer: │
│ │
│ 1. Acknowledges the reviewer's feedback: They thank them for their thorough review and express appreciation for their │
│ suggestions. │
│ 2. Shows willingness to improve: They mention specific areas where they can improve, such as separating out logic into │
│ separate functions and optimizing performance. │
│ 3. Provides additional ideas: They share their own ideas for adding features to make the game more engaging and challenging, │
│ such as implementing different levels with varying difficulty, adding power-ups or obstacles, and improving collision │
│ detection. │
│ 4. Clarifies concerns: When the reviewer suggests creating separate functions for updating the snake's position, checking for │
│ collisions, and updating the game state, they confirm that this is a great idea and intend to implement it. │
│ │
│ The tone of their responses is polite, professional, and enthusiastic. They demonstrate an open-minded attitude towards │
│ feedback and are eager to improve their code. The reviewer's response reflects positively on the code and provides specific │
│ guidance for future development. │
│ │
│ This conversation highlights the importance of effective communication in software development. It shows that by acknowledging │
│ feedback, showing willingness to improve, providing additional ideas, and clarifying concerns, developers can create a │
│ positive and productive dialogue with reviewers. This can lead to better code quality, more efficient development, and a │
│ stronger team overall. │
│ │
│ The developer's responses are: │
│ │
│ * Polite: They thank the reviewer for their time and appreciate their feedback. │
│ * Professional: They provide specific examples of how they plan to implement each suggestion and demonstrate an understanding │
│ of the reviewer's concerns. │
│ * Enthusiastic: They express excitement about incorporating the suggestions into their code and ask for additional ideas from │
│ the reviewer. │
│ │
│ The developer also asks follow-up questions, such as: │
│ │
│ * "Do you have any additional ideas or recommendations for making the game more engaging and challenging?" │
│ * "Would you like me to provide some specific examples of how I plan to implement each of these suggestions?" │
│ │
│ This shows that they are actively seeking feedback and are open to new ideas. It also demonstrates a willingness to learn and │
│ improve, which is essential in software development. │
╰───────────────────────────────────────────── Sending task to Ollama sub-agent 👇 ──────────────────────────────────────────────╯
╭─ Ollama Sub-agent Result ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ This conversation showcases excellent communication skills from the developer. Here's why: │
│ │
│ 1. **Acknowledges feedback**: The developer thanks the reviewer for their thorough review and expresses appreciation for their │
│ suggestions. │
│ 2. **Shows willingness to improve**: They specifically mention areas where they can improve, such as separating out logic into │
│ separate functions and optimizing performance. │
│ 3. **Provides additional ideas**: They share their own ideas for adding features to make the game more engaging and │
│ challenging. │
│ 4. **Clarifies concerns**: When the reviewer suggests creating separate functions, they confirm that this is a great idea and │
│ intend to implement it. │
│ │
│ The tone of their responses is: │
│ │
│ * **Polite**: They thank the reviewer for their time and appreciate their feedback. │
│ * **Professional**: They provide specific examples of how they plan to implement each suggestion and demonstrate an │
│ understanding of the reviewer's concerns. │
│ * **Enthusiastic**: They express excitement about incorporating the suggestions into their code and ask for additional ideas │
│ from the reviewer. │
│ │
│ The developer also asks follow-up questions, which shows that they are: │
│ │
│ * **Active learners**: They seek feedback and are open to new ideas. │
│ * **Willing to improve**: They demonstrate a willingness to learn and improve their code. │
│ │
│ Overall, this conversation highlights the importance of effective communication in software development. By acknowledging │
│ feedback, showing willingness to improve, providing additional ideas, and clarifying concerns, developers can create a │
│ positive and productive dialogue with reviewers, leading to better code quality, more efficient development, and a stronger │
│ team overall. │
╰─────────────────────────────────── Task completed, sending result to Ollama Orchestrator 👇 ───────────────────────────────────╯
Calling Ollama Orchestrator for your objective
╭─ Ollama Orchestrator ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ This conversation between a developer and a code reviewer showcases excellent communication skills. The developer: │
│ │
│ 1. Acknowledges the reviewer's feedback by thanking them for their thorough review and expressing appreciation for their │
│ suggestions. │
│ 2. Shows willingness to improve by mentioning specific areas where they can improve, such as separating out logic into │
│ separate functions and optimizing performance. │
│ 3. Provides additional ideas by sharing their own thoughts on how to make the game more engaging and challenging, including │
│ implementing different levels with varying difficulty, adding power-ups or obstacles, and improving collision detection. │
│ 4. Clarifies concerns by confirming that creating separate functions for updating the snake's position, checking for │
│ collisions, and updating the game state is a great idea and intends to implement it. │
│ │
│ The tone of their responses is polite, professional, and enthusiastic. They demonstrate an open-minded attitude towards │
│ feedback and are eager to improve their code. The reviewer's response reflects positively on the code and provides specific │
│ guidance for future development. │
│ │
│ This conversation highlights the importance of effective communication in software development. By acknowledging feedback, │
│ showing willingness to improve, providing additional ideas, and clarifying concerns, developers can create a positive and │
│ productive dialogue with reviewers, leading to better code quality, more efficient development, and a stronger team overall. │
╰───────────────────────────────────────────── Sending task to Ollama sub-agent 👇 ──────────────────────────────────────────────╯
╭─ Ollama Sub-agent Result ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ The conversation between the developer and the code reviewer showcases excellent communication skills in software development. │
│ Here are some key takeaways: │
│ │
│ 1. **Acknowledges feedback**: The developer thanks the reviewer for their thorough review and expresses appreciation for their │
│ suggestions. │
│ 2. **Shows willingness to improve**: They specifically mention areas where they can improve, such as separating out logic into │
│ separate functions and optimizing performance. │
│ 3. **Provides additional ideas**: They share their own thoughts on how to make the game more engaging and challenging, │
│ including implementing different levels with varying difficulty, adding power-ups or obstacles, and improving collision │
│ detection. │
│ 4. **Clarifies concerns**: When the reviewer suggests creating separate functions for updating the snake's position, checking │
│ for collisions, and updating the game state, they confirm that this is a great idea and intend to implement it. │
│ │
│ The tone of their responses is polite, professional, and enthusiastic. They demonstrate an open-minded attitude towards │
│ feedback and are eager to improve their code. The reviewer's response reflects positively on the code and provides specific │
│ guidance for future development. │
│ │
│ This conversation highlights the importance of effective communication in software development. By acknowledging feedback, │
│ showing willingness to improve, providing additional ideas, and clarifying concerns, developers can create a positive and │
│ productive dialogue with reviewers, leading to better code quality, more efficient development, and a stronger team overall. │
╰─────────────────────────────────── Task completed, sending result to Ollama Orchestrator 👇 ───────────────────────────────────╯
Calling Ollama Orchestrator for your objective
╭─ Ollama Orchestrator ──────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ This conversation is an excellent example of effective communication between a developer and a code reviewer. The developer's │
│ responses showcase: │
│ │
│ 1. **Acknowledging feedback**: They thank the reviewer for their thorough review and express appreciation for their │
│ suggestions. │
│ 2. **Showing willingness to improve**: They specifically mention areas where they can improve, such as separating out logic │
│ into separate functions and optimizing performance. │
│ 3. **Providing additional ideas**: They share their own thoughts on how to make the game more engaging and challenging, │
│ including implementing different levels with varying difficulty, adding power-ups or obstacles, and improving collision │
│ detection. │
│ 4. **Clarifying concerns**: When the reviewer suggests creating separate functions for updating the snake's position, checking │
│ for collisions, and updating the game state, they confirm that this is a great idea and intend to implement it. │
│ │
│ The tone of their responses is polite, professional, and enthusiastic, demonstrating an open-minded attitude towards feedback │
│ and eagerness to improve their code. The reviewer's response reflects positively on the code and provides specific guidance │
│ for future development. │
│ │
│ This conversation highlights the importance of effective communication in software development, leading to better code │
│ quality, more efficient development, and a stronger team overall. │
╰───────────────────────────────────────────── Sending task to Ollama sub-agent 👇 ──────────────────────────────────────────────╯
╭─ Ollama Sub-agent Result ──────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ This conversation between a developer and a code reviewer showcases excellent communication skills. The developer: │
│ │
│ 1. Acknowledges the reviewer's feedback by thanking them for their thorough review and expressing appreciation for their │
│ suggestions. │
│ 2. Shows willingness to improve by mentioning specific areas where they can improve, such as separating out logic into │
│ separate functions and optimizing performance. │
│ 3. Provides additional ideas by sharing their own thoughts on how to make the game more engaging and challenging, including │
│ implementing different levels with varying difficulty, adding power-ups or obstacles, and improving collision detection. │
│ 4. Clarifies concerns by confirming that creating separate functions for updating the snake's position, checking for │
│ collisions, and updating the game state is a great idea and intends to implement it. │
│ │
│ The tone of their responses is polite, professional, and enthusiastic, demonstrating an open-minded attitude towards feedback │
│ and eagerness to improve their code. │
╰─────────────────────────────────── Task completed, sending result to Ollama Orchestrator 👇 ───────────────────────────────────╯
I suspect this has something to do with exceeding the context length. Any idea how to get around this?
In the installation instructions you write: pip install -r requirements.txt
But there is no requirements.txt file in your repository!
Please add it.
Have also been seeing the following repeatedly, which blows up the session. Is there any way to increase the error handling to preserve the session?
Please note that the provided code and documentation serve as a starting point and may require further customization and refinement based on the specific requirements and constraints of the project.
Traceback (most recent call last):
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestro.py", line 303, in
file.write(exchange_log)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.1008.0_x64__qbz5n2kfra8p0\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 6303-6305: character maps to
PS C:\Users\Spocksbrain\Documents\Code_Projects\maestro>
At the end of the operation there is no code file the project folder is empty
I used python maestro-ollama.py
After procedure to orchestrate, there is nothing in the project folder. The orchestration was successfully done.
Is there anything I should do after orchestration?
Would you consider adding AWS Bedrock and some (Claude) if not all their options as a source for LLMs?
Amazon Bedrock Runtime examples using SDK for Python (Boto3)
I'm running into an AuthenticationError
with a 401
status code indicating an "invalid x-api-key" when trying to interact with the Anthropic API using the Claude Opus model.
Trace:
maestro$ python maestro-gpt.py
Please choose the orchestrator model (Claude Opus or GPT-4): Claude Opus
Invalid choice. Please enter 'Claude Opus' or 'GPT-4': Claude Opus
Please enter your objective with or without a text file path: a playable version of pong where i use wasd to move
Calling Orchestrator for your objective
Traceback (most recent call last):
File "/home/taf/Dmyzer/search_engine/Prototypes/graphs/maestro/maestro-gpt.py", line 167, in <module>
opus_result, file_content_for_subagent = opus_orchestrator(objective, file_content, previous_results)
File "/home/taf/Dmyzer/search_engine/Prototypes/graphs/maestro/maestro-gpt.py", line 37, in opus_orchestrator
opus_response = anthropic_client.messages.create(
File "/home/taf/anaconda3/envs/llm_gym/lib/python3.10/site-packages/anthropic/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
File "/home/taf/anaconda3/envs/llm_gym/lib/python3.10/site-packages/anthropic/resources/messages.py", line 678, in create
return self._post(
File "/home/taf/anaconda3/envs/llm_gym/lib/python3.10/site-packages/anthropic/_base_client.py", line 1232, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "/home/taf/anaconda3/envs/llm_gym/lib/python3.10/site-packages/anthropic/_base_client.py", line 921, in request
return self._request(
File "/home/taf/anaconda3/envs/llm_gym/lib/python3.10/site-packages/anthropic/_base_client.py", line 1012, in _request
raise self._make_status_error_from_response(err.response) from None
anthropic.AuthenticationError: Error code: 401 - {'type': 'error', 'error': {'type': 'authentication_error', 'message': 'invalid x-api-key'}}
I made a fresh key and tested it with:
from anthropic import Anthropic
client = Anthropic(api_key="sk-xxxxx")
message = client.messages.create(
model="claude-3-opus-20240229",
max_tokens=1024,
messages=[
{"role": "user", "content": "Hello, Claude"}
]
)
print(message.content)
output:
[TextBlock(text='Hello! How can I assist you today?', type='text')]
I'm stumped at whats causing this error, any help would be appreciated.
C:\Users\z5050>ollama.pull('llama3:70b')
'ollama.pull' is not recognized as an internal or external command,
operable program or batch file.
It should be a different command
ollama run llama3
ollama run llama3:70b
This command works fix it
code error when use proxy, how to fix it?
This issue arises in all 5 maestro scripts on my Windows 11 machine. The scripts cannot read the file and then, depending on which script, either take on the task to develop a Python script to read the file, or use a "made up" file content to illustrate what they would have done if there were any content.
The file content was: "What is the capital of France?".
https://ai.google.dev/gemini-api/docs/caching?lang=python
import os
import google.generativeai as genai
from google.generativeai import caching
import datetime
import time
# Get your API key from https://aistudio.google.com/app/apikey
# and access your API key as an environment variable.
# To authenticate from a Colab, see
# https://github.com/google-gemini/cookbook/blob/main/quickstarts/Authentication.ipynb
genai.configure(api_key=os.environ['API_KEY'])
# Download video file
# curl -O https://storage.googleapis.com/generativeai-downloads/data/Sherlock_Jr_FullMovie.mp4
path_to_video_file = 'Sherlock_Jr_FullMovie.mp4'
# Upload the video using the Files API
video_file = genai.upload_file(path=path_to_video_file)
# Wait for the file to finish processing
while video_file.state.name == 'PROCESSING':
print('Waiting for video to be processed.')
time.sleep(2)
video_file = genai.get_file(video_file.name)
print(f'Video processing complete: {video_file.uri}')
# Create a cache with a 5 minute TTL
cache = caching.CachedContent.create(
model='models/gemini-1.5-flash-001',
display_name='sherlock jr movie', # used to identify the cache
system_instruction=(
'You are an expert video analyzer, and your job is to answer '
'the user\'s query based on the video file you have access to.'
),
contents=[video_file],
ttl=datetime.timedelta(minutes=5),
)
# Construct a GenerativeModel which uses the created cache.
model = genai.GenerativeModel.from_cached_content(cached_content=cache)
# Query the model
response = model.generate_content([(
'Introduce different characters in the movie by describing '
'their personality, looks, and names. Also list the timestamps '
'they were introduced for the first time.')])
print(response.usage_metadata)
# The output should look something like this:
#
# prompt_token_count: 696219
# cached_content_token_count: 696190
# candidates_token_count: 214
# total_token_count: 696433
print(response.text)
``
this is a good project, but you need to refactor the code and make different code files for different agents and different models for the opus and organize all the files in some directory.
Thanks
Please add search functionality like maestro.py on maestro-ollama.py .
It will be very helpful to use search functionality with llama3
When handing off tasks to Haiku, the following has been occurring repeatedly.
Traceback (most recent call last):
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestro.py", line 246, in
sub_task_result = haiku_sub_agent(sub_task_prompt, search_query, haiku_tasks, use_search)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestro.py", line 102, in haiku_sub_agent
qna_response = tavily.qna_search(query=search_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\tavily\tavily.py", line 68, in qna_search
search_result = self._search(query, search_depth=search_depth, include_answer=True, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\tavily\tavily.py", line 42, in _search
response.raise_for_status() # Raises a HTTPError if the HTTP request returned an unsuccessful status code
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 502 Server Error: Bad Gateway for url: https://api.tavily.com/search
PS C:\Users\Spocksbrain\Documents\Code_Projects\maestro>
I installed the python packages and added the API-Key but after asking for objective it shows this error:
Calling Opus for your objective
+- Opus Orchestrator ---------------------------------------------------------+
| Here is the next sub-task and prompt for the subagent: |
| |
| Sub-task: Define the core functionalities needed for a Python GUI to |
| control a rotating weapon platform (turret). |
| |
| Prompt: Please list out the key features and functionalities that would be |
| required in a Python-based graphical user interface to effectively monitor |
| and control a rotating weapon platform (turret). Consider things like: |
| - Displaying the current position/orientation of the turret |
| - Allowing the user to manually adjust the turret's position |
| - Showing video feed from any cameras on the turret |
| - Statuses of the turret's subsystems (e.g. power, targeting sensors, |
| weapon systems) |
| - Emergency stop button |
| - Firing controls and safety interlocks |
| The goal is to define the core set of capabilities the GUI would need to |
| include to enable an operator to use it to fully control the remote turret |
| system. Please provide the list of required GUI functions and a brief |
| description of each. |
+-------------------------Traceback (most recent call last):
File "C:\Users\dongle\git\maestro\maestro\maestro.py", line 125, in
opus_result = opus_orchestrator(objective, previous_results)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\dongle\git\maestro\maestro\maestro.py", line 33, in opus_orchestrator
console.print(Panel(response_text, title=f"[bold green]Opus Orchestrator[/bold green]", title_align="left", border_style="green", subtitle="Sending task to Haiku \U0001f447"))
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\console.py", line 1673, in print
with self:
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\console.py", line 865, in exit
self._exit_buffer()
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\console.py", line 823, in _exit_buffer
self._check_buffer()
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich\console.py", line 2027, in _check_buffer
legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich_windows_renderer.py", line 17, in legacy_windows_render
term.write_styled(text, style)
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich_win32_console.py", line 442, in write_styled
self.write_text(text)
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\site-packages\rich_win32_console.py", line 403, in write_text
self.write(text)
File "C:\Users\dongle\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f447' in position 23: character maps to
`
I have also run across this error a number of times.
Traceback (most recent call last):
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestro.py", line 246, in
sub_task_result = haiku_sub_agent(sub_task_prompt, search_query, haiku_tasks, use_search)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestro.py", line 117, in haiku_sub_agent
haiku_response = client.messages.create(
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_utils_utils.py", line 277, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic\resources\messages.py", line 681, in create
return self._post(
^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_base_client.py", line 1239, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_base_client.py", line 921, in request
return self._request(
^^^^^^^^^^^^^^
File "C:\Users\Spocksbrain\Documents\Code_Projects\maestro\maestor01\Lib\site-packages\anthropic_base_client.py", line 1019, in _request
raise self._make_status_error_from_response(err.response) from None
anthropic.BadRequestError: Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages: text content blocks must be non-empty'}}
PS C:\Users\Spocksbrain\Documents\Code_Projects\maestro>
I checked the code but I dont see it. I would like that the defined sub-agent also its able to use gcc for example or run python tests.
Some users could work in complex environments on multiple projects that could have dependency conflicts. It would be good to support this project to be run in python virtual environment using poetry. It would still allow using maestro the exact same way by just calling it directly, or run in in the virtual environment with all needed libraries installed w/o affecting other projects.
AttributeError: 'Anthropic' object has no attribute 'messages
line 109, in
opus_result = opus_orchestrator(objective, previous_results)
line 26, in opus_orchestrator
opus_response = client.messages.create(
hi, can you add the cost of all the models used and price per token and the total price in the end and include price per different models use as an agent as well
A Human in the loop might be a valuable extension. I noticed the sub-agent going down some very deep rabbit holes repeatedly. Pure prompt engineering requires the whole process to be restarted without being able to make use of the previous results (if you don't copy them into a file and provide that for the next run, that is). A human could also be used to answer questions by the orchestrator before it starts dividing.
We can selfhost searxng easily in our system and use it for free searching and getting the results from any type of search engine like brave,bing,google etc.Perplexica is one such open source project which uses searxng for free search to replicate perplexica functionality for free so if possible think about it and try to add support for it ;-)
The discussion between the agents is super funny, it amuses me a lot, especially when it goes into a loop. Then you give them a task and they start discussing something else.
I'm using the ollama version and so far I haven't been able to finish anything, I left it to a small task to see when it finishes, 26 hours have passed and it's still going.
I think that in many aspects it is much better than Davin or CrewAI, but it needs to be tickled a little to complete a task.
Then the option for long term memory should be added, which saves everything in the /data folder in the same folder where the python file runs and for each task to create a new subfolder in the /data folder.
Others may want to use your code.
Please choose a license.
https://github.com/Doriandarko/maestro/community
Maybe The Unlicense ...
Getting the following error on my first run using maestro-gpt. maestro.py still runs fine, I still have working APIs for both, etc.
Please, structure the script with clear comments explaining each section and placeholder. The aim of this sub-task is to │
│ lay a solid, clear foundation for the script, which future sub-tasks will build upon to fully realize the complex │
│ functionality described in the objectives. │
╰─────────────────────────────────────────────── Sending task to subagent 👇 ───────────────────────────────────────────────╯
Traceback (most recent call last):
File "/maestro/maestro-gpt.py", line 181, in
sub_task_result = subagent(sub_task_prompt, subagent_tasks)
File "/maestro/maestro-gpt.py", line 69, in subagent
subagent_response = anthropic_client.messages.create(
NameError: name 'anthropic_client' is not defined
It's a pretty neat idea but my attempts so far have ended up with shells rather than something functioning. I wonder what prompt will ensure that it finishes the job?
See in this example it starts off really well and then gives up before it's finished.
I am very familiar with Claude.ai where a conversation can be continued and adjustments made in a progressive fashion. But with Maestro, I submit a prompt, it outputs code, then ends. When that code has a problem, what do I do next? Can I just tell Maestro what to fix as a continued discussion? Or do I have to upload the latest code again and describe what needs fixing or how do I improve/fix the faulty code?
Are there docs or instructions or somewhere I can learn more about how to use Maestro properly?
Thank you so much!
Derek
Maestro's capabilities with search are really great in my opinion, Tavily is a great AI Search tool, but I think if support was added for Google Programmable Search Engine or Bing Search API (which are also free, but Google's PSE is the best imo) Maestro can be significantly enhanced by implementing in-depth access to external information sources rather than searching about a topic and receiving a summary, when the search is ported into Maestro, the Orchestrator/Agents can have access to ALL of the information.
Furthermore, equipping Maestro with web scraping capabilities would unlock access to more targeted information. Users could directly request data from specific websites, or Maestro could autonomously initiate scraping when a subtask requires specific details.
While leveraging external APIs like Gemini 1.5 Pro offers significant advantages, Maestro has a hard time when trying to use Gemini 1.5 Pro with it's very low API requests (currently 2 requests per minute on the Free tier), I was wondering if there was a way for the user to be asked if they would like to submit their rate limits for their APIs so that Maestro can stay below those limits? I simply tried using Gemini 1.5 Pro as just the Orchestrator Agent, and every time, Maestro would fail to complete the task after running a couple agents by saying that I was reaching a usage limit, referring to the 2 requests per minute of 1.5 Pro. Now, the obvious fix to this is just using 1.5 Flash instead or really any model with higher limits (I had no issues using Claude, and I never used OpenAI or Ollama or local models, but would assume they are fine as well). An ideal mechanism in the code could track API call frequency and implement strategies such as introducing pauses, queuing requests, or dynamically switching to alternative models or APIs when approaching usage thresholds.
If any of these ideas are already in the works of being implemented into Maestro, could you please let me know? Thanks for developing an amazing tool (which helped to create this request by the way).
There is repetitiveness when Orchestrator, Subagent, Refiner all are in sync, the program should terminate by giving the final output. Example as: Based on the conversation, it appears that we have reached a stalemate due to repetition. When this message starts repeating for Orchestrator and Subagent, program should stop delegating the task and conclude the final output and should terminate
Error using maestro, line 303, should have it forced to UTF-8 (crashed on Windows). Otherwise great, thanks for the framework!
Is this just for writing code? Hah
Sorry reaaaaaallly dumb question but I didn't know where else to go.
Maestro can create the code for the task you want to achieve?
It's quite cool nonetheless but it's not an "assistant" or agent ala. autogpt or crewai?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.