-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
939 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# __Agents & NeoGPT 🕵️🤖__ | ||
|
||
## What is an Agent? | ||
|
||
In artificial intelligence, an agent is a computer program or system that is designed to perceive its environment, make decisions and take actions to achieve a specific goal or set of goals. The agent operates autonomously, meaning it is not directly controlled by a human operator. | ||
|
||
!!! info "Info" | ||
Agents are in very early stages of development. They may produce unexpected results or errors. Please use them with caution. | ||
|
||
## Agents & NeoGPT | ||
|
||
Agents are a new feature in NeoGPT. They are designed to be able to interact with the world around them. Currently there are only two agents, but more are planned to be added in the future. | ||
|
||
## Agents in Focus | ||
|
||
Agents within the NeoGPT ecosystem are designed to collaborate with the language model, enabling a broader range of interactions and problem-solving capabilities. Stay tuned for further updates and the introduction of additional agents, expanding the collaborative intelligence of NeoGPT. | ||
|
||
## Meet the Agents | ||
|
||
### __ML Engineer 🤖🧠__ | ||
|
||
The ML Engineer is a specialized agent for machine learning tasks, thinking like an experienced ML professional. It understands and solves various ML-related queries, making it a valuable asset for those needing support in Python programming, data science, and machine learning basics. | ||
|
||
### __QA Engineer 🕵️🔍__ | ||
|
||
The QA Engineer, or Quality Assurance Engineer, is an agent with expertise in validating and assessing code and solutions. When presented with a problem, the QA Engineer can analyze the solution and provide feedback, helping to ensure the quality and correctness of the code. | ||
|
||
|
||
## How to use Agents | ||
|
||
Run the below command to see the agents in action. | ||
|
||
=== "Command" | ||
```bash title="Terminal" | ||
python main.py --task "Your task goes here" | ||
``` | ||
|
||
=== "Example" | ||
```bash title="Terminal" | ||
python main.py --task "Write a program to find the sum of all numbers stored in a list" | ||
``` | ||
|
||
|
||
## How do Agents work? | ||
|
||
1. The `hire()` method is like an assistant manager overseeing the collaboration between a machine learning (ML) specialist (ML Engineer) and a quality assurance (QA) expert (QA Engineer) to solve a task. | ||
|
||
2. __Load Model__: The `hire()` function initiates by loading the machine learning model designed for the task. | ||
|
||
3. __Collaboration Setup__: It establishes collaboration between two key roles - the ML Engineer and the QA Engineer. | ||
|
||
4. __Task Assignment__: A task is assigned to the ML Engineer, who employs the loaded model to generate a solution. | ||
|
||
5. __Quality Check__: The QA Engineer assesses the proposed solution for correctness and quality. | ||
|
||
6. __Termination or Retry__: If the solution is approved, the program terminates. In case of disapproval, the process retries for a defined number of attempts. | ||
|
||
7. __Collaborative Iteration__: Steps 3 to 5 are iteratively performed, facilitating collaboration until a satisfactory solution is achieved or attempts are exhausted. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# __Executing Shell Commands with NeoGPT 🤖__ | ||
|
||
|
||
|
||
## Introduction | ||
|
||
NeoGPT 🤖 has a special persona known as "shell," which allows it to generate shell commands based on user input. It's important to note that these commands have the potential to make changes to your system, and you should use them at your own risk. | ||
|
||
## Warning | ||
|
||
When using NeoGPT 🤖 in the "shell" persona, be cautious, as it may generate commands that can be harmful to your system. Always review the generated commands before executing them. The following steps guide you through the process of executing or manually reviewing commands. | ||
|
||
## Steps | ||
|
||
!!! warning "Warning" | ||
When using NeoGPT 🤖 in the "shell" persona, be cautious, as it may generate commands that can be harmful to your system. Always review the generated commands before executing them. The following steps guide you through the process of executing or manually reviewing commands. | ||
|
||
|
||
### Step 1: Persona Selection | ||
|
||
If you choose the "shell" persona, NeoGPT 🤖 will inform you about the potential risks and ask whether you want to execute the generated commands. | ||
|
||
```bash | ||
You are using NeoGPT 🤖 as a shell. It may generate commands that can be harmful to your system. Use it at your own risk. ⚠️ | ||
``` | ||
|
||
### Step 2: User Input | ||
You will be prompted to decide whether you want to execute the generated commands. | ||
|
||
```bash | ||
Do you want to execute the commands? (Y/N): | ||
``` | ||
|
||
### Step 3: Execution Confirmation | ||
If you choose to execute the commands, NeoGPT 🤖 will inform you that it will execute the commands in your default shell. | ||
|
||
```bash | ||
NeoGPT 🤖 will execute the commands in your default shell. | ||
``` | ||
|
||
### Conclusion | ||
Using NeoGPT 🤖 in the "shell" persona can be a powerful tool, but it comes with risks. Always exercise caution, review the generated commands, and ensure they align with your intentions. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from neogpt.agents.ml_engineer import ML_Engineer | ||
from neogpt.agents.qa_engineer import QA_Engineer | ||
|
||
__all__ = [ | ||
"ML_Engineer", | ||
"QA_Engineer", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import math | ||
|
||
from flask import Flask, request | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route("/calculate", methods=["GET", "POST"]) | ||
def calculate(): | ||
if request.method == "GET": | ||
return """ | ||
<h1>Calculator</h1> | ||
<form method="post" action="/calculate"> | ||
Operation:<br> | ||
<input type="text" name="operation"><br><br> | ||
num1:<br> | ||
<input type="float" name="num1"><br><br> | ||
num2:<br> | ||
<input type="float" name="num2"><br><br> | ||
<input type="submit" value="Calculate"> | ||
</form>""" | ||
else: | ||
operation = request.form["operation"] | ||
num1 = float(request.form["num1"]) | ||
num2 = float(request.form["num2"]) | ||
|
||
if operation == "add": | ||
result = num1 + num2 | ||
elif operation == "subtract": | ||
result = num1 - num2 | ||
elif operation == "multiply": | ||
result = num1 * num2 | ||
elif operation == "divide": | ||
result = num1 / num2 | ||
else: | ||
result = "Invalid operation" | ||
|
||
return f"""<h1>Result: {result}</h1>""" | ||
|
||
|
||
if __name__ == "__main__": | ||
app.run() |
Oops, something went wrong.