File tree 1 file changed +3
-10
lines changed
dotnet/samples/Demos/ModelContextProtocolPlugin
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change 73
73
Console . WriteLine ( $ "\n \n { prompt } \n { result } ") ;
74
74
75
75
// Define the agent
76
- ChatCompletionAgent agent =
77
- new ( )
76
+ ChatCompletionAgent agent = new ( )
78
77
{
79
78
Instructions = "Answer questions about GitGub repositories." ,
80
79
Name = "GitHubAgent" ,
81
80
Kernel = kernel ,
82
81
Arguments = new KernelArguments ( new PromptExecutionSettings ( ) { FunctionChoiceBehavior = FunctionChoiceBehavior . Auto ( ) } ) ,
83
82
} ;
84
83
85
- /// Create the chat history thread to capture the agent interaction.
86
- AgentThread thread = new ChatHistoryAgentThread ( ) ;
87
-
88
84
// Respond to user input, invoking functions where appropriate.
89
- Console . WriteLine ( "\n \n Response from GitHubAgent:" ) ;
90
- await foreach ( ChatMessageContent response in agent . InvokeAsync ( "Summarize the last four commits to the microsoft/semantic-kernel repository?" , thread ) )
91
- {
92
- Console . WriteLine ( response . Content ) ;
93
- }
85
+ ChatMessageContent response = await agent . InvokeAsync ( "Summarize the last four commits to the microsoft/semantic-kernel repository?" ) . FirstAsync ( ) ;
86
+ Console . WriteLine ( $ "\n \n Response from GitHubAgent:\n { response . Content } ") ;
You can’t perform that action at this time.
0 commit comments