Skip to content

Commit

Permalink
feat: update version
Browse files Browse the repository at this point in the history
  • Loading branch information
coder-hxl committed Jul 21, 2024
1 parent f9d4c24 commit c6d1f72
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 15 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# [v10.0.2](https://github.com/coder-hxl/x-crawl/compare/v10.0.1..v10.0.2) (2024-07-21)

### 🚀 Features

- Added 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' to OpenAIChatModel type to keep in sync with openai.

### ⛓️ Dependencies

- puppeteer from 22.5.0 to 22.13.1
- openai from 4.33.0 to 4.52.7
- https-proxy-agent from 7.0.4 to 7.0.5

---

### 🚀 特征

- OpenAIChatModel 类型新增 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' ,与 openai 保持同步。

### ⛓️ 依赖关系

- puppeteer 从 22.5.0 升至 22.13.1
- openai 从 4.33.0 升至 4.52.7
- https-proxy-agent 从 7.0.4 升至 7.0.5

# [v10.0.1](https://github.com/coder-hxl/x-crawl/compare/v10.0.0..v10.0.1) (2024-04-10)

### 🐞 Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "x-crawl",
"version": "10.0.1",
"version": "10.0.2",
"author": "coderHXL",
"description": "x-crawl is a flexible Node.js AI-assisted crawler library.",
"license": "MIT",
Expand Down
12 changes: 8 additions & 4 deletions packages/ai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import {
import { isObject, logStart, logSuccess } from '../shared'

type OpenAIChatModel =
| 'gpt-4o'
| 'gpt-4o-2024-05-13'
| 'gpt-4-turbo'
| 'gpt-4-turbo-2024-04-09'
| 'gpt-4-0125-preview'
| 'gpt-4-turbo-preview'
| 'gpt-4-1106-preview'
Expand All @@ -29,17 +33,17 @@ type OpenAIChatModel =

interface CreateCrawlOpenAIConfig {
defaultModel?: {
chatModel: OpenAIChatModel
chatModel: (string & {}) | OpenAIChatModel
}
clientOptions?: ClientOptions
}

interface CrawlOpenAICommonAPIOtherOption {
model?: OpenAIChatModel
model?: (string & {}) | OpenAIChatModel
}

interface CrawlOpenAIRunChatOption {
model: OpenAIChatModel | undefined
model: (string & {}) | OpenAIChatModel | undefined
context: string
HTMLContent: string
userContent: string
Expand Down Expand Up @@ -92,7 +96,7 @@ export function createCrawlOpenAI(
const { defaultModel, clientOptions } = config

const openai = new OpenAI(clientOptions)
const chatDefaultModel: OpenAIChatModel =
const chatDefaultModel: (string & {}) | OpenAIChatModel =
defaultModel?.chatModel ?? 'gpt-3.5-turbo'

async function runChat<T>(option: CrawlOpenAIRunChatOption): Promise<T> {
Expand Down
2 changes: 2 additions & 0 deletions publish/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './dist/crawl'
export * from './dist/ai'
18 changes: 8 additions & 10 deletions publish/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "x-crawl",
"version": "10.0.1",
"version": "10.0.2",
"author": "coderHXL",
"description": "x-crawl is a flexible Node.js AI-assisted crawler library.",
"license": "MIT",
Expand All @@ -11,13 +11,11 @@
},
"main": "index.js",
"type": "module",
"types": "./dist/index.d.ts",
"types": "./index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./index.js",
"require": "./index.cjs"
}
"types": "./index.d.ts",
"import": "./index.js",
"require": "./index.cjs"
},
"keywords": [
"x-crawl",
Expand All @@ -42,9 +40,9 @@
},
"dependencies": {
"chalk": "5.3.0",
"https-proxy-agent": "^7.0.4",
"openai": "^4.33.0",
"https-proxy-agent": "^7.0.5",
"openai": "^4.52.7",
"ora": "^8.0.1",
"puppeteer": "22.5.0"
"puppeteer": "22.13.1"
}
}

0 comments on commit c6d1f72

Please sign in to comment.