Skip to content

Commit

Permalink
docs: Updated README>
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Oct 1, 2024
1 parent 5ffea0d commit 6c96f22
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,24 @@
```csharp
using Tavily;

using var client = new TavilyClient(apiKey);
var apiKey =
Environment.GetEnvironmentVariable("TAVILY_API_KEY") ??
throw new AssertInconclusiveException("TAVILY_API_KEY environment variable is not found.");

using var client = new TavilyClient();

SearchResponse searchResponse = await client.SearchAsync(
apiKey: apiKey,
query: "Who is Leo Messi?");

foreach (var result in searchResponse.Results)
{
Console.WriteLine($"Title: {result.Title}");
Console.WriteLine($"Content: {result.Content}");
Console.WriteLine($"Score: {result.Score}");
Console.WriteLine($"Url: {result.Url}");
Console.WriteLine();
}
```

## Support
Expand Down

0 comments on commit 6c96f22

Please sign in to comment.