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.Web/Tools/BookSearchTool.cs
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,7 @@ public BookSearchTool(IServiceProvider serviceProvider, ISiteMappingService site
32
32
Description("Search the Essential C# book content using semantic vector search. Returns relevant text chunks with chapter and heading context. Use this to find information about C# programming concepts covered in the book.")]
33
33
publicasyncTask<string>SearchBookContent(
34
34
[Description("The search query describing the C# concept or topic to find in the book.")]stringquery,
35
+
[Description("Number of results to return (1–10). Default is 5. Use a higher value for broad topics or comprehensive research; lower for quick lookups.")]intmaxResults=AISearchService.DefaultSearchTop,
35
36
CancellationTokencancellationToken=default)
36
37
{
37
38
if(string.IsNullOrWhiteSpace(query))
@@ -48,7 +49,7 @@ public async Task<string> SearchBookContent(
48
49
return"Book search is not available in this environment (AI services are not configured).";
@@ -172,6 +173,7 @@ public string GetDirectContentUrl(
172
173
Description("Find all sections in the Essential C# book that cover a specific C# concept. Combines section heading search with semantic vector search (when available) to give broad coverage. Returns section slugs, chapter numbers, and direct links.")]
173
174
publicasyncTask<string>LookupConcept(
174
175
[Description("The C# concept, feature, or topic to find in the book (e.g., 'LINQ', 'async/await', 'pattern matching', 'generics').")]stringconcept,
176
+
[Description("Number of semantic search results to return (1–10). Default is 5.")]intmaxResults=AISearchService.DefaultSearchTop,
175
177
CancellationTokencancellationToken=default)
176
178
{
177
179
if(string.IsNullOrWhiteSpace(concept))
@@ -197,7 +199,7 @@ public async Task<string> LookupConcept(
@@ -415,6 +417,7 @@ public async Task<string> FindBookHelpForDiagnostic(
415
417
Description("Find other sections in the Essential C# book that are semantically related to a given section. Uses the section heading as a search query to discover thematically connected content across the entire book. Requires AI services to be configured.")]
416
418
publicasyncTask<string>FindRelatedSections(
417
419
[Description("The section slug/key to find related content for (e.g., 'async-await'). Use GetChapterSections to get valid slugs.")]stringsectionKey,
420
+
[Description("Number of related sections to return (1–10). Default is 5.")]intmaxResults=AISearchService.DefaultSearchTop,
418
421
CancellationTokencancellationToken=default)
419
422
{
420
423
if(string.IsNullOrWhiteSpace(sectionKey))
@@ -434,7 +437,7 @@ public async Task<string> FindRelatedSections(
0 commit comments