Skip to content

Commit f738311

Browse files
author
Peter Hauge
committed
Add parameters to bing grounding C# sample
1 parent e895cf5 commit f738311

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

articles/ai-services/agents/how-to/tools/bing-code-samples.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,17 @@ PersistentAgentsClient agentClient = new(projectEndpoint, new DefaultAzureCreden
166166
To make the Grounding with Bing search tool available to your agent, use a connection to initialize the tool and attach it to the agent. You can find your connection in the **connected resources** section of your project in the [Azure AI Foundry portal](https://ai.azure.com/).
167167

168168
```csharp
169+
BingGroundingSearchConfiguration searchConfig = new BingGroundingSearchConfiguration(bingConnectionId)
170+
{
171+
Count = 5,
172+
Freshness = "Week"
173+
};
174+
169175
// Create the BingGroundingToolDefinition object used when creating the agent
170176
BingGroundingToolDefinition bingGroundingTool = new BingGroundingToolDefinition(
171177
new BingGroundingSearchToolParameters(
172178
[
173-
new BingGroundingSearchConfiguration(bingConnectionId)
179+
searchConfig
174180
]
175181
)
176182
);

0 commit comments

Comments
 (0)