File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const axios = require('axios');
33const collections = require ( './lib/collections' ) ;
44const models = require ( './lib/models' ) ;
55const predictions = require ( './lib/predictions' ) ;
6+ const packageJSON = require ( './package.json' ) ;
67
78/**
89 * Replicate API client library
@@ -28,12 +29,13 @@ class Replicate {
2829 *
2930 * @param {object } options - Configuration options for the client
3031 * @param {string } options.auth - Required. API access token
31- * @param {string } options.userAgent - Required. Identifier of your app
32+ * @param {string } options.userAgent - Identifier of your app
3233 * @param {string } [options.baseUrl] - Defaults to https://api.replicate.com/v1
3334 */
3435 constructor ( options ) {
3536 this . auth = options . auth ;
36- this . userAgent = options . userAgent ;
37+ this . userAgent =
38+ options . userAgent || `replicate-javascript/${ packageJSON . version } ` ;
3739 this . baseUrl = options . baseUrl || 'https://api.replicate.com/v1' ;
3840 this . instance = axios . create ( {
3941 baseURL : this . baseUrl ,
You can’t perform that action at this time.
0 commit comments