Skip to content

Commit

Permalink
Add generated docs for custom headers request options (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlarocque authored May 3, 2024
1 parent 4562366 commit 0859084
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/reference/files/generative-ai.requestoptions.customheaders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [customHeaders](./generative-ai.requestoptions.customheaders.md)

## RequestOptions.customHeaders property

Custom HTTP request headers.

**Signature:**

```typescript
customHeaders?: Headers | Record<string, string>;
```
1 change: 1 addition & 0 deletions docs/reference/files/generative-ai.requestoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export interface RequestOptions
| [apiClient?](./generative-ai.requestoptions.apiclient.md) | | string | _(Optional)_ Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs. |
| [apiVersion?](./generative-ai.requestoptions.apiversion.md) | | string | _(Optional)_ Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version. |
| [baseUrl?](./generative-ai.requestoptions.baseurl.md) | | string | _(Optional)_ Base endpoint url. Defaults to "https://generativelanguage.googleapis.com" |
| [customHeaders?](./generative-ai.requestoptions.customheaders.md) | | Headers \| Record&lt;string, string&gt; | _(Optional)_ Custom HTTP request headers. |
| [timeout?](./generative-ai.requestoptions.timeout.md) | | number | _(Optional)_ Request timeout in milliseconds. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md)

## GoogleGenerativeAIRequestInputError class

Errors in the contents of a request originating from user input.

**Signature:**

```typescript
export declare class GoogleGenerativeAIRequestInputError extends GoogleGenerativeAIError
```
**Extends:** [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md)
1 change: 1 addition & 0 deletions docs/reference/main/generative-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| [GoogleGenerativeAI](./generative-ai.googlegenerativeai.md) | Top-level class for this SDK |
| [GoogleGenerativeAIError](./generative-ai.googlegenerativeaierror.md) | Basic error type for this SDK. |
| [GoogleGenerativeAIFetchError](./generative-ai.googlegenerativeaifetcherror.md) | Error class covering HTTP errors when calling the server. Includes HTTP status, statusText, and optional details, if provided in the server response. |
| [GoogleGenerativeAIRequestInputError](./generative-ai.googlegenerativeairequestinputerror.md) | Errors in the contents of a request originating from user input. |
| [GoogleGenerativeAIResponseError](./generative-ai.googlegenerativeairesponseerror.md) | Errors in the contents of a response from the model. This includes parsing errors, or responses including a safety block reason. |

## Enumerations
Expand Down
13 changes: 13 additions & 0 deletions docs/reference/main/generative-ai.requestoptions.customheaders.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@google/generative-ai](./generative-ai.md) &gt; [RequestOptions](./generative-ai.requestoptions.md) &gt; [customHeaders](./generative-ai.requestoptions.customheaders.md)

## RequestOptions.customHeaders property

Custom HTTP request headers.

**Signature:**

```typescript
customHeaders?: Headers | Record<string, string>;
```
1 change: 1 addition & 0 deletions docs/reference/main/generative-ai.requestoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ export interface RequestOptions
| [apiClient?](./generative-ai.requestoptions.apiclient.md) | | string | _(Optional)_ Additional attribution information to include in the x-goog-api-client header. Used by wrapper SDKs. |
| [apiVersion?](./generative-ai.requestoptions.apiversion.md) | | string | _(Optional)_ Version of API endpoint to call (e.g. "v1" or "v1beta"). If not specified, defaults to latest stable version. |
| [baseUrl?](./generative-ai.requestoptions.baseurl.md) | | string | _(Optional)_ Base endpoint url. Defaults to "https://generativelanguage.googleapis.com" |
| [customHeaders?](./generative-ai.requestoptions.customheaders.md) | | Headers \| Record&lt;string, string&gt; | _(Optional)_ Custom HTTP request headers. |
| [timeout?](./generative-ai.requestoptions.timeout.md) | | number | _(Optional)_ Request timeout in milliseconds. |

3 changes: 3 additions & 0 deletions packages/main/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class GoogleGenerativeAIResponseError<
/**
* Error class covering HTTP errors when calling the server. Includes HTTP
* status, statusText, and optional details, if provided in the server response.
* @public
*/
export class GoogleGenerativeAIFetchError extends GoogleGenerativeAIError {
constructor(
Expand All @@ -57,6 +58,8 @@ export class GoogleGenerativeAIFetchError extends GoogleGenerativeAIError {
}

/**
* Errors in the contents of a request originating from user input.
* @public
*/
export class GoogleGenerativeAIRequestInputError extends GoogleGenerativeAIError {}

Expand Down

0 comments on commit 0859084

Please sign in to comment.