You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: EssentialCSharp.Chat.Shared/Services/AIChatService.cs
+31-1Lines changed: 31 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,9 @@ public class AIChatService
13
13
{
14
14
privatereadonlyAIOptions_Options;
15
15
privatereadonlyAzureOpenAIClient_AzureClient;
16
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
@@ -24,7 +26,9 @@ public AIChatService(IOptions<AIOptions> options, AISearchService searchService,
24
26
// Initialize Azure OpenAI client and get the Response Client from it
25
27
_AzureClient=azureClient;
26
28
29
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
28
32
}
29
33
30
34
/// <summary>
@@ -43,8 +47,10 @@ public AIChatService(IOptions<AIOptions> options, AISearchService searchService,
43
47
string?systemPrompt=null,
44
48
string?previousResponseId=null,
45
49
IMcpClient?mcpClient=null,
50
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
48
54
boolenableContextualSearch=false,
49
55
CancellationTokencancellationToken=default)
50
56
{
@@ -69,8 +75,10 @@ public AIChatService(IOptions<AIOptions> options, AISearchService searchService,
69
75
string?systemPrompt=null,
70
76
string?previousResponseId=null,
71
77
IMcpClient?mcpClient=null,
78
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
// Create the streaming response using the Responses API
92
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
143
156
if(updateisStreamingResponseCreatedUpdatecreated)
144
157
{
145
158
// Remember the response ID for later function calls
yieldreturn(string.Empty,responseId:completedUpdate.Response.Id);// Signal completion with response ID
171
184
}
185
+
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
172
186
}
173
187
}
174
188
175
189
/// <summary>
176
190
/// Executes a function call and streams the response
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
179
194
FunctionCallResponseItemfunctionCallItem,
180
195
ResponseCreationOptionsresponseOptions,
196
+
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
// Create input items with both the function call and the result
219
235
// This matches the Python pattern: append both tool_call and result
236
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
225
243
226
244
// Stream the function call response using the same processing logic
/// Creates response options with optional features
240
258
/// </summary>
259
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
271
293
}
272
294
}
273
295
274
296
// Add reasoning options if specified
275
297
if(reasoningEffortLevel.HasValue)
276
298
{
299
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
291
316
ResponseCreationOptionsresponseOptions,
317
+
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
292
318
string?systemPrompt=null,
293
319
CancellationTokencancellationToken=default)
294
320
{
295
321
// Construct the user input with system context if provided
// Create the streaming response using the Responses API
325
+
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning disable OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
#pragma warning restore OPENAI001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
0 commit comments