https://github.com/dcspark/shinkai-prompt-test
Tests for Shinkai Tool Prompts
https://github.com/dcspark/shinkai-prompt-test
Last synced: over 1 year ago
JSON representation
Tests for Shinkai Tool Prompts
- Host: GitHub
- URL: https://github.com/dcspark/shinkai-prompt-test
- Owner: dcSpark
- Created: 2024-11-13T22:56:56.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-13T20:28:09.000Z (over 1 year ago)
- Last Synced: 2025-03-13T20:34:08.976Z (over 1 year ago)
- Language: TypeScript
- Size: 5.22 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shinkai Prompt Testing
## Install
```
git clone git@github.com:dcSpark/shinkai-prompt-test.git
cd shinkai-prompt-test
cp .env.example .env
```
> setup BRAVE_API_KEY and other keys in .env
## Launch service
```
deno --watch -A src/service.ts
```
> TEST curl localhost:8080/generate\?language=typescript\&prompt=hello_world
> Open test.html to use the frontend
## Pipeline Flow Diagram
```mermaid
graph TD
Start[Start] --> Init[Initialize]
Init --> ProcReq[Process Requirements & Feedback]
ProcReq --> ProcUser[Process User Feedback]
ProcUser --> ProcLib[Process Library Search]
ProcLib --> ProcInt[Process Internal Tools]
ProcInt --> GenCode[Generate Code]
GenCode --> CheckCode[Check Generated Code]
CheckCode -->|No Warnings| GenMeta[Generate Metadata]
CheckCode -->|Has Warnings & Retries > 0| FixCode[Fix Code]
FixCode --> CheckCode
GenMeta --> LogComp[Log Completion]
LogComp --> End[End]
subgraph RetryUntilSuccess
RetryStart[Start Retry] --> RunFn[Run Function]
RunFn --> Extract[Extract Result]
Extract -->|Success| RetryEnd[Return Result]
Extract -->|Failure & Retries > 0| RunFn
Extract -->|Failure & No Retries| ThrowErr[Throw Error]
end
%% Connect main flow with RetryUntilSuccess
ProcReq -.->|Uses| RetryStart
ProcUser -.->|Uses| RetryStart
ProcLib -.->|Uses| RetryStart
ProcInt -.->|Uses| RetryStart
GenCode -.->|Uses| RetryStart
CheckCode -.->|Uses| RetryStart
GenMeta -.->|Uses| RetryStart
%% Styling
classDef process fill:#f9f,stroke:#333,stroke-width:2px;
classDef retry fill:#bbf,stroke:#333,stroke-width:2px;
class RetryStart,RunFn,Extract,RetryEnd,ThrowErr retry;
class Init,ProcReq,ProcUser,ProcLib,ProcInt,GenCode,CheckCode,FixCode,GenMeta,LogComp process;
```
The diagram above shows the main pipeline flow of the Shinkai prompt testing system. Each major step in the pipeline utilizes the `retryUntilSuccess` mechanism (shown in the subgraph) to ensure robust execution. The retry mechanism will attempt the operation up to 3 times before failing.
Key components:
- Main Pipeline Flow: Shows the sequential processing steps from initialization to completion
- RetryUntilSuccess: Demonstrates the self-looping retry mechanism used by most pipeline steps
- Warning Handling: Illustrates the code fix loop that occurs when warnings are detected
- Integration Points: Dotted lines show where the retry mechanism is utilized in the main flow