Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Content Safety sample1 analyze text #37747

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions sdk/contentsafety/Azure.AI.ContentSafety/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ Please refer to [sample data](https://github.com/Azure/azure-sdk-for-net/blob/ma
#### Analyze text without blocklists

```C# Snippet:Azure_AI_ContentSafety_AnalyzeText
string datapath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Samples", "sample_data", "text.txt");
string text = File.ReadAllText(datapath);
string text = "You are an idiot";

var request = new AnalyzeTextOptions(text);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ ContentSafetyClient client = new ContentSafetyClient(new Uri(endpoint), new Azur
You can download our [sample data](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/contentsafety/Azure.AI.ContentSafety/tests/Samples/sample_data), read in the text and initialize `AnalyzeTextOptions` with it. Then call `AnalyzeText` to get analysis result.

```C# Snippet:Azure_AI_ContentSafety_AnalyzeText
string datapath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Samples", "sample_data", "text.txt");
string text = File.ReadAllText(datapath);
string text = "You are an idiot";

var request = new AnalyzeTextOptions(text);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public void AnalyzeText()

#region Snippet:Azure_AI_ContentSafety_AnalyzeText

string datapath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Samples", "sample_data", "text.txt");
string text = File.ReadAllText(datapath);
string text = "You are an idiot";

var request = new AnalyzeTextOptions(text);

Expand Down