forked from AI-Citizen/SolidGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate custom agent skill and embedding into quick start
- Loading branch information
1 parent
d55df38
commit cacc6b7
Showing
23 changed files
with
419 additions
and
175 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
# Embedding Your Private Data(Beta) | ||
SolidGPT can help you embedding your resource data eigher in runtime or in pre-runtime. | ||
|
||
## Start | ||
> Embedding in runtime can skip the first step. | ||
1. Embedding | ||
```sh | ||
cd quickstart | ||
python3 embedding_data.py data_label your_resource_data_file_path | ||
``` | ||
You can also move all your resource data files to `localstorage/embedding/originalresources` folder and run `python3 embedding_data.py data_label` to embed all the resource data files in the folder. | ||
There will generate two kinds of data, embedding resource data and divided resource data in the `localstorage/embedding/embeddedresources`, `localstorage/embedding/dividedresources` folder. | ||
|
||
> Embedding in runtime can start from here | ||
1. Add the data label to the custom agent skill | ||
```JSON | ||
{ | ||
"skill_name": "EmbeddingDataExampleSkill", | ||
"basic_description": "Write System High-Level Dev Design", | ||
"instruction": "Here is the output document strucuture\n1. Introduction\nScope:\nGoals:\n2. Components\n3. Service Workflow\n4. APIs in Detail\n5. Database Table Schema\n... [List other tables in the same fashion]\n5. Dataflow and Architecture\n```mermaid\n```", | ||
"qa_example": "", | ||
"principles": "List specific API desgin, List specific Database table design, Ouput in Markdown, Use Mermaid for Diagrams", | ||
"embedding_background_data_list": "data_label", // Add the embedding data label here | ||
"model_name": "gpt-4", | ||
"input_method": "SkillIOParamCategory.PlainText", | ||
"output_method": "SkillIOParamCategory.PlainText" | ||
} | ||
``` | ||
1. Add the EmbeddingDataExampleSkill into the graph by SolidPortal, code, manually edit workgraph JSON file. [Learn more about buiding workgraph](https://github.com/AI-Citizen/SolidGPT/blob/main/Readme.md#start-your-own-graph) | ||
1. Run the graph with the custom agent skill which includes the embedding data | ||
```python | ||
# your_file_name.py | ||
from solidgpt.src.orchestration.orchestration import * | ||
Initializer() | ||
# Register your embedding data in to the runtime embedding manager | ||
embedding_manager.add_embed_model("<your_data_label>", EmbeddingModelParameter( | ||
resource_name= "<your_data_label>", | ||
original_resources_folder_path= "<your_private_data_resource_path>", | ||
divided_resources_folder_path= "<your_divided_resource_folder_path>", # generated in step 1, default is PROJECT_ROOT/localstorage/embedding/dividedresources | ||
embedded_resources_folder_path= "<your_embedded_resource_folder_path>", # generated in step 1, defau1t is PROJECT_ROOT/localstorage/embedding/embeddedresources | ||
has_embedded=True | ||
)) | ||
|
||
app = Orchestration() | ||
app.add_graph("your/graph/config_file.json", "default graph") # You can add the EmbeddingDataExampleSkill into the work graph | ||
app.run_graph_with_name("default graph") | ||
``` |
6 changes: 3 additions & 3 deletions
6
localstorage/customizedskilldefinition/WriteSystemDesign.json
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"skill_name": "WrteSystemDesign", | ||
"basic_description": "Write System High-Level Dev Design", | ||
"instruction": "Assume you are the Principal Engineer. Based on the PRD, you first need to design a high-level architecture and service workflow and provide me mermaid code to them . Please help me draft a High-Level Design. You should highlight all the APIs in detail and assist in designing the database table schema.", | ||
"instruction": "Here is the output document strucuture\n1. Introduction\nScope:\nGoals:\n2. Components\n3. Service Workflow\n4. APIs in Detail\n5. Database Table Schema\n... [List other tables in the same fashion]\n5. Dataflow and Architecture\n```mermaid\n```", | ||
"qa_example": "", | ||
"principles": "Cloud-First Approach(Azure),Simplicity and MVP (Minimum Viable Product)", | ||
"principles": "List specific API desgin, List specific Database table design, Ouput in Markdown, Use Mermaid for Diagrams", | ||
"embedding_background_data_list": "", | ||
"model_name": "gpt-4", | ||
"input_method": "SkillIOParamCategory.PlainText", | ||
"output_method": "SkillIOParamCategory.PlainText" | ||
} | ||
} |
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,56 @@ | ||
[ | ||
{ | ||
"node_id": "0", | ||
"manual_review_result": true, | ||
"agent": "Product Manager", | ||
"skill": "Write Product Requirement Documentation", | ||
"inputs": [ | ||
{ | ||
"param_path": "/Users/wuqiten/Workplace/solidgpt-workspace/SolidGPT/solidgpt/../localstorage/workspace/in/AIProductBasicInfo.json", | ||
"loading_method": "SkillInputLoadingMethod.LOAD_FROM_STRING", | ||
"load_from_output_id": -1 | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"id": 0 | ||
} | ||
] | ||
}, | ||
{ | ||
"node_id": "1", | ||
"manual_review_result": true, | ||
"agent": "Principal Engineer", | ||
"skill": "WrteSystemDesign", | ||
"inputs": [ | ||
{ | ||
"param_path": "", | ||
"loading_method": "SkillInputLoadingMethod.LOAD_FROM_OUTPUT_ID", | ||
"load_from_output_id": 0 | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"id": 1 | ||
} | ||
] | ||
}, | ||
{ | ||
"node_id": "2", | ||
"manual_review_result": true, | ||
"agent": "Principal Engineer", | ||
"skill": "Create Kanban Board", | ||
"inputs": [ | ||
{ | ||
"param_path": "", | ||
"loading_method": "SkillInputLoadingMethod.LOAD_FROM_OUTPUT_ID", | ||
"load_from_output_id": 1 | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"id": 2 | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.