Use LangGraph with Azure OpenAI to automatically classify support tickets into predefined categories with confidence scores. UiPath Action Center integration for human approval step.
- Clone the repository:
git clone
cd samples\ticket-classification- Install dependencies:
pip install uv
uv venv -p 3.11 .venv
.venv\Scripts\activate
uv sync- Create a
.envfile in the project root with the following configuration:
UIPATH_URL=https://alpha.uipath.com/ada/byoa
UIPATH_ACCESS_TOKEN=xxx
AZURE_OPENAI_API_KEY=xxx
AZURE_OPENAI_ENDPOINT=xxxuipath run <entrypoint> <input> [--resume]To classify a ticket, run the script using UiPath CLI:
uipath run agent '{"message": "GET Assets API does not enforce proper permissions Assets.View", "ticket_id": "TICKET-2345"}'To resume the graph with approval:
uipath run agent true --resumeThe input ticket should be in the following format:
{
"message": "The ticket message or description",
"ticket_id": "Unique ticket identifier",
"assignee"[optional]: "username or email of the person assigned to handle escalations"
}The script outputs JSON with the classification results:
{
"label": "security",
"confidence": 0.9
}