Skip to content

Instantly share code, notes, and snippets.

@noxasaxon
Created January 16, 2025 00:54
Show Gist options
  • Save noxasaxon/89028fbd7e51371ed2d1975a3ea3bd1d to your computer and use it in GitHub Desktop.
Save noxasaxon/89028fbd7e51371ed2d1975a3ea3bd1d to your computer and use it in GitHub Desktop.
graph TD
    A[Start] --> B[Initialize endStatePrompt and currentContext]
    B --> C[Set endStateReached to false and initialize proposedViaRecheck]
    C --> D{endStateReached?}
    D -->|No| E[Call proposeNextStep]
    E --> F[Call recheckProposedStep]
    F --> G{recheck != nextStep and proposedViaRecheck.length > 3?}
    G -->|Yes| H[Throw Error: Too many rejections, aborting workflow]
    G -->|No| I{recheck != nextStep?}
    I -->|Yes| J[Add recheck to proposedViaRecheck]
    J -->|Yes| D
    I -->|No| K{nextStep 'type' == 'end'?}
    K -->|Yes| L[Set endStateReached to true]
    L --> M[Return JamixAIWorkflowOutput with currentContext]
    K -->|No| N[Call runStep]
    N --> O[Update currentContext with resultContext]
    O --> P[Reset proposedViaRecheck] 
    P --> D
    D -->|Yes| Q[End]

    style A fill:#f9f,stroke:#333,stroke-width:4px
    style Q fill:#f9f,stroke:#333,stroke-width:4px
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment