Skip to content

Commit f843fd4

Browse files
Merge pull request #5085 from petehauge/phauge/bing-grounding-parameters
Add parameters to Bing Grounding C# sample
2 parents 77fa98d + f738311 commit f843fd4

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)