Skip to content

Commit bfab571

Browse files
feat: add jsdoc comments to aiFunction impls
1 parent 687384a commit bfab571

File tree

23 files changed

+145
-5
lines changed

23 files changed

+145
-5
lines changed

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"dev": "turbo dev --concurrency 50 --continue",
1818
"docs": "cd docs && npx mintlify dev",
1919
"clean": "turbo clean",
20+
"fix:format": "prettier --write \"**/*.{js,ts,tsx}\"",
2021
"test": "turbo test",
2122
"test:format": "prettier --check \"**/*.{js,ts,tsx}\"",
2223
"test:lint": "turbo test:lint",

packages/apollo/src/apollo-client.ts

+7
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,13 @@ export class ApolloClient extends AIFunctionsProvider {
311311
})
312312
}
313313

314+
/**
315+
* Attempts to enrich a person with Apollo data.
316+
*
317+
* Apollo relies on the information you pass via the endpoint's parameters to identify the correct person to enrich. If you provide more information about a person, Apollo is more likely to find a match within its database. If you only provide general information, such as a name without a domain or email address, you might receive a 200 response, but the response will indicate that no records have been enriched.
318+
*
319+
* By default, this endpoint does not return personal emails or phone numbers. Use the reveal_personal_emails and reveal_phone_number parameters to retrieve emails and phone numbers.
320+
*/
314321
@aiFunction({
315322
name: 'apollo_enrich_person',
316323
description: `Attempts to enrich a person with Apollo data.

packages/bing/src/bing-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ export class BingClient extends AIFunctionsProvider {
275275
})
276276
}
277277

278+
/**
279+
* Searches the web using the Bing search engine to return the most relevant web pages for a given query. Can also be used to find up-to-date news and information about many topics.
280+
*/
278281
@aiFunction({
279282
name: 'bing_web_search',
280283
description:

packages/dexa/src/dexa-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export class DexaClient extends AIFunctionsProvider {
4949
this.ky = ky.extend({ prefixUrl: this.apiBaseUrl, timeout: timeoutMs })
5050
}
5151

52+
/**
53+
* Answers questions based on knowledge of trusted experts and podcasters. Example experts include: Andrew Huberman, Tim Ferriss, Lex Fridman, Peter Attia, Seth Godin, Rhonda Patrick, Rick Rubin, and more.
54+
*/
5255
@aiFunction({
5356
name: 'ask_dexa',
5457
description:

packages/dexa/src/scraper-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ export class ScraperClient extends AIFunctionsProvider {
8080
this.ky = throttledKy.extend({ prefixUrl: this.apiBaseUrl })
8181
}
8282

83+
/**
84+
* Scrapes the content of a single URL.
85+
*/
8386
@aiFunction({
8487
name: 'scrape_url',
8588
description: 'Scrapes the content of a single URL.',

packages/diffbot/src/diffbot-client.ts

+9
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,9 @@ export class DiffbotClient extends AIFunctionsProvider {
661661
})
662662
}
663663

664+
/**
665+
* Scrapes and extracts structured data from a web page. Also classifies the web page as one of several types (article, product, discussion, job, image, video, list, event, or other).
666+
*/
664667
@aiFunction({
665668
name: 'diffbot_analyze_url',
666669
description:
@@ -673,6 +676,9 @@ export class DiffbotClient extends AIFunctionsProvider {
673676
return this._extract<diffbot.ExtractAnalyzeResponse>('v3/analyze', options)
674677
}
675678

679+
/**
680+
* Scrapes and extracts clean article text from news articles, blog posts, and other text-heavy web pages.
681+
*/
676682
@aiFunction({
677683
name: 'diffbot_extract_article_from_url',
678684
description:
@@ -685,6 +691,9 @@ export class DiffbotClient extends AIFunctionsProvider {
685691
return this._extract<diffbot.ExtractArticleResponse>('v3/article', options)
686692
}
687693

694+
/**
695+
* Resolves and enriches a partial person or organization entity.
696+
*/
688697
@aiFunction({
689698
name: 'diffbot_enhance_entity',
690699
description:

packages/firecrawl/src/firecrawl-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ export class FirecrawlClient extends AIFunctionsProvider {
145145
})
146146
}
147147

148+
/**
149+
* Scrape the contents of a URL.
150+
*/
148151
@aiFunction({
149152
name: 'firecrawl_scrape_url',
150153
description: 'Scrape the contents of a URL.',

packages/gravatar/src/gravatar-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ export class GravatarClient extends AIFunctionsProvider {
160160
})
161161
}
162162

163+
/**
164+
* Get Gravatar profile by email. Returns a profile object or `undefined` if not found.
165+
*/
163166
@aiFunction({
164167
name: 'gravatar_get_profile',
165168
description:

packages/hacker-news/src/hacker-news-client.ts

+8
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ export class HackerNewsClient extends AIFunctionsProvider {
271271
})
272272
}
273273

274+
/** Fetches a HN story or comment by its ID. */
274275
@aiFunction({
275276
name: 'hacker_news_get_item',
276277
description: 'Fetches a HN story or comment by its ID.',
@@ -287,6 +288,9 @@ export class HackerNewsClient extends AIFunctionsProvider {
287288
.json<hackernews.SearchItem>()
288289
}
289290

291+
/**
292+
* Fetches a HN user by username.
293+
*/
290294
@aiFunction({
291295
name: 'hacker_news_get_user',
292296
description: 'Fetches a HN user by username.',
@@ -303,6 +307,7 @@ export class HackerNewsClient extends AIFunctionsProvider {
303307
.json<hackernews.SearchUser>()
304308
}
305309

310+
/** Searches HN for stories and comments matching the given query. */
306311
@aiFunction({
307312
name: 'hacker_news_search',
308313
description:
@@ -342,6 +347,9 @@ export class HackerNewsClient extends AIFunctionsProvider {
342347
.json<hackernews.SearchResponse>()
343348
}
344349

350+
/**
351+
* Fetches / searches the top stories currently on the front page of HN. This is the same as `hacker_news_search`, but with `tags: ["front_page"]` set to filter only by the current front page stories.
352+
*/
345353
@aiFunction({
346354
name: 'hacker_news_get_top_stories',
347355
description:

packages/hunter/src/hunter-client.ts

+9
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ export class HunterClient extends AIFunctionsProvider {
249249
})
250250
}
251251

252+
/**
253+
* Gets all the email addresses associated with a given company or domain.
254+
*/
252255
@aiFunction({
253256
name: 'hunter_domain_search',
254257
description:
@@ -280,6 +283,9 @@ export class HunterClient extends AIFunctionsProvider {
280283
return pruneNullOrUndefinedDeep(res)
281284
}
282285

286+
/**
287+
* Finds the most likely email address from a domain name, a first name and a last name.
288+
*/
283289
@aiFunction({
284290
name: 'hunter_email_finder',
285291
description:
@@ -308,6 +314,9 @@ export class HunterClient extends AIFunctionsProvider {
308314
return pruneNullOrUndefinedDeep(res)
309315
}
310316

317+
/**
318+
* Verifies the deliverability of an email address.
319+
*/
311320
@aiFunction({
312321
name: 'hunter_email_verifier',
313322
description: 'Verifies the deliverability of an email address.',

packages/jigsawstack/src/jigsawstack-client.ts

+15
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ export class JigsawStackClient extends AIFunctionsProvider {
155155
})
156156
}
157157

158+
/**
159+
* Perform web searches and retrieve high-quality results of the given query
160+
*/
158161
@aiFunction({
159162
name: 'jigsawstack_ai_search',
160163
description:
@@ -173,6 +176,9 @@ export class JigsawStackClient extends AIFunctionsProvider {
173176
.json<jigsawstack.SearchResponse>()
174177
}
175178

179+
/**
180+
* Scrape any website
181+
*/
176182
@aiFunction({
177183
name: 'jigsawstack_ai_scrape',
178184
description: 'Scrape any website',
@@ -195,6 +201,9 @@ export class JigsawStackClient extends AIFunctionsProvider {
195201
.json<jigsawstack.ScrapeResponse>()
196202
}
197203

204+
/**
205+
* Recognise, describe and retrieve data within an image with great accuracy.
206+
*/
198207
@aiFunction({
199208
name: 'jigsawstack_vocr',
200209
description:
@@ -217,6 +226,9 @@ export class JigsawStackClient extends AIFunctionsProvider {
217226
.json<jigsawstack.VOCRResponse>()
218227
}
219228

229+
/**
230+
* Generate semantically correct SQL queries from text.
231+
*/
220232
@aiFunction({
221233
name: 'jigsawstack_text_to_sql',
222234
description: 'Generate semantically correct SQL queries from text.',
@@ -241,6 +253,9 @@ export class JigsawStackClient extends AIFunctionsProvider {
241253
.json<jigsawstack.TextToSqlResponse>()
242254
}
243255

256+
/**
257+
* Convert audio/video files into accurate text transcriptions instantly.
258+
*/
244259
@aiFunction({
245260
name: 'jigsawstack_speech_to_text',
246261
description:

packages/jina/src/jina-client.ts

+6
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ export class JinaClient extends AIFunctionsProvider {
158158
this.kySearch = throttledKySearch.extend({ prefixUrl: 'https://s.jina.ai' })
159159
}
160160

161+
/**
162+
* Reads the contents of the given URL and returns it's main contents in a clean, LLM-friendly format.
163+
*/
161164
@aiFunction({
162165
name: 'readUrl',
163166
description:
@@ -198,6 +201,9 @@ export class JinaClient extends AIFunctionsProvider {
198201
}
199202
}
200203

204+
/**
205+
* Searches the web for the given query and returns the top-5 results including their page contents in a clean, LLM-friendly format.
206+
*/
201207
@aiFunction({
202208
name: 'search',
203209
description:

packages/leadmagic/src/leadmagic-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ export class LeadMagicClient extends AIFunctionsProvider {
9797
})
9898
}
9999

100+
/**
101+
* Attempts to enrich a person with LeadMagic data based on their public LinkedIn username / identifier.
102+
*/
100103
@aiFunction({
101104
name: 'leadmagic_profile_search',
102105
description:

packages/midjourney/src/midjourney-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ export class MidjourneyClient extends AIFunctionsProvider {
7979
})
8080
}
8181

82+
/**
83+
* Creates 4 images from a prompt using the Midjourney API. Useful for generating images on the fly.
84+
*/
8285
@aiFunction({
8386
name: 'midjourney_create_images',
8487
description:

packages/predict-leads/src/predict-leads-client.ts

+6
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,9 @@ export class PredictLeadsClient extends AIFunctionsProvider {
526526
})
527527
}
528528

529+
/**
530+
* Returns basic information about a company given its `domain` like location, name, stock ticker, description, etc.
531+
*/
529532
@aiFunction({
530533
name: 'get_company',
531534
description:
@@ -541,6 +544,9 @@ export class PredictLeadsClient extends AIFunctionsProvider {
541544
return this.ky.get(`v2/companies/${domain}`).json<predictleads.Response>()
542545
}
543546

547+
/**
548+
* Returns a list of events from news for a given company. Events are found in press releases, industry news, blogs, social media, and other online sources.
549+
*/
544550
@aiFunction({
545551
name: 'get_company_events',
546552
description:

packages/proxycurl/src/proxycurl-client.ts

+8
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
21082108
})
21092109
}
21102110

2111+
/** Gets the LinkedIn profile for a company given it's domain `url`. */
21112112
@aiFunction({
21122113
name: 'get_linkedin_company',
21132114
description:
@@ -2134,6 +2135,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
21342135
}
21352136
}
21362137

2138+
/** Gets the LinkedIn profile for a person given some unique, identifying information about them. */
21372139
@aiFunction({
21382140
name: 'get_linkedin_person',
21392141
description:
@@ -2150,6 +2152,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
21502152
.json<proxycurl.PersonProfile>()
21512153
}
21522154

2155+
/** Resolves the LinkedIn profile for a person given their `first_name` and `company_domain` URL. */
21532156
@aiFunction({
21542157
name: 'resolve_linkedin_person',
21552158
description:
@@ -2170,6 +2173,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
21702173
.json<proxycurl.ResolvedPersonProfile>()
21712174
}
21722175

2176+
/** Resolves the LinkedIn profile for a person given their `email`. */
21732177
@aiFunction({
21742178
name: 'resolve_linkedin_person_by_email',
21752179
description:
@@ -2189,6 +2193,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
21892193
.json<proxycurl.ReverseEmailUrlEnrichResult>()
21902194
}
21912195

2196+
/** Resolves the LinkedIn profile for a person at a given `company_name` and `role`. */
21922197
@aiFunction({
21932198
name: 'resolve_linkedin_person_at_company_by_role',
21942199
description:
@@ -2208,6 +2213,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
22082213
.json<proxycurl.ResolvedPersonProfile>()
22092214
}
22102215

2216+
/** Resolves the LinkedIn profile for a company given the `company_name` and/or `company_domain`. */
22112217
@aiFunction({
22122218
name: 'resolve_linkedin_company',
22132219
description:
@@ -2232,6 +2238,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
22322238
}
22332239
}
22342240

2241+
/** Searches LinkedIn company profiles based on a set of criteria such as `name`, `industry`, `region`, `description`, `city`, number of employees, founding date, funding raised, etc. */
22352242
@aiFunction({
22362243
name: 'search_linkedin_companies',
22372244
description:
@@ -2246,6 +2253,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
22462253
.json<proxycurl.CompanySearchResult>()
22472254
}
22482255

2256+
/** Searches LinkedIn people profiles based on a set of criteria such as `country`, `first_name`, `last_name`, `current_company_name`, `headline`, `industries`, `past_company_name`, `summary`, `city`, `education_school_name`, etc. */
22492257
@aiFunction({
22502258
name: 'search_linkedin_people',
22512259
description:

packages/searxng/src/searxng-client.ts

+17
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,23 @@ export class SearxngClient extends AIFunctionsProvider {
307307
this.ky = ky.extend({ prefixUrl: apiBaseUrl })
308308
}
309309

310+
/**
311+
* Searches across multiple search engines using a local instance of Searxng. To search only specific engines, use the `engines` parameter.
312+
*
313+
* The most important search engines are:
314+
*
315+
* - "reddit" (Reddit posts)
316+
* - "google" (Google web search)
317+
* - "google news" (Google News search)
318+
* - "brave" (Brave web search)
319+
* - "arxiv" (academic papers)
320+
* - "genius" (Genius.com for song lyrics)
321+
* - "imdb" (movies and TV shows)
322+
* - "hackernews" (Hacker News)
323+
* - "wikidata" (Wikidata)
324+
* - "wolframalpha" (Wolfram Alpha)
325+
* - "youtube" (YouTube videos)
326+
*/
310327
@aiFunction({
311328
name: 'searxng',
312329
description: `Searches across multiple search engines using a local instance of Searxng. To search only specific engines, use the \`engines\` parameter.

packages/serpapi/src/serpapi-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,9 @@ export class SerpAPIClient extends AIFunctionsProvider {
662662
})
663663
}
664664

665+
/**
666+
* Uses Google Search to return the most relevant web pages for a given query. Useful for finding up-to-date news and information about any topic.
667+
*/
665668
@aiFunction({
666669
name: 'serpapi_google_search',
667670
description:

packages/serper/src/serper-client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ export class SerperClient extends AIFunctionsProvider {
248248
})
249249
}
250250

251+
/**
252+
* Uses Google Search to return the most relevant web pages for a given query. Useful for finding up-to-date news and information about any topic.
253+
*/
251254
@aiFunction({
252255
name: 'serper_google_search',
253256
description:

0 commit comments

Comments
 (0)