You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* This method currently supports Google Gemini and Vertex AI. It retrieves credentials and the model from environment variables (`AI_KEY`, `AI_PROJECT`, `AI_LOCATION`, `AI_MODEL`) or accepts them as options. Options take precedence over environment variables.
522
522
*
523
-
* This method can be slow for large tables. To avoid exceeding rate limits, you can process multiple rows at once with the `batchSize` option. You can also use the `rateLimitPerMinute` option to automatically add a delay between requests to comply with the rate limit.
523
+
* To avoid exceeding rate limits, you can process multiple rows at once with the `batchSize` option. You can also use the `rateLimitPerMinute` option to automatically add a delay between requests to comply with the rate limit.
524
+
*
525
+
* On the other hand, if you have a business or professional account with high rate limits, you can set the `concurrent` option to process multiple requests concurrently and speed up the process.
524
526
*
525
527
* The `cache` option allows you to cache locally the results of each request, saving resources and time. The data is cached in the local hidden folder `.journalism` (because this method uses the `askAI` function from the [journalism library](https://github.com/nshiab/journalism)). So don't forget to add `.journalism` to your `.gitignore` file!
526
528
*
527
-
* Sometimes, the AI returns less items than the batch size, which throws an error. If you want to automatically retry the request, you can use the `retry` option. The method will retry the request up to the specified number of times.
529
+
* Sometimes, the AI returns fewer items than the batch size, which throws an error. If you want to automatically retry the request, you can use the `retry` option. The method will retry the request up to the specified number of times.
528
530
*
529
531
* The temperature is set to 0 to ensure reproducible results. However, consistent results cannot be guaranteed.
530
532
*
531
533
* This method won't work if you have geometries in your table.
532
534
*
533
535
* @example
534
-
* Basic usage with cache, batchSize and retry options
536
+
* Basic usage with cache, batchSize and rate limit
* @param prompt - The input string to guide the AI's response.
564
566
* @param options - Configuration options for the AI request.
565
567
* @param options.batchSize - The number of rows to process in each batch. By default, it is 1.
568
+
* @param options.concurrent - The number of concurrent requests to send. By default, it is 1.
566
569
* @param options.cache - If true, the results will be cached locally. By default, it is false.
567
570
* @param options.retry - The number of times to retry the request in case of failure. By default, it is 0.
568
571
* @param options.rateLimitPerMinute - The rate limit for the AI requests in requests per minute. If necessary, the method will wait between requests. By default, there is no limit.
0 commit comments