Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generated docs for custom headers request options #128

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading