-
Notifications
You must be signed in to change notification settings - Fork 1
Aspnet localfunction example #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new ASP.NET Local Function example to demonstrate bridging browser WebRTC clients with OpenAI's real-time API while implementing local function calling capabilities. The example builds on the existing ASP.NET Get Started example to show how to integrate local functions (like weather data) that can be invoked by OpenAI during conversations.
- Adds complete AspNetLocalFunction project with WebRTC bridging and local function calling
- Includes browser UI with live transcription, data channel status, and diagnostics panels
- Updates solution configuration and main README to reference the new example
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| examples/SIPSorcery.OpenAI.WebRTC.Examples.sln | Adds AspNetLocalFunction project to solution configuration |
| examples/AspNetLocalFunction/wwwroot/index.html | Browser UI for WebRTC connection with diagnostics and data channel features |
| examples/AspNetLocalFunction/README.md | Documentation explaining the local function calling example |
| examples/AspNetLocalFunction/Properties/launchSettings.json | ASP.NET launch configuration for development environment |
| examples/AspNetLocalFunction/Program.cs | Main application implementing WebRTC bridging and local function handling |
| examples/AspNetLocalFunction/Dockerfile | Docker configuration for containerized deployment |
| examples/AspNetLocalFunction/AspNetLocalFunction.csproj | Project file with required dependencies |
| examples/AspNetGetStarted/Dockerfile | Fixes incorrect project reference in Docker build |
| README.md | Updates documentation to include new ASP.NET examples |
| // Aaron Clauson ([email protected]) | ||
| // | ||
| // History: | ||
| // 20 Jul 2025 Aaron Clauson Created, Dublin, Ireland. |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The date '20 Jul 2025' appears to be incorrect as it references a future date beyond the current timeframe.
| // 20 Jul 2025 Aaron Clauson Created, Dublin, Ireland. | |
| // 20 Jul 2023 Aaron Clauson Created, Dublin, Ireland. |
| // | ||
| // License: | ||
| // BSD 3-Clause "New" or "Revised" License and the additional | ||
| // BDS BY-NC-SA restriction, see included LICENSE.md file. |
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appears to be a typo in the license reference. 'BDS BY-NC-SA' should likely be 'BSD BY-NC-SA' to match the standard BSD license notation.
| // BDS BY-NC-SA restriction, see included LICENSE.md file. | |
| // BSD BY-NC-SA restriction, see included LICENSE.md file. |
| // This call is synchronous when the WebRTC connection is not yet connected. | ||
| _ = peerConnection.createDataChannel("browser").Result; | ||
|
|
||
| return Task.FromResult(peerConnection); | ||
| } | ||
|
|
Copilot
AI
Jul 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using .Result on an async operation can cause deadlocks in ASP.NET applications. Consider using 'await' or making this method async, or use the synchronous version if available.
| // This call is synchronous when the WebRTC connection is not yet connected. | |
| _ = peerConnection.createDataChannel("browser").Result; | |
| return Task.FromResult(peerConnection); | |
| } | |
| // Await the creation of the data channel to avoid blocking the thread. | |
| _ = await peerConnection.createDataChannel("browser"); | |
| return peerConnection; | |
| } | |
Co-authored-by: Copilot <[email protected]>
No description provided.