Skip to content

Commit 1cfb30d

Browse files
committed
Update api docs
1 parent ffbc655 commit 1cfb30d

File tree

2 files changed

+63
-1
lines changed

2 files changed

+63
-1
lines changed

api-manual/api/ai.mdx

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ AI 模块提供了与多种大语言模型集成的能力,支持 OpenAI、Chat
4040
| [ai.onReasonStream](#onreasonstream) | WithReasonStreamHandler 设置推理过程的流式输出回调,用于获取 AI 的思考过程。 |
4141
| [ai.onStream](#onstream) | WithStreamHandler 设置流式输出的回调函数,用于实时接收 AI 响应数据。 |
4242
| [ai.proxy](#proxy) | WithProxy 设置 HTTP 代理服务器,用于网络请求。 |
43+
| [ai.rawHTTPRequestResponseCallback](#rawhttprequestresponsecallback) | |
44+
| [ai.rawHTTPResponseCallback](#rawhttpresponsecallback) | |
4345
| [ai.thinking](#thinking) | WithEnableThinking 启用think模式,目前只有当ai模型类型为`volcengine`类型也就是豆包相关模型时此配置才生效。 |
4446
| [ai.timeout](#timeout) | WithTimeout 设置请求超时时间(单位:秒)。 |
4547
| [ai.toolCallCallback](#toolcallcallback) | WithToolCallCallback 设置 tool_calls 回调函数,用于在 AI 响应中包含 tool_calls 时接管其处理逻辑。启用后,tool_calls 将不再以默认的占位标记形式输出,而是直接通过回调函数返回解析后的 ToolCall 对象。 目前只在项目内部测试脚本使用 |
@@ -1097,6 +1099,66 @@ client = ai.OpenAI(ai.apiKey("sk-xxx"), ai.proxy("socks5://127.0.0.1:1080"))
10971099
</Tabs>
10981100

10991101

1102+
---
1103+
1104+
### rawHTTPRequestResponseCallback
1105+
1106+
- 描述:
1107+
1108+
1109+
<Tabs>
1110+
<TabItem value="rawHTTPRequestResponseCallback-1" label="定义" default>
1111+
1112+
```go
1113+
rawHTTPRequestResponseCallback(cb RawHTTPRequestResponseCallback) AIConfigOption
1114+
```
1115+
1116+
**参数配置信息**
1117+
1118+
|参数名|参数类型|参数解释|
1119+
|:-----------|:---------- |:-----------|
1120+
| cb | `RawHTTPRequestResponseCallback` | |
1121+
1122+
**返回值**
1123+
1124+
|返回值(顺序)|返回值类型|返回值解释|
1125+
|:-----------|:---------- |:-----------|
1126+
| r1 | `AIConfigOption` | |
1127+
1128+
</TabItem>
1129+
</Tabs>
1130+
1131+
1132+
---
1133+
1134+
### rawHTTPResponseCallback
1135+
1136+
- 描述:
1137+
1138+
1139+
<Tabs>
1140+
<TabItem value="rawHTTPResponseCallback-1" label="定义" default>
1141+
1142+
```go
1143+
rawHTTPResponseCallback(cb func(headerBytes []byte, bodyPreview []byte)) AIConfigOption
1144+
```
1145+
1146+
**参数配置信息**
1147+
1148+
|参数名|参数类型|参数解释|
1149+
|:-----------|:---------- |:-----------|
1150+
| cb | `func(headerBytes []byte, bodyPreview []byte)` | |
1151+
1152+
**返回值**
1153+
1154+
|返回值(顺序)|返回值类型|返回值解释|
1155+
|:-----------|:---------- |:-----------|
1156+
| r1 | `AIConfigOption` | |
1157+
1158+
</TabItem>
1159+
</Tabs>
1160+
1161+
11001162
---
11011163

11021164
### thinking

api-manual/api/simulator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ htmlChangeMode|(simulator.loginDetectMode) 1|
77
leaklessDefault|(simulator.LeaklessMode) 0|
88
leaklessOff|(simulator.LeaklessMode) -1|
99
leaklessOn|(simulator.LeaklessMode) 1|
10-
simple|(map[string]interface {}) map[string]interface {}{&#34;CreateBrowser&#34;: (func(...simple.BrowserConfigOpt) (*simple.VBrowser, error))(0x35efca0), &#34;bodyModifyTarget&#34;: &#34;body&#34;, &#34;bodyReplaceTarget&#34;: &#34;bodyReplace&#34;, &#34;createBrowser&#34;: (func(...simple.BrowserConfigOpt) (*simple.VBrowser, error))(0x35efca0), &#34;exePath&#34;: (func(string) simple.BrowserConfigOpt)(0x35ef2a0), &#34;headersModifyTarget&#34;: &#34;headers&#34;, &#34;headless&#34;: (func(bool) simple.BrowserConfigOpt)(0x35ef5a0), &#34;hijack&#34;: (func(bool) simple.BrowserConfigOpt)(0x35ef620), &#34;hostModifyTarget&#34;: &#34;host&#34;, &#34;leakless&#34;: (func(bool) simple.BrowserConfigOpt)(0x35efc20), &#34;noSandBox&#34;: (func(bool) simple.BrowserConfigOpt)(0x35ef520), &#34;proxy&#34;: (func(string, ...string) simple.BrowserConfigOpt)(0x35ef380), &#34;requestModify&#34;: (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x35ef920), &#34;responseModify&#34;: (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x35ef6a0), &#34;timeout&#34;: (func(int) simple.BrowserConfigOpt)(0x35efba0), &#34;wsAddress&#34;: (func(string) simple.BrowserConfigOpt)(0x35ef1c0)}|
10+
simple|(map[string]interface {}) map[string]interface {}{&#34;CreateBrowser&#34;: (func(...simple.BrowserConfigOpt) (*simple.VBrowser, error))(0x35f1d20), &#34;bodyModifyTarget&#34;: &#34;body&#34;, &#34;bodyReplaceTarget&#34;: &#34;bodyReplace&#34;, &#34;createBrowser&#34;: (func(...simple.BrowserConfigOpt) (*simple.VBrowser, error))(0x35f1d20), &#34;exePath&#34;: (func(string) simple.BrowserConfigOpt)(0x35f1320), &#34;headersModifyTarget&#34;: &#34;headers&#34;, &#34;headless&#34;: (func(bool) simple.BrowserConfigOpt)(0x35f1620), &#34;hijack&#34;: (func(bool) simple.BrowserConfigOpt)(0x35f16a0), &#34;hostModifyTarget&#34;: &#34;host&#34;, &#34;leakless&#34;: (func(bool) simple.BrowserConfigOpt)(0x35f1ca0), &#34;noSandBox&#34;: (func(bool) simple.BrowserConfigOpt)(0x35f15a0), &#34;proxy&#34;: (func(string, ...string) simple.BrowserConfigOpt)(0x35f1400), &#34;requestModify&#34;: (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x35f19a0), &#34;responseModify&#34;: (func(string, simple.ModifyTarget, interface {}) simple.BrowserConfigOpt)(0x35f1720), &#34;timeout&#34;: (func(int) simple.BrowserConfigOpt)(0x35f1c20), &#34;wsAddress&#34;: (func(string) simple.BrowserConfigOpt)(0x35f1240)}|
1111
stringMatchMode|(simulator.loginDetectMode) 2|
1212
urlChangeMode|(simulator.loginDetectMode) 0|
1313

0 commit comments

Comments
 (0)