forked from davidmigloz/langchain_dart
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement tavily_dart, a Dart client for Tavily API (davidmiglo…
- Loading branch information
1 parent
8c90237
commit 6681569
Showing
15 changed files
with
2,175 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
targets: | ||
$default: | ||
builders: | ||
source_gen|combining_builder: | ||
options: | ||
ignore_for_file: | ||
- prefer_final_parameters | ||
- require_trailing_commas | ||
- non_constant_identifier_names | ||
- unnecessary_null_checks | ||
json_serializable: | ||
options: | ||
explicit_to_json: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
void main() { | ||
// TODO | ||
// ignore_for_file: avoid_print | ||
import 'dart:io'; | ||
|
||
import 'package:tavily_dart/tavily_dart.dart'; | ||
|
||
void main() async { | ||
final apiKey = Platform.environment['TAVILY_API_KEY']!; | ||
final client = TavilyClient(); | ||
|
||
// Basic search | ||
final res1 = await client.search( | ||
request: SearchRequest( | ||
apiKey: apiKey, | ||
query: 'Should I invest in Apple right now?', | ||
), | ||
); | ||
print(res1); | ||
|
||
// Advanced search | ||
final res2 = await client.search( | ||
request: SearchRequest( | ||
apiKey: apiKey, | ||
query: 'Should I invest in Apple right now?', | ||
searchDepth: SearchRequestSearchDepth.advanced, | ||
), | ||
); | ||
print(res2); | ||
} |
Oops, something went wrong.