Skip to content

createCrawlOpenAI

CreateCrawlOpenAIConfig

ts
export interface CreateCrawlOpenAIConfig {
  defaultModel?: {
    chatModel: OpenAIChatModel
  }
  clientOptions?: ClientOptions // ClientOptions 来自于 openai
}
参数类型默认值描述
defaultModel-AI 模型
clientOptionsClientOptions-AI 其他配置, 用于创建 AI 实例

外部类型

  • ClientOptions:来自于 openai,clientOptions 会直接传给 new OpenAI 用于创建 AI 实例

CrawlOpenAIApp

ts
export interface CrawlOpenAIApp {
  parseElements<T extends Record<string, string>>(
    HTML: string,
    content: string | CrawlOpenAIParseElementsContentOptions,
    option?: CrawlOpenAICommonAPIOtherOption
  ): Promise<CrawlOpenAIParseElementsResult<T>>

  getElementSelectors(
    HTML: string,
    content: string | CrawlOpenAIGetElementSelectorsContentOptions,
    option?: CrawlOpenAICommonAPIOtherOption
  ): Promise<CrawlOpenAIGetElementSelectorsResult>

  help(
    content: string,
    option?: CrawlOpenAICommonAPIOtherOption
  ): Promise<string>

  custom(): OpenAI
}

基于 MIT 许可发布