triangle-utils 1.4.67 → 1.4.69

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.
@@ -1,6 +1,7 @@
1
1
  export declare class UtilsTwitter {
2
2
  private readonly twitter;
3
3
  constructor(twitter_api_key: string | undefined);
4
+ get_user(user_id: string): Promise<any>;
4
5
  get_user_by_username(username: string): Promise<any>;
5
6
  get_tweets(user_id: string): Promise<any>;
6
7
  }
@@ -4,6 +4,38 @@ export class UtilsTwitter {
4
4
  constructor(twitter_api_key) {
5
5
  this.twitter = new Client({ bearerToken: twitter_api_key });
6
6
  }
7
+ async get_user(user_id) {
8
+ const result = await this.twitter.users.getById(user_id, { userFields: [
9
+ "affiliation",
10
+ // "confirmed_email",
11
+ "connection_status",
12
+ "created_at",
13
+ "description",
14
+ "entities",
15
+ "id",
16
+ "is_identity_verified",
17
+ "location",
18
+ "most_recent_tweet_id",
19
+ "name",
20
+ "parody",
21
+ "pinned_tweet_id",
22
+ "profile_banner_url",
23
+ "profile_image_url",
24
+ "protected",
25
+ // "public_metrics",
26
+ // "receives_your_dm",
27
+ "subscription",
28
+ "subscription_type",
29
+ "url",
30
+ "username",
31
+ "verified",
32
+ "verified_followers_count",
33
+ "verified_type",
34
+ "withheld"
35
+ ] })
36
+ .then(response => response.data);
37
+ return result;
38
+ }
7
39
  async get_user_by_username(username) {
8
40
  const result = await this.twitter.users.getByUsername(username, { userFields: [
9
41
  "affiliation",
@@ -37,6 +37,9 @@ export class UtilsXAI {
37
37
  tools: [
38
38
  {
39
39
  type: "x_search"
40
+ },
41
+ {
42
+ type: "web_search"
40
43
  }
41
44
  ],
42
45
  temperature: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-utils",
3
- "version": "1.4.67",
3
+ "version": "1.4.69",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "directories": {
@@ -8,6 +8,39 @@ export class UtilsTwitter {
8
8
  this.twitter = new Client({ bearerToken : twitter_api_key })
9
9
  }
10
10
 
11
+ async get_user(user_id : string) : Promise<any> {
12
+ const result = await this.twitter.users.getById(user_id, { userFields : [
13
+ "affiliation",
14
+ // "confirmed_email",
15
+ "connection_status",
16
+ "created_at",
17
+ "description",
18
+ "entities",
19
+ "id",
20
+ "is_identity_verified",
21
+ "location",
22
+ "most_recent_tweet_id",
23
+ "name",
24
+ "parody",
25
+ "pinned_tweet_id",
26
+ "profile_banner_url",
27
+ "profile_image_url",
28
+ "protected",
29
+ // "public_metrics",
30
+ // "receives_your_dm",
31
+ "subscription",
32
+ "subscription_type",
33
+ "url",
34
+ "username",
35
+ "verified",
36
+ "verified_followers_count",
37
+ "verified_type",
38
+ "withheld"
39
+ ] })
40
+ .then(response => response.data)
41
+ return result
42
+ }
43
+
11
44
  async get_user_by_username(username : string) : Promise<any> {
12
45
  const result = await this.twitter.users.getByUsername(username, { userFields : [
13
46
  "affiliation",
package/src/UtilsXAI.ts CHANGED
@@ -64,6 +64,9 @@ export class UtilsXAI {
64
64
  tools : [
65
65
  {
66
66
  type : "x_search"
67
+ },
68
+ {
69
+ type : "web_search"
67
70
  }
68
71
  ],
69
72
  temperature : 0,