Skip to content

Commit

Permalink
chore: remove the internal timeout limit of the jina API; add error i…
Browse files Browse the repository at this point in the history
…nfo during function calling.
  • Loading branch information
adolphnov committed Aug 12, 2024
1 parent e8bb16a commit 3ef549f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"sha":"300987e","timestamp":1723433482}
{"sha":"e8bb16a","timestamp":1723457665}
11 changes: 6 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ var Environment = class {
// -- 版本数据 --
//
// 当前版本
BUILD_TIMESTAMP = 1723433482;
BUILD_TIMESTAMP = 1723457665;
// 当前版本 commit id
BUILD_VERSION = "300987e";
BUILD_VERSION = "e8bb16a";
// -- 基础配置 --
/**
* @type {I18n | null}
Expand Down Expand Up @@ -1722,6 +1722,7 @@ async function handleOpenaiFunctionCall(url, header2, body, prompt, context, onS
return { type: "continue" };
} catch (e) {
console.error(e.message);
context._info.setCallInfo(e.message);
if (final_tool_type)
body.messages[0].content = tools_default[final_tool_type].prompt;
return { type: "continue", message: e.message };
Expand Down Expand Up @@ -4337,9 +4338,9 @@ var jina_reader = {
const startTime = Date.now();
const result = await fetch("https://r.jina.ai/" + url, {
headers: {
"X-Return-Format": "text",
"Authorization": `Bearer ${JINA_API_KEY}`,
"X-Timeout": 10
// 'X-Return-Format': 'text',
"Authorization": `Bearer ${JINA_API_KEY}`
// 'X-Timeout': 15
},
...signal && { signal } || {}
});
Expand Down
2 changes: 1 addition & 1 deletion dist/timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1723433482
1723457665
1 change: 1 addition & 0 deletions src/agent/toolHander.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export async function handleOpenaiFunctionCall(url, header, body, prompt, contex
return { type: 'continue' };
} catch (e) {
console.error(e.message);
context._info.setCallInfo(e.message);
if (final_tool_type) body.messages[0].content = tools_settings[final_tool_type].prompt;
return { type: 'continue', message: e.message };
}
Expand Down
4 changes: 2 additions & 2 deletions src/tools/jina.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export const jina_reader = {
const startTime = Date.now();
const result = await fetch('https://r.jina.ai/' + url, {
headers: {
'X-Return-Format': 'text',
// 'X-Return-Format': 'text',
'Authorization': `Bearer ${JINA_API_KEY}`,
'X-Timeout': 10
// 'X-Timeout': 15
},
...(signal && { signal } || {})
});
Expand Down

0 comments on commit 3ef549f

Please sign in to comment.