Skip to content

Commit ff9db10

Browse files
authored
feat(Templates): Re-structure Templates for Local Testing (#6409)
* divided templates standalone designer to shell to display local placeholder * added local selection which displays thisisLocal * loading local templates * successfully load custom template from service * fixed template panel not opening issue * made local accelerator template load * fixed accelerator not loading * fixed crashing for local connections * removed console logs & added template & changed to mock category * minor improvements on naming and logs * renamed templateDesigners * updated mock data
1 parent a40fe8a commit ff9db10

File tree

31 files changed

+1115
-135
lines changed

31 files changed

+1115
-135
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"title": "[Mock] Basic Workflow Only Template",
3+
"description": "This is a simple workflow only template description",
4+
"tags": [
5+
"Basic Workflow Only",
6+
"try catch"
7+
],
8+
"skus": [
9+
"consumption",
10+
"standard"
11+
],
12+
"kinds": [
13+
"stateful",
14+
"stateless"
15+
],
16+
"detailsDescription": "This is a basic workflow only template details description \n- point 1 \n- point 2.",
17+
"details": {
18+
"By": "Microsoft",
19+
"Type": "Workflow",
20+
"Trigger": "Request",
21+
"Category": "Mock"
22+
},
23+
"artifacts": [
24+
{
25+
"type": "workflow",
26+
"file": "workflow.json"
27+
}
28+
],
29+
"images": {
30+
"light": "/templates/BasicWorkflowOnly/workflow-light.png",
31+
"dark": "/templates/BasicWorkflowOnly/workflow-dark.png"
32+
},
33+
"parameters": [],
34+
"connections": {},
35+
"featuredOperations": [
36+
{
37+
"type": "Scope"
38+
}
39+
],
40+
"sourceCodeUrl": "/sourceCode"
41+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"$schema": "/schemaLink",
3+
"actions": {
4+
"Catch": {
5+
"actions": {
6+
"Compensation_Logic": {
7+
"inputs": "Replace this action with the actions for your exception handling logic.",
8+
"type": "Compose"
9+
},
10+
"Filter_Try_Scope_Errors": {
11+
"inputs": {
12+
"from": "@result('Try')",
13+
"where": "@equals(item()?['status'],'Failed')"
14+
},
15+
"runAfter": {
16+
"Compensation_Logic": [
17+
"SUCCEEDED"
18+
]
19+
},
20+
"type": "Query"
21+
},
22+
"Format_Errors": {
23+
"inputs": {
24+
"from": "@body('Filter_Try_Scope_Errors')",
25+
"select": {
26+
"action": "@item()?['name']",
27+
"errorResult": "@item()"
28+
}
29+
},
30+
"runAfter": {
31+
"Filter_Try_Scope_Errors": [
32+
"SUCCEEDED"
33+
]
34+
},
35+
"type": "Select"
36+
},
37+
"Terminate": {
38+
"inputs": {
39+
"runError": {
40+
"code": "500",
41+
"message": "One or more errors occurred while processing messages: \n\n@{body('Format_Errors')}"
42+
},
43+
"runStatus": "Failed"
44+
},
45+
"runAfter": {
46+
"Format_Errors": [
47+
"SUCCEEDED"
48+
]
49+
},
50+
"type": "Terminate"
51+
}
52+
},
53+
"runAfter": {
54+
"Try": [
55+
"FAILED",
56+
"SKIPPED",
57+
"TIMEDOUT"
58+
]
59+
},
60+
"type": "Scope"
61+
},
62+
"Try": {
63+
"actions": {
64+
"Business_Logic": {
65+
"inputs": "Replace this action with the actions for your business logic.",
66+
"type": "Compose"
67+
}
68+
},
69+
"runAfter": {},
70+
"type": "Scope"
71+
}
72+
},
73+
"contentVersion": "1.0.0.0",
74+
"outputs": {},
75+
"triggers": {
76+
"When_a_HTTP_request_is_received": {
77+
"kind": "Http",
78+
"type": "Request"
79+
}
80+
}
81+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"title": "Workflow 1",
3+
"description": "Workflow 1 description",
4+
"prerequisites": "Workflow 1 prerequisites",
5+
"skus": [
6+
"standard"
7+
],
8+
"kinds": [
9+
"stateful",
10+
"stateless"
11+
],
12+
"detailsDescription": "Workflow 1 details description \n- point 1 \n- point 2.",
13+
"details": {
14+
"By": "Microsoft",
15+
"Type": "Workflow",
16+
"Trigger": "Request",
17+
"Category": "AI,RAG"
18+
},
19+
"artifacts": [
20+
{
21+
"type": "workflow",
22+
"file": "workflow.json"
23+
}
24+
],
25+
"images": {
26+
"light": "/templates/SimpleAccelerator/Workflow1/workflow-light.png",
27+
"dark": "/templates/SimpleAccelerator/Workflow1/workflow-dark.png"
28+
},
29+
"parameters": [
30+
{
31+
"name": "OpenAIEmbeddingModel_#workflowname#",
32+
"displayName": "Azure OpenAI text embedding deployment model name",
33+
"type": "String",
34+
"description": "Provide the Azure OpenAI embedding model to generate vector embeddings.",
35+
"required": true
36+
},
37+
{
38+
"name": "OpenAIChatModel_#workflowname#",
39+
"displayName": "Azure OpenAI chat model name",
40+
"type": "String",
41+
"description": "Provide the Azure OpenAI chat model name to use for chat completions.",
42+
"required": true
43+
}
44+
],
45+
"connections": {
46+
"azuresql_#workflowname#": {
47+
"connectorId": "/serviceProviders/sql",
48+
"kind": "inapp"
49+
},
50+
"openai_#workflowname#": {
51+
"connectorId": "/serviceProviders/openai",
52+
"kind": "inapp"
53+
}
54+
},
55+
"sourceCodeUrl": "/sourceCodeUrl"
56+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
{
2+
"$schema": "/schemaLink",
3+
"actions": {
4+
"Azure_OpenAI_-_Get_an_embedding": {
5+
"type": "ServiceProvider",
6+
"inputs": {
7+
"parameters": {
8+
"deploymentId": "@parameters('OpenAIEmbeddingModel_#workflowname#')",
9+
"input": "@triggerBody()?['question']"
10+
},
11+
"serviceProviderConfiguration": {
12+
"connectionName": "openai_#workflowname#",
13+
"operationId": "getSingleEmbedding",
14+
"serviceProviderId": "/serviceProviders/openai"
15+
}
16+
},
17+
"runAfter": {}
18+
},
19+
"Response": {
20+
"type": "Response",
21+
"kind": "Http",
22+
"inputs": {
23+
"statusCode": 200,
24+
"body": "@body('Azure_OpenAI_-_Get_chat_completions')?['content']"
25+
},
26+
"runAfter": {
27+
"Azure_OpenAI_-_Get_chat_completions": [
28+
"SUCCEEDED"
29+
]
30+
}
31+
},
32+
"SQL_Server_-_Vector_Search": {
33+
"type": "ServiceProvider",
34+
"description": "Use this query to retrieve vector embeddings from your SQL vector table. Update the query based on your SQL table and schema.",
35+
"inputs": {
36+
"parameters": {
37+
"query": "SELECT TOP(2) filename, chunkid, chunk,\n 1-vector_distance('cosine', CAST(@embedding AS VECTOR(1536)), embedding) AS similarity_score,\n vector_distance('cosine', CAST(@embedding AS VECTOR(1536)), embedding) AS distance_score\n FROM dbo.resumedocs\n ORDER BY distance_score ",
38+
"queryParameters": {
39+
"embedding ": "@{body('Azure_OpenAI_-_Get_an_embedding')['embedding']}"
40+
}
41+
},
42+
"serviceProviderConfiguration": {
43+
"connectionName": "azuresql_#workflowname#",
44+
"operationId": "executeQuery",
45+
"serviceProviderId": "/serviceProviders/sql"
46+
}
47+
},
48+
"runAfter": {
49+
"Azure_OpenAI_-_Get_an_embedding": [
50+
"SUCCEEDED"
51+
]
52+
}
53+
},
54+
"Azure_OpenAI_-_Get_chat_completions": {
55+
"type": "ServiceProvider",
56+
"description": "Update the system message for the LLM based on your requirements.",
57+
"inputs": {
58+
"parameters": {
59+
"deploymentId": "@parameters('OpenAIChatModel_#workflowname#')",
60+
"messages": [
61+
{
62+
"role": "System",
63+
"content": "You're an intelligent and funny assistant who exclusively answers based on the data provided in the search_results: \n- Use the information from search_results to generate your top 3 responses. If the data isn't a perfect match for the user's query, use your best judgment to provide helpful suggestions and include the following format: \n File: {filename}\n Chunk ID: {chunkid}\n Similarity Score: {similarity_score}\n Add a small snippet from the Relevant Text: {chunktext}\n Don't use the entire chunk.\n- Avoid any other external data sources.\n- At the end of the recommendations, add a summary about why the candidate might be a good fit, even if the exact skills and hiring role don't match. Make sure you call out skills that match the description and which ones are missing. If the candidate doesn't have prior experience for the hiring role, we might need to pay extra attention during the interview process.\n- Add an interesting Microsoft-related fact about the technology that was searched: \n\nsearch_results = @{body('SQL_Server_-_Vector_Search')}"
64+
},
65+
{
66+
"role": "User",
67+
"content": "@triggerBody()?['question']",
68+
"user": "Anon"
69+
}
70+
],
71+
"temperature": 1
72+
},
73+
"serviceProviderConfiguration": {
74+
"connectionName": "openai_#workflowname#",
75+
"operationId": "getChatCompletions",
76+
"serviceProviderId": "/serviceProviders/openai"
77+
}
78+
},
79+
"runAfter": {
80+
"SQL_Server_-_Vector_Search": [
81+
"SUCCEEDED"
82+
]
83+
}
84+
}
85+
},
86+
"contentVersion": "1.0.0.0",
87+
"outputs": {},
88+
"triggers": {
89+
"When_a_HTTP_request_is_received": {
90+
"type": "Request",
91+
"kind": "Http",
92+
"inputs": {
93+
"schema": {
94+
"type": "object",
95+
"properties": {
96+
"question": {
97+
"type": "string"
98+
}
99+
}
100+
}
101+
}
102+
}
103+
}
104+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"title": "Workflow 2",
3+
"description": "Workflow 2 description",
4+
"prerequisites": "Workflow 2 prerequisites",
5+
"skus": [
6+
"standard"
7+
],
8+
"kinds": [
9+
"stateful",
10+
"stateless"
11+
],
12+
"detailsDescription": "Workflow 2 details description \n- point 1 \n- point 2.",
13+
"details": {
14+
"By": "Microsoft",
15+
"Type": "Workflow",
16+
"Trigger": "Request",
17+
"Category": "AI,RAG"
18+
},
19+
"artifacts": [
20+
{
21+
"type": "workflow",
22+
"file": "workflow.json"
23+
}
24+
],
25+
"images": {
26+
"light": "/templates/SimpleAccelerator/Workflow2/workflow-light.png",
27+
"dark": "/templates/SimpleAccelerator/Workflow2/workflow-dark.png"
28+
},
29+
"parameters": [
30+
{
31+
"name": "OpenAIEmbeddingModel_#workflowname#",
32+
"displayName": "Azure OpenAI text embedding deployment model name",
33+
"type": "String",
34+
"description": "Provide the Azure OpenAI embedding model to generate vector embeddings.",
35+
"required": true
36+
},
37+
{
38+
"name": "BlobPath_#workflowname#",
39+
"displayName": "Blob Path",
40+
"type": "String",
41+
"description": "Provide the Azure Blob container name from where to get your document.",
42+
"required": true
43+
}
44+
],
45+
"connections": {
46+
"azuresql_#workflowname#": {
47+
"connectorId": "/serviceProviders/sql",
48+
"kind": "inapp"
49+
},
50+
"openai_#workflowname#": {
51+
"connectorId": "/serviceProviders/openai",
52+
"kind": "inapp"
53+
},
54+
"azureblob_#workflowname#": {
55+
"connectorId": "/serviceProviders/AzureBlob",
56+
"kind": "inapp"
57+
}
58+
},
59+
"featuredOperations": [
60+
{
61+
"type": "ChunkText"
62+
}
63+
],
64+
"sourceCodeUrl": "/sourceCodeUrl"
65+
}

0 commit comments

Comments
 (0)