Lesson 3: Specialized Agent with Stock Sentiment Analysis¶
This lesson creates a specialized agent focused on stock sentiment analysis using the Agent Framework with specific system instructions and function calling capabilities.
-
Switch to Lesson 3 directory:
-
Copy the configuration file from the Solutions directory:
-
Run the application to see it works:
-
Open
Program.csand build a specialized stock sentiment agent:-
TODO: Step 1 - Initialize the chat client and plugins:
-
TODO: Step 2 - Create AI Functions from plugins:
-
TODO: Step 3 - Define specialized system instructions for stock sentiment analysis:
string stockSentimentAgentInstructions = """ You are a Stock Sentiment Agent. Your responsibility is to find the stock sentiment for a given Stock. RULES: - Use stock sentiment scale from 1 to 10 where stock sentiment is 1 for sell and 10 for buy. - Provide the rating in your response and a recommendation to buy, hold or sell. - Include the reasoning behind your recommendation. - Include the source of the sentiment in your response. - Focus on technical analysis based on stock price data and general market knowledge. """; -
TODO: Step 4 - Create the specialized Stock Sentiment Agent:
-
TODO: Step 5 - Create thread and process user requests:
-
-
Test the specialized agent with stock sentiment queries:
Example questions to test:
User > What is your sentiment on MSFT? Assistant > (should analyze Microsoft stock and provide sentiment rating 1-10 with buy/hold/sell recommendation) User > Analyze AAPL sentiment Assistant > (should provide Apple stock sentiment analysis with reasoning) User > Should I buy TSLA? Assistant > (should analyze Tesla and provide specific buy/hold/sell recommendation)
This lesson demonstrates how to create specialized agents with focused system instructions and domain-specific capabilities using the Agent Framework.