feat: improve diffbot types; fix proxycurl default timeout

pull/659/head
Travis Fischer 2024-06-10 02:34:41 -05:00
rodzic ef97c26ab4
commit b19b4fbbfe
2 zmienionych plików z 115 dodań i 164 usunięć

Wyświetl plik

@ -259,7 +259,7 @@ export namespace diffbot {
description?: string
homepageUri?: string
allNames?: string[]
skills?: Skill[]
skills?: Partial<BasicEntity>[]
crawlTimestamp?: number
summary?: string
image?: string
@ -383,72 +383,121 @@ export namespace diffbot {
nbOrigins?: number
nbIncomingEdges?: number
nbFollowers?: number
nbLocations?: number
nbEmployeesMin?: number
nbEmployeesMax?: number
nbActiveEmployeeEdges?: number
educations?: Education[]
nationalities?: Nationality[]
allNames?: string[]
skills?: Skill[]
children?: Children[]
skills?: Partial<BasicEntity>[]
children?: BasicEntity[]
height?: number
image?: string
images?: Image[]
allOriginHashes?: string[]
nameDetail?: NameDetail
parents?: Parent[]
parents?: BasicEntity[]
gender?: Gender
importance?: number
wikipediaPageviews?: number
wikipediaPageviewsLastQuarterGrowth?: number
wikipediaPageviewsLastYear?: number
wikipediaPageviewsLastYearGrowth?: number
wikipediaPageviews?: number
wikipediaPageviewsLastQuarter?: number
wikipediaPageviewsGrowth?: number
birthPlace?: BirthPlace
birthPlace?: Location
types?: string[]
unions?: Union[]
languages?: Language[]
employments?: Employment[]
birthDate?: DateTime
religion?: Religion
religion?: Partial<BasicEntity>
awards?: Award[]
netWorth?: NetWorth
netWorth?: Amount
allDescriptions?: string[]
locations?: Location[]
location?: Location
interests?: Interest[]
emailAddresses?: any
suppliers?: BasicEntity[]
subsidiaries?: BasicEntity[]
ipo?: {
date: DateTime
stockExchange: string
}
motto?: string
logo?: string
foundingDate?: DateTime
totalInvestment?: Amount
naicsClassification2017?: any[]
naicsClassification?: any[]
sicClassification?: any[]
employeeCategories?: any[]
emailAddresses?: EmailAddress[]
age?: number
isPublic?: boolean
isAcquired?: boolean
isDissolved?: boolean
isNonProfit?: boolean
crawlTimestamp?: number
founders?: BasicEntity[]
boardMembers?: BasicEntity[]
ceo?: BasicEntity
investments?: Investment[]
acquiredBy?: BasicEntity[]
diffbotClassification?: any[]
blogUri?: string
descriptors?: string[]
industries?: string[]
partnerships?: BasicEntity[]
categories?: Category[]
customers?: BasicEntity[]
technographics?: Technographic[]
stock?: Stock
companiesHouseIds?: string[]
}
export interface Technographic {
technology: Partial<BasicEntity>
categories: string[]
}
export interface Category {
level?: number
isPrimary?: boolean
name: string
diffbotUri?: string
targetDiffbotId?: string
type?: string
}
export interface Investment {
date: DateTime
amount?: Amount
isCurrent: boolean
series: string
investors: BasicEntity[]
}
export interface Amount {
currency: string
value: number
}
export interface EmailAddress {
contactString: string
type: string
}
export interface Education {
institution: Institution
institution: BasicEntity
isCurrent?: boolean
major?: Major
degree?: Degree
major?: BasicEntity
degree?: BasicEntity
from?: DateTime
to?: DateTime
}
export interface Institution {
summary: string
image: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface Major {}
export interface Degree {
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface DateTime {
str: string
precision: number
@ -460,21 +509,6 @@ export namespace diffbot {
type: string
}
export interface Skill {
name: string
diffbotUri?: string
targetDiffbotId?: string
}
export interface Children {
summary: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface Image {
url: string
primary?: boolean
@ -486,88 +520,31 @@ export namespace diffbot {
middleName?: string[]
}
export interface Parent {
summary: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
image?: string
}
export interface Gender {
normalizedValue: string
}
export interface BirthPlace {
country: Country
export interface Stock {
symbol: string
isCurrent: boolean
address: string
city: City
subregion: Subregion
latitude: number
precision: number
surfaceForm: string
region: Region
longitude: number
}
export interface Country {
summary: string
image: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface City {
summary: string
image: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface Subregion {
summary: string
image: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface Region {
summary: string
image: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
exchange: string
}
export interface Union {
person: Person
person: BasicEntity
from?: DateTime
to?: DateTime
type?: string
}
export interface Person {
summary: string
image: string
types: string[]
export interface BasicEntity {
name: string
summary: string
type: string
image?: string
types?: string[]
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface Language {
@ -577,59 +554,28 @@ export namespace diffbot {
export interface Employment {
isCurrent?: boolean
employer?: Employer
employer?: BasicEntity
from?: DateTime
categories?: EmploymentCategory[]
categories?: Partial<BasicEntity>[]
title?: string
to?: DateTime
location?: Location
}
export interface Employer {
summary?: string
image?: string
types?: string[]
name: string
diffbotUri?: string
targetDiffbotId?: string
type: string
}
export interface EmploymentCategory {
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface Location {
country?: Country
isCurrent: boolean
address: string
city: City
street: string
metroArea: MetroArea
subregion: Subregion
latitude: number
precision: number
postalCode: string
region?: Region
longitude: number
}
export interface MetroArea {
summary: string
image: string
types: string[]
name: string
diffbotUri: string
targetDiffbotId: string
type: string
}
export interface Religion {
str: string
country?: BasicEntity
address?: string
city?: BasicEntity
street?: string
metroArea?: BasicEntity
subregion?: BasicEntity
surfaceForm?: string
latitude?: number
longitude?: number
postalCode?: string
region?: BasicEntity
precision?: number
}
export interface Award {
@ -637,11 +583,6 @@ export namespace diffbot {
date?: DateTime
}
export interface NetWorth {
currency: string
value: number
}
export interface Interest {
name: string
type: string
@ -655,7 +596,14 @@ export namespace diffbot {
'images',
'nationalities',
'awards',
'interests'
'interests',
'suppliers',
'partnerships',
'industries',
'categories',
'technographics',
'employeeCategories',
'diffbotClassification'
)
}

Wyświetl plik

@ -2046,11 +2046,13 @@ export class ProxycurlClient extends AIFunctionsProvider {
apiBaseUrl = getEnv('PROXYCURL_API_BASE_URL') ??
'https://nubela.co/proxycurl',
throttle = true,
timeoutMs = 30_000,
ky = defaultKy
}: {
apiKey?: string
apiBaseUrl?: string
throttle?: boolean
timeoutMs?: number
ky?: KyInstance
} = {}) {
assert(
@ -2070,6 +2072,7 @@ export class ProxycurlClient extends AIFunctionsProvider {
this.ky = throttledKy.extend({
prefixUrl: apiBaseUrl,
timeout: timeoutMs,
headers: {
Authorization: `Bearer ${apiKey}`
}