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
The `TextSearchProvider` can be customized via the `TextSearchProviderOptions` class. Here is an example of creating options to run the search prior to every model invocation and keep a short rolling window of conversation context.
72
+
The `TextSearchProvider` can be customized via the `TextSearchProviderOptions` class. Here is an example of creating options to run the search prior to every model invocation and keep a short rolling window of chat history for searches.
72
73
73
74
```csharp
74
75
TextSearchProviderOptionstextSearchOptions=new()
75
76
{
76
-
// Run the search prior to every model invocation and keep a short rolling window of conversation context.
77
+
// Run the search prior to every model invocation and keep a short rolling window of chat history for searches.
@@ -83,17 +84,17 @@ The `TextSearchProvider` class supports the following options via the `TextSearc
83
84
84
85
| Option | Type | Description | Default |
85
86
|--------|------|-------------|---------|
86
-
| SearchTime |`TextSearchProviderOptions.TextSearchBehavior`| Indicates when the search should be executed. There are two options, each time the agent is invoked, or on-demand via function calling. |`TextSearchProviderOptions.TextSearchBehavior.BeforeAIInvoke`|
87
+
| SearchTime |`TextSearchProviderOptions.TextSearchBehavior`| Indicates when the search should be executed. There are two options, each time the agent is run, or on-demand via function calling. |`TextSearchProviderOptions.TextSearchBehavior.BeforeAIInvoke`|
87
88
| FunctionToolName |`string`| The name of the exposed search tool when operating in on-demand mode. | "Search" |
88
89
| FunctionToolDescription |`string`| The description of the exposed search tool when operating in on-demand mode. | "Allows searching for additional information to help answer the user question." |
89
-
| ContextPrompt |`string`| The context prompt prefixed to results when operating in `BeforeAIInvoke` mode. | "## Additional Context\nConsider the following information from source documents when responding to the user:" |
90
-
| CitationsPrompt |`string`| The instruction appended after results to request citations when operating in `BeforeAIInvoke` mode. | "Include citations to the source document with document name and link if document name and link is available." |
91
-
| ContextFormatter |`Func<IList<TextSearchProvider.TextSearchResult>, string>`| Optional delegate to fully customize formatting of the result list when operating in `BeforeAIInvoke` mode. If provided, `ContextPrompt` and `CitationsPrompt` are ignored. |`null`|
90
+
| ContextPrompt |`string`| The context prompt prefixed to results. | "## Additional Context\nConsider the following information from source documents when responding to the user:" |
91
+
| CitationsPrompt |`string`| The instruction appended after results to request citations. | "Include citations to the source document with document name and link if document name and link is available." |
92
+
| ContextFormatter |`Func<IList<TextSearchProvider.TextSearchResult>, string>`| Optional delegate to fully customize formatting of the result list. If provided, `ContextPrompt` and `CitationsPrompt` are ignored. |`null`|
92
93
| RecentMessageMemoryLimit |`int`| The number of recent conversation messages (both user and assistant) to keep in memory and include when constructing the search input for `BeforeAIInvoke` searches. |`0` (disabled) |
93
94
| RecentMessageRolesIncluded |`List<ChatRole>`| The list of `ChatRole` types to filter recent messages to when deciding which recent messages to include when constructing the search input. |`ChatRole.User`|
94
95
95
96
> [!TIP]
96
-
> See the [.NET samples](https://github.com/microsoft/agent-framework/tree/main/dotnet/samples) for complete runnable examples.
97
+
> See the [.NET samples](https://github.com/microsoft/agent-framework/tree/main/dotnet/samples/02-agents/AgentWithRAG) for complete runnable examples.
0 commit comments