@elizaos/plugin-web-search 0.1.8 → 0.25.6-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 Shaw Walters, aka Moon aka @lalalune
3
+ Copyright (c) 2025 Shaw Walters, aka Moon aka @lalalune
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
package/README.MD CHANGED
@@ -28,7 +28,7 @@ TAVILY_API_KEY=your_api_key # Required: API key for search service
28
28
 
29
29
  ## Usage
30
30
 
31
- Import and register the plugin in your Eliza configuration:
31
+ Import and register the plugin in your Eliza configuration.
32
32
 
33
33
  ```typescript
34
34
  import { webSearchPlugin } from "@elizaos/plugin-web-search";
@@ -39,6 +39,28 @@ export default {
39
39
  };
40
40
  ```
41
41
 
42
+ **Custom Usage**
43
+ If you want custom usage, for example, twitter-client to search the web before posting a tweet, you can also import the webSearchService and use it directly. Here's how you can do it:
44
+
45
+ ```typescript
46
+ // packages/client-twitter/src/post.ts
47
+ const webSearchService = new WebSearchService();
48
+ await webSearchService.initialize(runtime);
49
+ const latestNews = await webSearchService.search(
50
+ "latest news on AI Agents",
51
+ // searchOptions
52
+ );
53
+
54
+ const state = await this.runtime.composeState(
55
+ { } // memory,
56
+ { // additional keys
57
+ latestNews: latestNews,
58
+ }
59
+ );
60
+
61
+ // Then modify the tweet template to include the {{latestNews}} and however you need
62
+ ```
63
+
42
64
  ## Features
43
65
 
44
66
  ### Web Search