可以看到,其编码方式为硬编码(hardcore),采用tenacity模块实现重连机制,对于支持的报错情形,比如openai.error.Timeout, openai.error.APIError等,会尝试重连,最小等待时间为1s,最大等待时间为60s,每次重连等待时间会乘以2。 简单重连 我们尝试用一个错误的OpenAI key进行对话,代码如下: fromlan
except Exception as error: error_message = f"{error}" or f"{error.__class__} {error.__doc__}" logger.error( f"embed_and_store_with_limit_and_check - id {id} #[{vector_store.space_name} {vector_store.db_name}] - failed with exception {error_message}, retry {retry}" if isin...
max retries set to 700, since default open ai value is 600 (set above the default to prevent further errors of remote protocol error.) Enhancements to OpenAI model configuration: timeoutIntInput
chore(tests): adjust retry timeout values (openai#1851) Browse files main (openai/openai-python#1852) stainless-app[bot] committed Nov 6, 2024 1 parent 22432e2 commit 7f6a921 Showing 1 changed file with 2 additions and 2 deletions. Whitespace Ignore whitespace Split Unified 4...
Even if higher timeout is calculated, it cannot get higher than this value. Default to 10s. Defaults to {} Returns ( attempt: number ) => number The function calculating the delay.retry( callback, options = { [options.maxAttempts], [options.retryDelay], [options.signal] } ) → ...
72 + json=payload, stream=False, timeout=TIMEOUT_SECONDS*2); break 73 + except TimeoutError as e: 74 + retry += 1 75 + traceback.print_exc() 76 + if MAX_RETRY!=0: print(f'请求超时,正在重试 ({retry}/{MAX_RETRY})……') ...
(url); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return (await response.json()); } catch (error) { console.error("Error making performance request:", error); return null; } } // Register demo user tools server.tool("get-demo-user-list",...