Skip to content

Commit

Permalink
Format file
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardconstantin committed Dec 20, 2024
1 parent 71bfe0e commit 677926b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions libs/langchain-community/src/document_loaders/web/airtable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ export class AirtableLoader extends BaseDocumentLoader {
* @param offset - An optional string representing the offset for pagination.
* @returns A record containing the combined properties of `kwargs` and the provided offset.
*/
private constructRequestBody(offset?: string): Record<string, any> { return { ...this.kwargs, offset }; }
private constructRequestBody(offset?: string): Record<string, any> {
return { ...this.kwargs, offset };
}

/**
* Sends the API request to Airtable and handles the response.
Expand All @@ -134,16 +136,18 @@ export class AirtableLoader extends BaseDocumentLoader {
* @returns A promise that resolves to an AirtableResponse object.
* @throws Will throw an error if the Airtable API request fails.
*/
private async fetchRecords(body: Record<string, any>): Promise<AirtableResponse> {
private async fetchRecords(
body: Record<string, any>
): Promise<AirtableResponse> {
const url = `${AirtableLoader.BASE_URL}/${this.baseId}/${this.tableId}`;
try {
const response = await fetch(url, {
method: "POST",
headers: {
Authorization: `Bearer ${this.apiToken}`,
"Content-Type": "application/json"
"Content-Type": "application/json",
},
body: JSON.stringify(body)
body: JSON.stringify(body),
});

if (!response.ok) {
Expand Down

0 comments on commit 677926b

Please sign in to comment.