A conversational AI agent that fetches and displays news from New York Times RSS feeds.
- Fetches real-time news from NY Times RSS feeds
- Maintains conversation context using session IDs
- Returns formatted news in consistent chat-style responses
- Supports multiple news categories (Technology, Business, Science, etc.)
- Clean, responsive web interface
- .NET 7.0 or later
- A valid API key for Gemini
-
Clone this repository
git clone https://github.com/Abdullah-Sajjad026/SemanticKernelNewsAgent.git cd news-ai-agent -
Update the API configuration:
- Open
appsettings.json - Replace
"your-api-key"with your actual API key:"LLM": { "ApiKey": "your-actual-api-key-here", "Model": "gemini-2.5-pro" }
- Open
-
Run the backend API:
dotnet run
The API will start on
https://localhost:7131by default.
-
Open
WebDemo.htmlin your code editor -
If you changed the backend port, update the API URL:
const ChatApiURL = "https://localhost:YOUR_PORT/api/Chat";
-
Open
WebDemo.htmlin a web browser:- Simply double-click the file, or
- Use a local server like Live Server in VS Code
- Type your request in the chat box (e.g. "technology news")
- Press Enter or click Send
- View formatted news results with:
- Category tags
- Publication dates
- Headlines and summaries
- Links to full articles
- Modify
appsettings.jsonto:- Change the LLM model
- Adjust logging levels
- Configure allowed hosts
- Edit
WebDemo.htmlto:- Change the API endpoint URL
- Modify UI colors and styles
- Adjust session timeout duration
- CORS Errors: Ensure your frontend URL is allowed in the backend CORS configuration
- Empty Responses: Verify your API key is valid and has proper permissions
- Connection Issues: Check that both frontend and backend are using the same protocol (HTTP/HTTPS)
