Back to Code: A Rusty Developer’s journey to code with Generative AI

Back to Code: A Rusty Developer’s journey to code with Generative AI

After a few years away from the daily grind of programming, this lunar year holidays I embarked on a little journey back to coding —and with a powerful ally by my side (GenAI). I discovered how AI has transformed the development process while building a little complex project that I gave myself as an objective, creating a "Virtual Contact Center project." powered with AI.

While the idea of building an AI powered Call Center with little coding experience sounds very complex, AI was able to easily make it sounds simple and break down the complexity.

Initial prompt:

I need your help to build a proof of concept, I want to use gpt-4o-realtime audio to create a virtual agent powered by ai to talk to.
I want to enable this conversation through phone, means I will issue a call from the virtual agent to the phone of the customer.
I also need to be able to record and analyze this conversation in realtime.
I need to be able to record the conversation for later analysis        

As I started with my first prompt, it was hard to follow as the AI will simply generate everything one shot (imagine multiple lines and pages or code printed out at one go), after few iterations the prompt became a bit longer to make it easier to implement everything step by step but also to take into consideration the vision of the project.

Enhanced prompt:

I need your help to build a proof of concept, I want to create a virtual CALL CENTER agent powered by AI, that can call people on their phone when I input their phone number.

I want to enable this conversation through phone, means I will issue a call from the virtual agent to the phone of the customer this will use azure communications services.
The AI engine need to be GPT-4o Realtime API for speech and audio to give a human like feeling.
I need to be able to record the conversation for later analysis - stored in blob storage.
I am using visual studio ultimate 2022 and I have a rusty understanding of coding in C#.
I need detailed step by step going to the detail as which project I need to create and cs page to create and name to put on it but also code to write or snippets to add. also what to do or create on Azure.
Let's take it with small portions try them then progress.
Later we can add the ability to analyse the conversation in Realtime.
Ensure the code is correct and does not contain hallucinated methods or APIs. If something is unknown or unclear, let me know instead of guessing.        

The prompt itself could be made even better by simply asking the AI to generate a better prompt.

I went through the experience, and after multiple hours of code, 2 sleepless nights and grinding to build the API and build the web app to consume it, I finally ended up with a simple interface in which I can input a phone number, and it would initiate a call with an automated bot powered by GPT 4o that would act depending on the instruction given.

Article content

Allow me to walk you through some learning from this experience

──────────────────────────────

Pros of Coding with Generative AI

  1. Familiar Language, Modern Tools: One of the standout benefits is that generative AI can work in any programming language—even the ones you’re most familiar with. This means that no matter your background, you can leverage cutting-edge tools to build and troubleshoot high-quality solutions.
  2. Incremental Code Generation: When prompted correctly, the AI can break down the project into smaller, digestible parts. This incremental approach not only helps keep things manageable but also ensures that each piece can be tested and integrated step by step.
  3. A Robust Debugging and Explanation: AI has proven to be an excellent debugging companion. It can explain code, suggest improvements, and even point out potential pitfalls—all of which plays a crucial role in maintaining a clean and efficient codebase.

──────────────────────────────

Cons and Considerations

  1. Prompting is Key for Complex Projects: One lesson I learned is that for intricate projects, it’s essential to prompt the AI for bits of code one at a time. If you ask for the entire code base in one shot, you might receive a torrent of information that can be overwhelming and hard to integrate logically. Breaking down the problem into smaller chunks—and testing each milestone—is paramount.
  2. Staying Up-To-Date with New Technologies: Generative AI is fantastic at many things, but when it comes to new technologies or cutting-edge SDKs, it might not have the latest details. I encountered instances where the AI began “hallucinating” parts of the API if it wasn’t guided correctly. For the most accurate results, either prompt very specifically or consider using a version with web access and real-time updates.

──────────────────────────────

Leveraging Azure's Comprehensive Ecosystem

One of the key factors that made this rapid development possible was the comprehensive suite of services available on Microsoft Azure. The project heavily relied on various Azure offerings, which seamlessly integrated to create a robust foundation for our quick AI-powered Virtual Contact Center project.

Key Azure services utilized:

  1. Azure Communication Services: This formed the backbone of our calling functionality, allowing us to initiate, manage, and terminate calls programmatically.
  2. Azure Web App: We hosted our API and Client app on Azure's Web App service, ensuring high availability and easy scalability for our application.
  3. Azure OpenAI Service: This allowed us to integrate advanced AI capabilities, including GPT models, directly into our application (mainly GPT-4o-Realtime).
  4. Azure Blob Storage: This was used to store the recording of the calls

The beauty of using Azure was the seamless integration between these services. This allowed me to focus on building the core functionality of the app rather than worrying about infrastructure or service compatibility issues.

Moreover, Azure's robust documentation and community support proved invaluable when working with newer SDKs or services which were not known by the Generative AI.

──────────────────────────────

Final Thoughts

In just two days, I managed to code and run a fully operational proof-of-concept—a Virtual Contact Center powered by AI. While it’s not a production-ready release, the experience has been incredibly enriching. It reaffirmed that the combination of human expertise and generative AI can open exciting new avenues in software development.

Whether you’re returning to coding, or you’re a seasoned developer looking to experiment with new tools, generative AI has something to offer. It’s all about the collaboration: using AI to inspire ideas and assist with tackling challenges, while you direct the creative process with critical thinking and strategy.

I’m excited to see where this blend of traditional coding and AI-assisted development takes us in the future. What are your experiences with generative AI in your projects? Let’s share insights and keep the conversation going!

(I confirm using AI to help me rewrite a portion of this article)

──────────────────────────────

Hope you enjoy and feel free to connect if you’d like to discuss further!


Nilesh Kumar

AI Solution Architect @ NVIDIA | AI Consultant | AI Product Architect | Machine Learning | LLMs

2mo

Would you not need a dialogue manager to manage the flow of the conversation? how did you get that in Azure ? In GCP you have Dialogue Flow is there any equivalent ?

Like
Reply
Sebastian Henze

Data & AI Solution Architect, Digital Natives Asia at Microsoft

2mo

Since I have never worked with ACS myself, it would be fantastic if you could share the link to the repo 😊

To view or add a comment, sign in

Insights from the community

Others also viewed

Explore topics