Skip to content

Commit b336ff9

Browse files
authored
Merge pull request #286 from Azure-Samples/jimchou/chat-openai-sample-add-EG-instruction
2 parents 1925b9a + 36404b0 commit b336ff9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

chat-openai-sample/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
This sample application demonstrates how to integrate Azure Communication Services Chat SDK with Azure OpenAI Service to enable intelligent message analysis. The application listens for a user message, processes the text through the Azure OpenAI Service, and generates appropriate analysis. Or optionally, developers can replace the logic with their own AI model for message analysis.
88

9-
- app.ts - Node JS application providing HTTP endpoints for message analysis (including EventGrid webhook endpoint)
9+
- app.ts - Node JS application providing HTTP endpoints for message analysis (including Event Grid webhook endpoint)
1010
- client.ts - script to setup chat messages and test HTTP endpoints locally for message analysis
1111

1212
## Prerequisites
@@ -53,6 +53,6 @@ Open the `.env` file to configure the following settings:
5353
1. Open a new Powershell window, cd into the `chat-openai-sample` folder and run `npm run dev`.
5454
2. The browser displays the following dialog box. If not navigate to `http://localhost:8080/`.
5555
3. To test the AI analysis API endpoint on your local machine, in another new Powersehll window for the same directory, run `npm run client` to observe how messages are generated and processed.
56-
4. (optional) To setup EventGrid, follow [Setup and host your Azure DevTunnel](#setup-and-host-your-azure-devtunnel) and register an EventGrid Webhook for the `ChatMessageReceived` event that points to your DevTunnel URI for `<DevTunnelUri>/api/chatMessageReceived`.
56+
4. (optional) To setup Event Grid, follow [Setup and host your Azure DevTunnel](#setup-and-host-your-azure-devtunnel) and register an Event Grid Webhook for the [ChatMessageReceived event](https://learn.microsoft.com/en-us/azure/event-grid/communication-services-chat-events#microsoftcommunicationchatmessagereceived-event) that points to your DevTunnel URI for `<DevTunnelUri>/api/chatMessageReceived`. See here for Event Grid Webhook configuration example [here](https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/events/subscribe-to-events?pivots=platform-azp).
5757

5858
Once that's completed you should have a running application. The best way to test this is to send a message in a chat thread to be analyzed by your intelligent agent.

chat-openai-sample/src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ app.get('/api/chat/:threadId/message/:messageId/translation/:language', async (r
105105
}
106106
});
107107

108-
// EventGrid
108+
/* Event Grid */
109109
app.post("/api/chatMessageReceived", async (req: any, res:any)=>{
110110
console.log(`Received chatMessageReceived event - data --> ${JSON.stringify(req.body)} `);
111111
const event = req.body[0];

0 commit comments

Comments
 (0)