From bd038e5806265cedade265ea5e0a84312c54cd49 Mon Sep 17 00:00:00 2001 From: shahparth-lab <80121421+shahparth-lab@users.noreply.github.com> Date: Wed, 16 Apr 2025 14:53:57 -0700 Subject: [PATCH 1/2] Add files via upload --- AI-sample-demo/connections.json | 16 +++ AI-sample-demo/host.json | 7 ++ AI-sample-demo/local.settings.json | 23 +++++ AI-sample-demo/procurement-flow/workflow.json | 97 +++++++++++++++++++ AI-sample-demo/workflow-designtime/host.json | 14 +++ .../workflow-designtime/local.settings.json | 9 ++ 6 files changed, 166 insertions(+) create mode 100644 AI-sample-demo/connections.json create mode 100644 AI-sample-demo/host.json create mode 100644 AI-sample-demo/local.settings.json create mode 100644 AI-sample-demo/procurement-flow/workflow.json create mode 100644 AI-sample-demo/workflow-designtime/host.json create mode 100644 AI-sample-demo/workflow-designtime/local.settings.json diff --git a/AI-sample-demo/connections.json b/AI-sample-demo/connections.json new file mode 100644 index 0000000..39c879b --- /dev/null +++ b/AI-sample-demo/connections.json @@ -0,0 +1,16 @@ +{ + "managedApiConnections": {}, + "serviceProviderConnections": { + "openai": { + "parameterValues": { + "openAIEndpoint": "@appsetting('openai_openAIEndpoint')", + "openAIKey": "@appsetting('openai_openAIKey')" + }, + "parameterSetName": "KeyAndEndpointConnection", + "serviceProvider": { + "id": "/serviceProviders/openai" + }, + "displayName": "new-sampleconnection" + } + } +} \ No newline at end of file diff --git a/AI-sample-demo/host.json b/AI-sample-demo/host.json new file mode 100644 index 0000000..b092be7 --- /dev/null +++ b/AI-sample-demo/host.json @@ -0,0 +1,7 @@ +{ + "version": "2.0", + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows", + "version": "[1.*, 2.0.0)" + } +} \ No newline at end of file diff --git a/AI-sample-demo/local.settings.json b/AI-sample-demo/local.settings.json new file mode 100644 index 0000000..f5ef9a6 --- /dev/null +++ b/AI-sample-demo/local.settings.json @@ -0,0 +1,23 @@ +{ + "IsEncrypted": false, + "Values": { + "FUNCTIONS_EXTENSION_VERSION": "~4", + "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "", + "WEBSITE_SITE_NAME": "AI-sample-demo", + "FUNCTIONS_WORKER_RUNTIME": "dotnet", + "APP_KIND": "workflowApp", + "WEBSITE_AUTH_ENABLED": "False", + "WEBSITE_DEFAULT_HOSTNAME": ".azurewebsites.net", + "openai_openAIKey": "152f2b7d6fb84ba7972e51ec0383c56b", + "AzureFunctionsJobHost__extensionBundle__id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows", + "ScmType": "None", + "openai_openAIEndpoint": "https://.openai.azure.com/", + "WEBSITE_CONTENTSHARE": "", + "AzureWebJobsStorage": "", + "FUNCTIONS_RUNTIME_SCALE_MONITORING_ENABLED": "1", + "AzureFunctionsJobHost__extensionBundle__version": "[1.*, 2.0.0)", + "WEBSITE_SLOT_NAME": "Production", + "APPLICATIONINSIGHTS_CONNECTION_STRING": "", + "WEBSITE_NODE_DEFAULT_VERSION": "20.18.3" + } +} \ No newline at end of file diff --git a/AI-sample-demo/procurement-flow/workflow.json b/AI-sample-demo/procurement-flow/workflow.json new file mode 100644 index 0000000..8469103 --- /dev/null +++ b/AI-sample-demo/procurement-flow/workflow.json @@ -0,0 +1,97 @@ +{ + "definition": { + "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", + "actions": { + "documents": { + "type": "Compose", + "inputs": [ + { + "id": "1", + "title": "Dell Latitude 5540 Laptop", + "content": "Intel i7, 16GB RAM, 512GB SSD, standard issue for IT new hire onboarding" + }, + { + "id": "2", + "title": "Docking Station", + "content": "Dell WD19S docking stations for dual monitor setup" + } + ], + "runAfter": {} + }, + "question": { + "type": "Compose", + "inputs": [ + { + "role": "user", + "content": "When did we last order laptops for new hires in IT?" + } + ], + "runAfter": { + "documents": [ + "SUCCEEDED" + ] + } + }, + "customer": { + "type": "Compose", + "inputs": { + "firstName": "Alex", + "lastName": "Taylor", + "department": "IT", + "employeeId": "E12345", + "orders": [ + { + "name": "Dell Latitude 5540 Laptop", + "description": "Ordered 15 units for Q1 IT onboarding", + "date": "2024/02/20" + }, + { + "name": "Docking Station", + "description": "Bulk purchase of 20 Dell WD19S docking stations", + "date": "2024/01/10" + } + ] + }, + "runAfter": { + "question": [ + "SUCCEEDED" + ] + } + }, + "Get_chat_completions_using_Prompt_Template": { + "type": "ServiceProvider", + "inputs": { + "parameters": { + "deploymentId": "gpt-4o", + "promptTemplateInput": "system:\nYou are an AI assistant for Contoso's internal procurement team. You help employees get quick answers \nabout previous orders and product catalog details. Be brief, professional, and use markdown formatting \nwhen appropriate. Include the employee’s name in your response for a personal touch.\n\n# Product Catalog\nUse this documentation to guide your response. Include specific item names and any relevant descriptions.\n\n{% for item in documents %}\nCatalog Item ID: {{item.id}}\nName: {{item.title}}\nDescription: {{item.content}}\n{% endfor %}\n\n# Order History\nHere is the employee's procurement history to use as context when answering their question.\n\n{% for item in customer.orders %}\nOrder Item: {{item.name}}\nDetails: {{item.description}} — Ordered on {{item.date}}\n{% endfor %}\n\n# Employee Info\nName: {{customer.firstName}} {{customer.lastName}} \nDepartment: {{customer.department}} \nEmployee ID: {{customer.employeeId}}\n\n# Question\nThe employee has asked the following:\n\n{% for item in question %}\n{{item.role}}:\n{{item.content}}\n{% endfor %}\n\nBased on the product documentation and order history above, please provide a concise and helpful answer to their question. Do not fabricate information beyond the provided inputs.\n", + "temperature": 1, + "promptTemplateInputVariables": { + "documents": "@outputs('documents')", + "question": "@outputs('question')", + "customer": "@outputs('customer')" + } + }, + "serviceProviderConfiguration": { + "connectionName": "openai", + "operationId": "getChatCompletionsUsingPromptTemplate", + "serviceProviderId": "/serviceProviders/openai" + } + }, + "runAfter": { + "customer": [ + "SUCCEEDED" + ] + } + } + }, + "contentVersion": "1.0.0.0", + "outputs": {}, + "triggers": { + "When_a_HTTP_request_is_received": { + "type": "Request", + "kind": "Http" + } + } + }, + "kind": "Stateful" +} \ No newline at end of file diff --git a/AI-sample-demo/workflow-designtime/host.json b/AI-sample-demo/workflow-designtime/host.json new file mode 100644 index 0000000..fe64a2b --- /dev/null +++ b/AI-sample-demo/workflow-designtime/host.json @@ -0,0 +1,14 @@ +{ + "version": "2.0", + "extensionBundle": { + "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows", + "version": "[1.*, 2.0.0)" + }, + "extensions": { + "workflow": { + "settings": { + "Runtime.WorkflowOperationDiscoveryHostMode": "true" + } + } + } +} diff --git a/AI-sample-demo/workflow-designtime/local.settings.json b/AI-sample-demo/workflow-designtime/local.settings.json new file mode 100644 index 0000000..4fb8cb3 --- /dev/null +++ b/AI-sample-demo/workflow-designtime/local.settings.json @@ -0,0 +1,9 @@ +{ + "IsEncrypted": false, + "Values": { + "APP_KIND": "workflowapp", + "FUNCTIONS_WORKER_RUNTIME": "node", + "ProjectDirectoryPath": "c:\\Users\\shahparth\\Downloads\\AI-sample-demo", + "AzureWebJobsSecretStorageType": "Files" + } +} From a1edf67bc698ea5a77452b724876b10eb339993e Mon Sep 17 00:00:00 2001 From: shahparth-lab <80121421+shahparth-lab@users.noreply.github.com> Date: Mon, 12 May 2025 16:04:46 -0700 Subject: [PATCH 2/2] Added analyze document demo Announcing the new action that would take image as input and output markdown or text --- AI-sample-demo/analyze-doc | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 AI-sample-demo/analyze-doc diff --git a/AI-sample-demo/analyze-doc b/AI-sample-demo/analyze-doc new file mode 100644 index 0000000..e69de29