Skip to content

Commit c6d1f72

Browse files
committed
feat: update version
1 parent f9d4c24 commit c6d1f72

File tree

5 files changed

+43
-15
lines changed

5 files changed

+43
-15
lines changed

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# [v10.0.2](https://github.com/coder-hxl/x-crawl/compare/v10.0.1..v10.0.2) (2024-07-21)
2+
3+
### 🚀 Features
4+
5+
- 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.
6+
7+
### ⛓️ Dependencies
8+
9+
- puppeteer from 22.5.0 to 22.13.1
10+
- openai from 4.33.0 to 4.52.7
11+
- https-proxy-agent from 7.0.4 to 7.0.5
12+
13+
---
14+
15+
### 🚀 特征
16+
17+
- OpenAIChatModel 类型新增 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' ,与 openai 保持同步。
18+
19+
### ⛓️ 依赖关系
20+
21+
- puppeteer 从 22.5.0 升至 22.13.1
22+
- openai 从 4.33.0 升至 4.52.7
23+
- https-proxy-agent 从 7.0.4 升至 7.0.5
24+
125
# [v10.0.1](https://github.com/coder-hxl/x-crawl/compare/v10.0.0..v10.0.1) (2024-04-10)
226

327
### 🐞 Bug fixes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "x-crawl",
4-
"version": "10.0.1",
4+
"version": "10.0.2",
55
"author": "coderHXL",
66
"description": "x-crawl is a flexible Node.js AI-assisted crawler library.",
77
"license": "MIT",

packages/ai/index.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import {
99
import { isObject, logStart, logSuccess } from '../shared'
1010

1111
type OpenAIChatModel =
12+
| 'gpt-4o'
13+
| 'gpt-4o-2024-05-13'
14+
| 'gpt-4-turbo'
15+
| 'gpt-4-turbo-2024-04-09'
1216
| 'gpt-4-0125-preview'
1317
| 'gpt-4-turbo-preview'
1418
| 'gpt-4-1106-preview'
@@ -29,17 +33,17 @@ type OpenAIChatModel =
2933

3034
interface CreateCrawlOpenAIConfig {
3135
defaultModel?: {
32-
chatModel: OpenAIChatModel
36+
chatModel: (string & {}) | OpenAIChatModel
3337
}
3438
clientOptions?: ClientOptions
3539
}
3640

3741
interface CrawlOpenAICommonAPIOtherOption {
38-
model?: OpenAIChatModel
42+
model?: (string & {}) | OpenAIChatModel
3943
}
4044

4145
interface CrawlOpenAIRunChatOption {
42-
model: OpenAIChatModel | undefined
46+
model: (string & {}) | OpenAIChatModel | undefined
4347
context: string
4448
HTMLContent: string
4549
userContent: string
@@ -92,7 +96,7 @@ export function createCrawlOpenAI(
9296
const { defaultModel, clientOptions } = config
9397

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

98102
async function runChat<T>(option: CrawlOpenAIRunChatOption): Promise<T> {

publish/index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export * from './dist/crawl'
2+
export * from './dist/ai'

publish/package.json

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "x-crawl",
3-
"version": "10.0.1",
3+
"version": "10.0.2",
44
"author": "coderHXL",
55
"description": "x-crawl is a flexible Node.js AI-assisted crawler library.",
66
"license": "MIT",
@@ -11,13 +11,11 @@
1111
},
1212
"main": "index.js",
1313
"type": "module",
14-
"types": "./dist/index.d.ts",
14+
"types": "./index.d.ts",
1515
"exports": {
16-
".": {
17-
"types": "./dist/index.d.ts",
18-
"import": "./index.js",
19-
"require": "./index.cjs"
20-
}
16+
"types": "./index.d.ts",
17+
"import": "./index.js",
18+
"require": "./index.cjs"
2119
},
2220
"keywords": [
2321
"x-crawl",
@@ -42,9 +40,9 @@
4240
},
4341
"dependencies": {
4442
"chalk": "5.3.0",
45-
"https-proxy-agent": "^7.0.4",
46-
"openai": "^4.33.0",
43+
"https-proxy-agent": "^7.0.5",
44+
"openai": "^4.52.7",
4745
"ora": "^8.0.1",
48-
"puppeteer": "22.5.0"
46+
"puppeteer": "22.13.1"
4947
}
5048
}

0 commit comments

Comments
 (0)