Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b929f82
fix: ui changes (#1)
Prashant-Microsoft Dec 24, 2024
78778e5
fix: in progress status color after fetch task details (#5)
Kiran-Siluveru-Microsoft Dec 24, 2024
ce008fe
cancel notification message updated (#7)
Kiran-Siluveru-Microsoft Dec 24, 2024
672c204
Merge branch 'main' into hotfix
Roopan-Microsoft Dec 26, 2024
45e22fc
Update task.js (#9)
Roopan-Microsoft Dec 26, 2024
dfa236a
Stages overflow issue fix (#10)
Kiran-Siluveru-Microsoft Dec 26, 2024
dbfbb21
fix: added space to the agent (#13)
Prashant-Microsoft Dec 27, 2024
af14bdb
Approve reject buttons titles disabling buttons and (#15)
Kiran-Siluveru-Microsoft Dec 27, 2024
dafa139
Fix: UX becomes damaged when chat outputs sample code for a task (#14)
Mohan-Microsoft Dec 31, 2024
f460bcb
Merge branch 'main' into hotfix
Roopan-Microsoft Jan 15, 2025
eded9db
Added custom event (#24)
Prashant-Microsoft Jan 17, 2025
2968a56
fix: task with zero stages cannot show the page, spins forever and ra…
Prashant-Microsoft Jan 17, 2025
e532601
Merge branch 'main' into hotfix
Roopan-Microsoft Jan 17, 2025
b390adc
Updated the workflow for build and push docker
Roopan-Microsoft Jan 17, 2025
21e2812
updated the repo name
Roopan-Microsoft Jan 17, 2025
e3c69a2
Update requirements.txt
Roopan-Microsoft Jan 17, 2025
69f196d
Update requirements.txt
Roopan-Microsoft Jan 17, 2025
e4f519f
Update requirements.txt
Roopan-Microsoft Jan 17, 2025
e902639
feat: Integrated application insights instrumentation key into the bi…
Prashant-Microsoft Jan 17, 2025
30d8f59
Update test.yml (#43)
Harmanpreet-Microsoft Jan 20, 2025
cbf5aa1
Disabling Text Area functionality (#47)
Kiran-Siluveru-Microsoft Jan 24, 2025
a28d9be
fix: Usability and Alignments changes (#48)
Kiran-Siluveru-Microsoft Jan 24, 2025
2de069b
Update docker-build-and-push.yml to debug
Roopan-Microsoft Jan 24, 2025
990ac0b
Update docker-build-and-push.yml
Roopan-Microsoft Jan 24, 2025
85d6cdd
Update docker-build-and-push.yml to take the correct event name
Roopan-Microsoft Jan 24, 2025
bea0205
Update docker-build-and-push.yml
Roopan-Microsoft Jan 24, 2025
a162653
fix: text area background color (#50)
Kiran-Siluveru-Microsoft Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 20 additions & 28 deletions .github/workflows/docker-build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,13 @@ jobs:
uses: docker/setup-buildx-action@v1

- name: Log in to Azure Container Registry
if: ${{ github.ref_name == 'main' }}
if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix') }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_LOGIN_SERVER }}
username: ${{ secrets.ACR_USERNAME }}
password: ${{ secrets.ACR_PASSWORD }}

- name: Log in to Azure Container Registry (Dev/Demo)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}
uses: azure/docker-login@v2
with:
login-server: ${{ secrets.ACR_DEV_LOGIN_SERVER }}
username: ${{ secrets.ACR_DEV_USERNAME }}
password: ${{ secrets.ACR_DEV_PASSWORD }}

- name: Set Docker image tag
run: |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
Expand All @@ -57,27 +49,27 @@ jobs:
echo "TAG=demo" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/hotfix" ]]; then
echo "TAG=hotfix" >> $GITHUB_ENV
else
echo "TAG=pullrequest-ignore" >> $GITHUB_ENV
fi
- name: Build and push Docker images
if: ${{ github.ref_name == 'main' }}
run: |
cd src/backend
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
echo "Backend image built and pushed successfully."
cd ../frontend
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
echo "Frontend image built and pushed successfully."
- name: Build and push Docker images (Dev/Demo/hotfix)
if: ${{ github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}

- name: Build and push Docker images optionally
run: |
cd src/backend
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/macae-backend:${{ env.TAG }} && \
echo "Dev/Demo/Hotfix Backend image built and pushed successfully."
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macaebackend:${{ env.TAG }} -f Dockerfile . && \
if [[ "${{ env.TAG }}" == "latest" || "${{ env.TAG }}" == "dev" || "${{ env.TAG }}" == "demo" || "${{ env.TAG }}" == "hotfix" ]]; then
docker push ${{ secrets.ACR_LOGIN_SERVER }}/macaebackend:${{ env.TAG }} && \
echo "Backend image built and pushed successfully."
else
echo "Skipping Docker push for backend with tag: ${{ env.TAG }}"
fi
cd ../frontend
docker build -t ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} -f Dockerfile . && \
docker push ${{ secrets.ACR_DEV_LOGIN_SERVER }}/mac-webapp:${{ env.TAG }} && \
echo "Dev/Demo/Hotfix Frontend image built and pushed successfully."
docker build -t ${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.TAG }} -f Dockerfile . && \
if [[ "${{ env.TAG }}" == "latest" || "${{ env.TAG }}" == "dev" || "${{ env.TAG }}" == "demo" || "${{ env.TAG }}" == "hotfix" ]]; then
docker push ${{ secrets.ACR_LOGIN_SERVER }}/macaefrontend:${{ env.TAG }} && \
echo "Frontend image built and pushed successfully."
else
echo "Skipping Docker push for frontend with tag: ${{ env.TAG }}"
fi


1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
python -m pip install --upgrade pip
pip install -r src/backend/requirements.txt
pip install pytest-cov
pip install pytest-asyncio

- name: Check if test files exist
id: check_tests
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ To add your newly created backend image:
name: 'FRONTEND_SITE_NAME'
value: 'https://<website Name>.azurewebsites.net'

name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
value: <Application Insights Instrumentation Key>

- Click 'Save' and deploy your new revision

To add the new container to your website run the following:
Expand Down
7 changes: 6 additions & 1 deletion deploy/macae-continer-oc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.32.4.45862",
"templateHash": "17567587246932458853"
"templateHash": "13282901028774763433"
}
},
"parameters": {
Expand Down Expand Up @@ -366,13 +366,18 @@
{
"name": "FRONTEND_SITE_NAME",
"value": "[format('https://{0}.azurewebsites.net', format(variables('uniqueNameFormat'), 'frontend'))]"
},
{
"name": "APPLICATIONINSIGHTS_INSTRUMENTATION_KEY",
"value": "[reference('appInsights').ConnectionString]"
}
]
}
]
}
},
"dependsOn": [
"appInsights",
"cosmos::autogenDb",
"containerAppEnv",
"cosmos",
Expand Down
4 changes: 4 additions & 0 deletions deploy/macae-continer.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ resource containerApp 'Microsoft.App/containerApps@2024-03-01' = {
name: 'FRONTEND_SITE_NAME'
value: 'https://${format(uniqueNameFormat, 'frontend')}.azurewebsites.net'
}
{
name: 'APPLICATIONINSIGHTS_INSTRUMENTATION_KEY'
value: appInsights.properties.ConnectionString
}
]
}
]
Expand Down
1 change: 1 addition & 0 deletions src/backend/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ COSMOSDB_CONTAINER=memory
AZURE_OPENAI_ENDPOINT=
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
AZURE_OPENAI_API_VERSION=2024-08-01-preview
APPLICATIONINSIGHTS_INSTRUMENTATION_KEY=

BACKEND_API_URL='http://localhost:8000'
FRONTEND_SITE_NAME='http://127.0.0.1:3000'
10 changes: 6 additions & 4 deletions src/backend/agents/agentutils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import json

from autogen_core.components.models import (AssistantMessage,
AzureOpenAIChatCompletionClient)
from autogen_core.components.models import (
AssistantMessage,
AzureOpenAIChatCompletionClient,
)
from pydantic import BaseModel

from context.cosmos_memory import CosmosBufferedChatCompletionContext
from models.messages import InputTask, PlanStatus, Step, StepStatus
from models.messages import Step

common_agent_system_message = "If you do not have the information for the arguments of the function you need to call, do not call the function. Instead, respond back to the user requesting further information. You must not hallucinate or invent any of the information used as arguments in the function. For example, if you need to call a function that requires a delivery address, you must not generate 123 Example St. You must skip calling functions and return a clarification message along the lines of: Sorry, I'm missing some information I need to help you with that. Could you please provide the delivery address so I can do that for you?"

Expand All @@ -27,7 +29,7 @@ class FSMStateAndTransition(BaseModel):
identifiedTargetState: str
identifiedTargetTransition: str

cosmos = CosmosBufferedChatCompletionContext(session_id or "",user_id)
cosmos = CosmosBufferedChatCompletionContext(session_id or "", user_id)
combined_LLM_messages = [
AssistantMessage(content=step.action, source="GroupChatManager")
]
Expand Down
63 changes: 56 additions & 7 deletions src/backend/agents/base_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,26 @@

from autogen_core.base import AgentId, MessageContext
from autogen_core.components import RoutedAgent, message_handler
from autogen_core.components.models import (AssistantMessage,
AzureOpenAIChatCompletionClient,
LLMMessage, SystemMessage,
UserMessage)
from autogen_core.components.models import (
AssistantMessage,
AzureOpenAIChatCompletionClient,
LLMMessage,
SystemMessage,
UserMessage,
)
from autogen_core.components.tool_agent import tool_agent_caller_loop
from autogen_core.components.tools import Tool

from context.cosmos_memory import CosmosBufferedChatCompletionContext
from models.messages import (ActionRequest, ActionResponse,
AgentMessage, Step, StepStatus)
from models.messages import (
ActionRequest,
ActionResponse,
AgentMessage,
Step,
StepStatus,
)
from azure.monitor.events.extension import track_event


class BaseAgent(RoutedAgent):
def __init__(
Expand Down Expand Up @@ -94,15 +104,54 @@ async def handle_action_request(
step_id=message.step_id,
)
)

track_event(
"Base agent - Added into the cosmos",
{
"session_id": message.session_id,
"user_id": self._user_id,
"plan_id": message.plan_id,
"content": f"{result}",
"source": self._agent_name,
"step_id": message.step_id,
},
)

except Exception as e:
print(f"Error during LLM call: {e}")
logging.exception(f"Error during LLM call: {e}")
track_event(
"Base agent - Error during llm call, captured into the cosmos",
{
"session_id": message.session_id,
"user_id": self._user_id,
"plan_id": message.plan_id,
"content": f"{e}",
"source": self._agent_name,
"step_id": message.step_id,
},
)

return
print(f"Task completed: {result}")

step.status = StepStatus.completed
step.agent_reply = result
await self._model_context.update_step(step)

track_event(
"Base agent - Updated step and updated into the cosmos",
{
"status": StepStatus.completed,
"session_id": message.session_id,
"agent_reply": f"{result}",
"user_id": self._user_id,
"plan_id": message.plan_id,
"content": f"{result}",
"source": self._agent_name,
"step_id": message.step_id,
},
)

action_response = ActionResponse(
step_id=step.id,
plan_id=step.plan_id,
Expand Down
1 change: 1 addition & 0 deletions src/backend/agents/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from agents.base_agent import BaseAgent
from context.cosmos_memory import CosmosBufferedChatCompletionContext


async def dummy_function() -> str:
# This is a placeholder function, for a proper Azure AI Search RAG process.

Expand Down
Loading
Loading