Fixing a bunch of build errors
This commit is contained in:
parent
71f456af90
commit
ae64854bae
|
|
@ -162,6 +162,12 @@ interface AirtableLoaderParams {
|
||||||
returnAll?: boolean
|
returnAll?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AirtableLoaderRequest {
|
||||||
|
maxRecords: number
|
||||||
|
view: string | undefined
|
||||||
|
fields?: string[]
|
||||||
|
}
|
||||||
|
|
||||||
interface AirtableLoaderResponse {
|
interface AirtableLoaderResponse {
|
||||||
records: AirtableLoaderPage[]
|
records: AirtableLoaderPage[]
|
||||||
offset?: string
|
offset?: string
|
||||||
|
|
@ -213,7 +219,7 @@ class AirtableLoader extends BaseDocumentLoader {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Accept: 'application/json'
|
Accept: 'application/json'
|
||||||
}
|
}
|
||||||
const response = await axios.get(url, data, { headers })
|
const response = await axios.post(url, data, { headers })
|
||||||
return response.data
|
return response.data
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
throw new Error(`Failed to fetch ${url} from Airtable: ${error}`)
|
throw new Error(`Failed to fetch ${url} from Airtable: ${error}`)
|
||||||
|
|
@ -226,7 +232,7 @@ class AirtableLoader extends BaseDocumentLoader {
|
||||||
|
|
||||||
// Return a langchain document
|
// Return a langchain document
|
||||||
return new Document({
|
return new Document({
|
||||||
pageContent: JSON.stringify(fields, null, 2),
|
pageContent: JSON.stringify(page.fields, null, 2),
|
||||||
metadata: {
|
metadata: {
|
||||||
url: pageUrl
|
url: pageUrl
|
||||||
}
|
}
|
||||||
|
|
@ -234,7 +240,7 @@ class AirtableLoader extends BaseDocumentLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async loadLimit(): Promise<Document[]> {
|
private async loadLimit(): Promise<Document[]> {
|
||||||
const data = {
|
let data: AirtableLoaderRequest = {
|
||||||
maxRecords: this.limit,
|
maxRecords: this.limit,
|
||||||
view: this.viewId
|
view: this.viewId
|
||||||
}
|
}
|
||||||
|
|
@ -251,7 +257,7 @@ class AirtableLoader extends BaseDocumentLoader {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async loadAll(): Promise<Document[]> {
|
private async loadAll(): Promise<Document[]> {
|
||||||
const data = {
|
let data: AirtableLoaderRequest = {
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
view: this.viewId
|
view: this.viewId
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue