Skip to content

Commit ebe25ce

Browse files
Bionic711nadoylemsftpaullizer
authored
Web Search and other Misc items (#624)
* add limition to py * rmv mjs node * add agent templating poc * upd pipeline * add agent template gallery and start of ai foundry agents * push for paul * add conversationid query param * move abp docs * add plugin/tool auth definitions * upd lang instructions + fix * adad web search--upd/fixes for control center * upd pipelines * add swagger * upd to pipelines * add max lengths checks for payload and templates * fix missing swagger import * add code doc for behavior * add submittedAt back --------- Co-authored-by: Bionic711 <nadoyle@microsoft.com> Co-authored-by: Paul Lizer <paullizer@microsoft.com>
1 parent 74cccf4 commit ebe25ce

74 files changed

Lines changed: 5521 additions & 246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
applyTo: '**/*.js'
3+
---
4+
5+
# JavaScript Language Guide
6+
7+
- Files should start with a comment of the file name. Ex: `// functions_personal_agents.js`
8+
9+
- Imports should be grouped at the top of the document after the module docstring, unless otherwise indicated by the user or for performance reasons in which case the import should be as close as possible to the usage with a documented note as to why the import is not at the top of the file.
10+
11+
- Use 4 spaces per indentation level. No tabs.
12+
13+
- Code and definitions should occur after the imports block.
14+
15+
- Use camelCase for variable and function names. Ex: `myVariable`, `getUserData()`
16+
17+
- Use PascalCase for class names. Ex: `MyClass`
18+
19+
- Do not use display:none. Instead add and remove the d-none class when hiding or showing elements.
20+
21+
- Prefer inline html notifications or toast messages using Bootstrap alert classes over browser alert() calls.

.github/instructions/python-lang.instructions.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
applyTo: '**'
2+
applyTo: '**/*.py'
33
---
44

55
# Python Language Guide
@@ -10,4 +10,6 @@ applyTo: '**'
1010

1111
- Use 4 spaces per indentation level. No tabs.
1212

13-
- Code and definitions should occur after the imports block.
13+
- Code and definitions should occur after the imports block.
14+
15+
- Prefer log_event from functions_appinsights.py for logging activites.

.github/instructions/santize_settings_for_frontend_routes.instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ When building or working with Python frontend routes (Flask routes that render t
2020

2121
## Required Pattern
2222

23+
### Exception: Admin Routes should NEVER be sanitized as it breaks many admin features.
24+
2325
### ✅ CORRECT - Sanitize Before Sending
2426
```python
2527
from functions_settings import get_settings, sanitize_settings_for_user
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
name: SimpleChat Docker Image Publish
32

43
on:
@@ -8,26 +7,33 @@ on:
87
workflow_dispatch:
98

109
jobs:
11-
1210
build:
13-
1411
runs-on: ubuntu-latest
1512

1613
steps:
1714
- name: Azure Container Registry Login
1815
uses: Azure/docker-login@v2
1916
with:
2017
# Container registry username
21-
username: ${{ secrets.ACR_USERNAME }}
18+
username: ${{ secrets.MAIN_ACR_USERNAME }}
2219
# Container registry password
23-
password: ${{ secrets.ACR_PASSWORD }}
20+
password: ${{ secrets.MAIN_ACR_PASSWORD }}
2421
# Container registry server url
25-
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
22+
login-server: ${{ secrets.MAIN_ACR_LOGIN_SERVER }}
23+
- name: Normalize branch name for tag
24+
run: |
25+
REF="${GITHUB_REF_NAME}"
26+
SAFE=$(echo "$REF" \
27+
| tr '[:upper:]' '[:lower:]' \
28+
| sed 's#[^a-z0-9._-]#-#g' \
29+
| sed 's/^-*//;s/-*$//' \
30+
| cut -c1-128)
31+
echo "BRANCH_TAG=$SAFE" >> "$GITHUB_ENV"
2632
2733
- uses: actions/checkout@v3
2834
- name: Build the Docker image
2935
run:
30-
docker build . --file application/single_app/Dockerfile --tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER;
31-
docker tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:latest;
32-
docker push ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER;
33-
docker push ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:latest;
36+
docker build . --file application/single_app/Dockerfile --tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER;
37+
docker tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:latest;
38+
docker push ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER;
39+
docker push ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat:latest;
Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11

2-
name: SimpleChat Docker Image Publish (dev branch)
2+
name: SimpleChat Docker Image Publish (development/staging branch)
33

44
on:
55
push:
66
branches:
77
- Development
8+
- staging
89

910
workflow_dispatch:
1011

1112
jobs:
12-
13-
build:
14-
13+
build-tomain:
1514
runs-on: ubuntu-latest
1615

1716
steps:
@@ -25,10 +24,53 @@ jobs:
2524
# Container registry server url
2625
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
2726

27+
- name: Normalize branch name for tag
28+
run: |
29+
REF="${GITHUB_REF_NAME}"
30+
SAFE=$(echo "$REF" \
31+
| tr '[:upper:]' '[:lower:]' \
32+
| sed 's#[^a-z0-9._-]#-#g' \
33+
| sed 's/^-*//;s/-*$//' \
34+
| cut -c1-128)
35+
echo "BRANCH_TAG=$SAFE" >> "$GITHUB_ENV"
36+
2837
- uses: actions/checkout@v3
2938
- name: Build the Docker image
3039
run:
31-
docker build . --file application/single_app/Dockerfile --tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER;
32-
docker tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:latest;
33-
docker push ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:$(date +'%Y-%m-%d')_$GITHUB_RUN_NUMBER;
40+
docker build . --file application/single_app/Dockerfile --tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER;
41+
docker tag ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:latest;
42+
docker push ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER;
3443
docker push ${{ secrets.ACR_LOGIN_SERVER }}/simple-chat-dev:latest;
44+
45+
build-nadoyle:
46+
runs-on: ubuntu-latest
47+
48+
steps:
49+
- name: Azure Container Registry Login
50+
uses: Azure/docker-login@v2
51+
with:
52+
# Container registry username
53+
username: ${{ secrets.ACR_USERNAME_NADOYLE }}
54+
# Container registry password
55+
password: ${{ secrets.ACR_PASSWORD_NADOYLE }}
56+
# Container registry server url
57+
login-server: ${{ secrets.ACR_LOGIN_SERVER_NADOYLE }}
58+
59+
- name: Normalize branch name for tag
60+
run: |
61+
REF="${GITHUB_REF_NAME}"
62+
SAFE=$(echo "$REF" \
63+
| tr '[:upper:]' '[:lower:]' \
64+
| sed 's#[^a-z0-9._-]#-#g' \
65+
| sed 's/^-*//;s/-*$//' \
66+
| cut -c1-128)
67+
echo "BRANCH_TAG=$SAFE" >> "$GITHUB_ENV"
68+
69+
- uses: actions/checkout@v3
70+
- name: Build the Docker image
71+
run:
72+
docker build . --file application/single_app/Dockerfile --tag ${{ secrets.ACR_LOGIN_SERVER_NADOYLE }}/simple-chat-dev:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER;
73+
docker tag ${{ secrets.ACR_LOGIN_SERVER_NADOYLE }}/simple-chat-dev:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER ${{ secrets.ACR_LOGIN_SERVER_NADOYLE }}/simple-chat-dev:latest;
74+
docker push ${{ secrets.ACR_LOGIN_SERVER_NADOYLE }}/simple-chat-dev:$(date +'%Y-%m-%d')_${BRANCH_TAG}_$GITHUB_RUN_NUMBER;
75+
docker push ${{ secrets.ACR_LOGIN_SERVER_NADOYLE }}/simple-chat-dev:latest;
76+

.github/workflows/docker_image_publish_nadoyle.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ on:
55
push:
66
branches:
77
- nadoyle
8-
- feature/group-agents-actions
9-
- security/containerBuild
108
- feature/aifoundryagents
11-
- azureBillingPlugin
129

1310
workflow_dispatch:
1411

application/single_app/static/json/schemas/azure_billing_plugin.additional_settings.schema.json renamed to application/community_customizations/actions/azure_billing_retriever/azure_billing_plugin.additional_settings.schema.json

File renamed without changes.

application/single_app/static/json/schemas/azure_billing_plugin.definition.json renamed to application/community_customizations/actions/azure_billing_retriever/azure_billing_plugin.definition.json

File renamed without changes.

application/community_customizations/actions/azure_billing_retriever/readme.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Azure Billing Action Instructions
44

55
## Overview
6-
The Azure Billing action is an experimental Semantic Kernel plugin that helps agents explore Azure Cost Management data, generate CSV outputs, and render server-side charts for conversational reporting. It stitches together Azure REST APIs, matplotlib rendering, and Cosmos DB persistence so prototype agents can investigate subscriptions, budgets, alerts, and forecasts without touching the production portal. It leverages message injection (direct cosmos_messages_container access) to store chart images as conversation artifacts in lieu of embedding binary data in chat responses.
6+
The Azure Billing action is an experimental Semantic Kernel plugin that helps agents explore Azure Cost Management data, generate CSV outputs, and render server-side charts for conversational reporting. It stitches together Azure REST APIs, matplotlib rendering, and Cosmos DB persistence so prototype agents can investigate subscriptions, budgets, alerts, and forecasts without touching the production portal. It leverages message injection (direct cosmos_messages_container access) to store chart images as conversation artifacts in lieu of embedding binary data in chat responses. You will need to move the ```azure_billing_plugin.py``` to the [semantic-kernel-plugins](../../../single_app/semantic_kernel_plugins/) folder, and move the ```schema.json``` and ```definition.json``` to the [schemas](../../../single_app/static/json/schemas) folder.
77

88
## Core capabilities
99
- Enumerate subscriptions and resource groups via `list_subscriptions*` helpers for quick scope discovery.
@@ -48,6 +48,5 @@ The Azure Billing action is an experimental Semantic Kernel plugin that helps ag
4848

4949
## Additional resources
5050
- Review `instructions.md` in the same directory for the autonomous agent persona tailored to this action.
51-
- Inspect `abd_proto.py` for prompt experimentation tied to Azure Billing dialogues.
5251
- Leverage the sample CSV files to validate plotting offline before wiring the plugin into a notebook or agent loop.
5352

application/single_app/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
from route_backend_retention_policy import *
5656
from route_backend_plugins import bpap as admin_plugins_bp, bpdp as dynamic_plugins_bp
5757
from route_backend_agents import bpa as admin_agents_bp
58+
from route_backend_agent_templates import bp_agent_templates
5859
from route_backend_public_workspaces import *
5960
from route_backend_public_documents import *
6061
from route_backend_public_prompts import *
@@ -98,6 +99,7 @@
9899
app.register_blueprint(admin_plugins_bp)
99100
app.register_blueprint(dynamic_plugins_bp)
100101
app.register_blueprint(admin_agents_bp)
102+
app.register_blueprint(bp_agent_templates)
101103
app.register_blueprint(plugin_validation_bp)
102104
app.register_blueprint(bp_migration)
103105
app.register_blueprint(plugin_logging_bp)

0 commit comments

Comments
 (0)