Skip to content

Commit

Permalink
Merge pull request #831 from dcSpark/feature/added-tool-timeouts
Browse files Browse the repository at this point in the history
added timeouts to py/ts, llm-tool incresed from 3->5
  • Loading branch information
nicarq authored Jan 31, 2025
2 parents 0234800 + 19dcf1f commit 57bda33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ pub fn generate_python_definition(
'x-shinkai-tool-id': os.environ.get('X_SHINKAI_TOOL_ID', ''),
'x-shinkai-app-id': os.environ.get('X_SHINKAI_APP_ID', ''),
'x-shinkai-llm-provider': os.environ.get('X_SHINKAI_LLM_PROVIDER', '')
}
},
timeout=360
)
response.raise_for_status()
return response.json()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ pub fn generate_typescript_definition(
}};
try {{
const response = await axios.post(_url, data, {{
timeout: 1000 * 60 * 6, // 6 minutes timeout
headers: {{
'Authorization': `Bearer ${{Deno.env.get('BEARER')}}`,
'x-shinkai-tool-id': `${{Deno.env.get('X_SHINKAI_TOOL_ID')}}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use shinkai_message_primitives::schemas::inbox_name::InboxName;
use shinkai_sqlite::SqliteManager;
use shinkai_tools_primitives::tools::parameters::Parameters;
use shinkai_tools_primitives::tools::{
error::ToolError, shinkai_tool::ShinkaiToolHeader, tool_output_arg::ToolOutputArg
error::ToolError, shinkai_tool::ShinkaiToolHeader, tool_output_arg::ToolOutputArg,
};
use std::sync::Arc;

Expand Down Expand Up @@ -110,7 +110,7 @@ impl ToolExecutor for LlmPromptProcessorTool {
.map_err(|e| ToolError::ExecutionError(e.to_string()))?;

let start_time = std::time::Instant::now();
let timeout = Duration::from_secs(180); // 3 minutes timeout
let timeout = Duration::from_secs(60 * 5); // 5 minutes timeout
let delay = Duration::from_secs(1); // 1 second delay between polls

let x = loop {
Expand Down

0 comments on commit 57bda33

Please sign in to comment.