From cc86c7f0eba12292b6e7c4732487dcecbd0cc2af Mon Sep 17 00:00:00 2001 From: Rob Koch Date: Wed, 4 Dec 2024 08:23:51 -0800 Subject: [PATCH] added mermaid for testing purposes --- README.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bf9e85..8e51ca5 100644 --- a/README.md +++ b/README.md @@ -62,4 +62,33 @@ $ kubectl rollout restart deployment/what-run-app Go to another terminal window: ``` $ curl -X POST http://127.0.0.1:8080/ask_context -H "Content-Type: application/json" -d '{"sentence": "I am running for president of the United States"}' -``` \ No newline at end of file +``` + +Diagram of the logic +```mermaid +graph TD; + A[Client] -->|POST /ask_context| B[Flask App]; + B --> C{Check 'run' in sentence?}; + C -->|Yes| D[get_context]; + C -->|No| E[JSON comes back]; + D --> F[query_dictionary]; + F --> G[generate_url]; + G --> H[Return JSON with context, entries, URL]; + + subgraph Flask Application + B + D + F + G + H + end + + subgraph OpenAI API + D --> I[OpenAI Completion]; + F --> J[OpenAI Embedding]; + end + + subgraph Dictionary + F --> K[Compute Similarity]; + end +```