Spaces:
Runtime error
Runtime error
Commit
·
5bc3d22
1
Parent(s):
366c565
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,7 +24,7 @@ def generate_plantuml(api_key, text):
|
|
| 24 |
messages=[
|
| 25 |
{
|
| 26 |
"role": "system",
|
| 27 |
-
"content": "You are ChatGPT, a large language model trained by OpenAI. Generate PlantUML code for an architecture that uses
|
| 28 |
},
|
| 29 |
{"role": "user", "content": text},
|
| 30 |
],
|
|
@@ -33,28 +33,28 @@ def generate_plantuml(api_key, text):
|
|
| 33 |
return response["choices"][0]["message"]["content"]
|
| 34 |
|
| 35 |
sample_text = '''
|
| 36 |
-
!define
|
| 37 |
-
!includeurl
|
| 38 |
|
| 39 |
actor Customer
|
| 40 |
actor Restaurant
|
| 41 |
|
| 42 |
-
Customer ->
|
| 43 |
-
|
| 44 |
-
|
| 45 |
|
| 46 |
-
Customer ->
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
Restaurant ->
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
-
|
| 55 |
|
| 56 |
legend right
|
| 57 |
-
Online Food Ordering App Architecture
|
| 58 |
endlegend
|
| 59 |
'''
|
| 60 |
|
|
|
|
| 24 |
messages=[
|
| 25 |
{
|
| 26 |
"role": "system",
|
| 27 |
+
"content": "You are ChatGPT, a large language model trained by OpenAI. Generate PlantUML code for an architecture that uses Azure services and icons for the following use case or code in natural language.",
|
| 28 |
},
|
| 29 |
{"role": "user", "content": text},
|
| 30 |
],
|
|
|
|
| 33 |
return response["choices"][0]["message"]["content"]
|
| 34 |
|
| 35 |
sample_text = '''
|
| 36 |
+
!define AzurePuml https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/master/dist
|
| 37 |
+
!includeurl AzurePuml/AzureCommon.puml
|
| 38 |
|
| 39 |
actor Customer
|
| 40 |
actor Restaurant
|
| 41 |
|
| 42 |
+
Customer -> AzureAPIManagement : Login
|
| 43 |
+
AzureAPIManagement -> AzureActiveDirectory : Authenticate User
|
| 44 |
+
AzureActiveDirectory -> AzureAPIManagement : Return User Info
|
| 45 |
|
| 46 |
+
Customer -> AzureAPIManagement : Place Order
|
| 47 |
+
AzureAPIManagement -> AzureFunctionApp : Process Order
|
| 48 |
+
AzureFunctionApp -> AzureCosmosDB : Store Order Data
|
| 49 |
+
AzureFunctionApp -> Restaurant : Send Order Details
|
| 50 |
+
Restaurant -> AzureFunctionApp : Update Order Status
|
| 51 |
+
AzureFunctionApp -> AzureCosmosDB : Update Order Data
|
| 52 |
+
AzureFunctionApp -> Customer : Send Order Status
|
| 53 |
|
| 54 |
+
AzureFunctionApp -> AzureNotificationHubs : Send Push Notification
|
| 55 |
|
| 56 |
legend right
|
| 57 |
+
Online Food Ordering App Architecture
|
| 58 |
endlegend
|
| 59 |
'''
|
| 60 |
|