Skip to content

Commit

Permalink
clean up making user agent optional (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeke authored Mar 29, 2023
1 parent ef03afa commit b54f0f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Replicate from "replicate";
const replicate = new Replicate({
// get your token from https://replicate.com/account
auth: process.env.REPLICATE_API_TOKEN,
userAgent: "my-app/1.2.3",
});
```

Expand Down Expand Up @@ -71,11 +70,11 @@ prediction = await replicate.wait(prediction);
const replicate = new Replicate(options);
```

| name | type | description |
| ------------------- | ------ | ---------------------------------------- |
| `options.auth` | string | **Required**. API access token |
| `options.userAgent` | string | **Required**. Identifier of your app |
| `options.baseUrl` | string | Defaults to https://api.replicate.com/v1 |
| name | type | description |
| ------------------- | ------ | --------------------------------------------------------------------------------- |
| `options.auth` | string | **Required**. API access token |
| `options.userAgent` | string | Identifier of your app. Defaults to `replicate-javascript/${packageJSON.version}` |
| `options.baseUrl` | string | Defaults to https://api.replicate.com/v1 |

### `replicate.models.get`

Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ type Identifier = `${string}/${string}:${string}`;
declare module "replicate" {
export interface ReplicateOptions {
auth: string;
userAgent: string;
userAgent?: string;
baseUrl?: string;
}

Expand Down

0 comments on commit b54f0f2

Please sign in to comment.