Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,6 +31,74 @@ PRODUCT_SCOPES = {
|
|
| 31 |
"π Azure OpenAI Service": ['AzureAIServices.ReadWrite.All']
|
| 32 |
}
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
BASE_SCOPES = ['User.Read']
|
| 35 |
|
| 36 |
# MSAL App Instance
|
|
@@ -100,7 +168,7 @@ def main():
|
|
| 100 |
st.sidebar.write("Select products to integrate:")
|
| 101 |
|
| 102 |
selected_products = {}
|
| 103 |
-
for product, info in
|
| 104 |
selected = st.sidebar.checkbox(product)
|
| 105 |
if selected:
|
| 106 |
selected_products[product] = True
|
|
@@ -110,7 +178,7 @@ def main():
|
|
| 110 |
# Request scopes based on selected products
|
| 111 |
request_scopes = BASE_SCOPES.copy()
|
| 112 |
for product in selected_products:
|
| 113 |
-
request_scopes.extend(PRODUCT_SCOPES[product]
|
| 114 |
request_scopes = list(set(request_scopes)) # Remove duplicates
|
| 115 |
st.session_state['request_scopes'] = request_scopes
|
| 116 |
|
|
@@ -123,7 +191,7 @@ def main():
|
|
| 123 |
)
|
| 124 |
st.write(f'π Please [click here]({auth_url}) to log in and authorize the app.')
|
| 125 |
|
| 126 |
-
query_params = st.
|
| 127 |
if 'code' in query_params:
|
| 128 |
code = query_params.get('code')
|
| 129 |
st.write(f'π Authorization Code Obtained: {code[:10]}...')
|
|
@@ -152,7 +220,7 @@ def main():
|
|
| 152 |
else:
|
| 153 |
st.write("No products selected. Please select products from the sidebar.")
|
| 154 |
|
| 155 |
-
# Sidebar navigation menu
|
| 156 |
st.sidebar.title("Navigation")
|
| 157 |
menu = st.sidebar.radio("Go to", [
|
| 158 |
"1οΈβ£ Dashboard",
|
|
@@ -165,5 +233,12 @@ def main():
|
|
| 165 |
"π Filter By"
|
| 166 |
])
|
| 167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
if __name__ == "__main__":
|
| 169 |
main()
|
|
|
|
| 31 |
"π Azure OpenAI Service": ['AzureAIServices.ReadWrite.All']
|
| 32 |
}
|
| 33 |
|
| 34 |
+
# AI capabilities and Graph API information
|
| 35 |
+
products = {
|
| 36 |
+
"π§ Outlook": {
|
| 37 |
+
"ai_capabilities": "Copilot for enhanced email writing, calendar management, and scheduling.",
|
| 38 |
+
"graph_api": "Access to mail, calendar, contacts, and events."
|
| 39 |
+
},
|
| 40 |
+
"π OneNote": {
|
| 41 |
+
"ai_capabilities": "Content suggestion, note organization, and OCR for extracting text from images.",
|
| 42 |
+
"graph_api": "Manage notebooks, sections, and pages."
|
| 43 |
+
},
|
| 44 |
+
"π Excel": {
|
| 45 |
+
"ai_capabilities": "Copilot for advanced data analysis, data insights, and formula generation.",
|
| 46 |
+
"graph_api": "Create and manage worksheets, tables, charts, and workbooks."
|
| 47 |
+
},
|
| 48 |
+
"π Word": {
|
| 49 |
+
"ai_capabilities": "Copilot for document drafting, summarization, and grammar improvements.",
|
| 50 |
+
"graph_api": "Document content access, templates, and file management."
|
| 51 |
+
},
|
| 52 |
+
"ποΈ SharePoint": {
|
| 53 |
+
"ai_capabilities": "Intelligent search, document tagging, and metadata extraction.",
|
| 54 |
+
"graph_api": "Access to sites, lists, files, and document libraries."
|
| 55 |
+
},
|
| 56 |
+
"π
Teams": {
|
| 57 |
+
"ai_capabilities": "Copilot for meeting summaries, transcription, and chat suggestions.",
|
| 58 |
+
"graph_api": "Manage chats, teams, channels, and meetings."
|
| 59 |
+
},
|
| 60 |
+
"π¬ Viva": {
|
| 61 |
+
"ai_capabilities": "Personalized learning insights, well-being insights, and productivity suggestions.",
|
| 62 |
+
"graph_api": "Access to user analytics and learning modules."
|
| 63 |
+
},
|
| 64 |
+
"π Power Platform": {
|
| 65 |
+
"ai_capabilities": "Automation with AI Builder, data insights, and custom AI models.",
|
| 66 |
+
"graph_api": "Automation workflows, app creation, and data visualization."
|
| 67 |
+
},
|
| 68 |
+
"π§ Copilot": {
|
| 69 |
+
"ai_capabilities": "Embedded across Word, Excel, Outlook, Teams, and more for AI-driven productivity.",
|
| 70 |
+
"graph_api": "Underpins Copilot's access to data and integrations."
|
| 71 |
+
},
|
| 72 |
+
"ποΈ OneDrive": {
|
| 73 |
+
"ai_capabilities": "Intelligent file organization and search.",
|
| 74 |
+
"graph_api": "File and folder access, sharing, and metadata."
|
| 75 |
+
},
|
| 76 |
+
"π‘ PowerPoint": {
|
| 77 |
+
"ai_capabilities": "Design suggestions, presentation summarization, and speaker coaching.",
|
| 78 |
+
"graph_api": "Presentation creation, slide management, and templates."
|
| 79 |
+
},
|
| 80 |
+
"π Microsoft Bookings": {
|
| 81 |
+
"ai_capabilities": "Automated scheduling and reminders.",
|
| 82 |
+
"graph_api": "Booking calendars, services, and appointment details."
|
| 83 |
+
},
|
| 84 |
+
"π Loop": {
|
| 85 |
+
"ai_capabilities": "Real-time collaboration and content suggestions.",
|
| 86 |
+
"graph_api": "Access to shared workspaces and collaborative pages."
|
| 87 |
+
},
|
| 88 |
+
"π£οΈ Translator": {
|
| 89 |
+
"ai_capabilities": "Real-time language translation and text-to-speech.",
|
| 90 |
+
"graph_api": "Integrated into communication and translation services."
|
| 91 |
+
},
|
| 92 |
+
"π To Do & Planner": {
|
| 93 |
+
"ai_capabilities": "Task prioritization and smart reminders.",
|
| 94 |
+
"graph_api": "Task creation, management, and synchronization."
|
| 95 |
+
},
|
| 96 |
+
"π Azure OpenAI Service": {
|
| 97 |
+
"ai_capabilities": "Access to GPT models for custom AI implementations.",
|
| 98 |
+
"graph_api": "Used indirectly for building custom AI models into workflows."
|
| 99 |
+
}
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
BASE_SCOPES = ['User.Read']
|
| 103 |
|
| 104 |
# MSAL App Instance
|
|
|
|
| 168 |
st.sidebar.write("Select products to integrate:")
|
| 169 |
|
| 170 |
selected_products = {}
|
| 171 |
+
for product, info in products.items():
|
| 172 |
selected = st.sidebar.checkbox(product)
|
| 173 |
if selected:
|
| 174 |
selected_products[product] = True
|
|
|
|
| 178 |
# Request scopes based on selected products
|
| 179 |
request_scopes = BASE_SCOPES.copy()
|
| 180 |
for product in selected_products:
|
| 181 |
+
request_scopes.extend(PRODUCT_SCOPES[product])
|
| 182 |
request_scopes = list(set(request_scopes)) # Remove duplicates
|
| 183 |
st.session_state['request_scopes'] = request_scopes
|
| 184 |
|
|
|
|
| 191 |
)
|
| 192 |
st.write(f'π Please [click here]({auth_url}) to log in and authorize the app.')
|
| 193 |
|
| 194 |
+
query_params = st.query_params
|
| 195 |
if 'code' in query_params:
|
| 196 |
code = query_params.get('code')
|
| 197 |
st.write(f'π Authorization Code Obtained: {code[:10]}...')
|
|
|
|
| 220 |
else:
|
| 221 |
st.write("No products selected. Please select products from the sidebar.")
|
| 222 |
|
| 223 |
+
# Sidebar navigation menu with AI capabilities and Graph API descriptions
|
| 224 |
st.sidebar.title("Navigation")
|
| 225 |
menu = st.sidebar.radio("Go to", [
|
| 226 |
"1οΈβ£ Dashboard",
|
|
|
|
| 233 |
"π Filter By"
|
| 234 |
])
|
| 235 |
|
| 236 |
+
# Display AI Capabilities and Graph API Information for the selected menu
|
| 237 |
+
if menu in selected_products:
|
| 238 |
+
product_info = products.get(menu, None)
|
| 239 |
+
if product_info:
|
| 240 |
+
st.write(f"**AI Capabilities for {menu}:** {product_info['ai_capabilities']}")
|
| 241 |
+
st.write(f"**Graph API for {menu}:** {product_info['graph_api']}")
|
| 242 |
+
|
| 243 |
if __name__ == "__main__":
|
| 244 |
main()
|