文章主题:人工智能技术, ChatGPT, 纳拉亚纳·穆尔蒂, Infosys

666AI工具大全,助力做AI时代先行者!

财联社4月21日讯(编辑 刘蕊)自美国OpenAI公司去年11月推出ChatGPT,这款人工智能聊天机器人快速火遍全球。这款AI机器人不仅可以实现论文写作、编码,还能像人类一样对话。目前不少企业已经开始将ChatGPT应用到业务中。

<!doctype html> <html lang=en> <head> <title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D86BEB0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) // Werkzeug Debugger</title> <link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”> <link rel=”shortcut icon” href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”> <script src=”?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js”></script> <script> var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = “uImqR9BO9WQOrgY4YnuS”; </script> </head> <body style=”background-color: #fff”> <div class=”debugger”> <h1>ConnectionError</h1> <div class=”detail”> <p class=”errormsg”>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D86BEB0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </p> </div> <h2 class=”traceback”>Traceback <em>(most recent call last)</em></h2> <div class=”traceback”> <h3></h3> <ul><li><div class=”frame” id=”frame-2551706022064″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>203</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;Establish a socket connection and set nodelay settings on it.</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>:return: New socket connection.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>sock = connection.create_connection(</pre> <pre class=”line after”><span class=”ws”> </span>(self._dns_host, self.port),</pre> <pre class=”line after”><span class=”ws”> </span>self.timeout,</pre> <pre class=”line after”><span class=”ws”> </span>source_address=self.source_address,</pre> <pre class=”line after”><span class=”ws”> </span>socket_options=self.socket_options,</pre> <pre class=”line after”><span class=”ws”> </span>)</pre></div> </div> <li><div class=”frame” id=”frame-2551706022176″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>85</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>if sock is not None:</pre> <pre class=”line before”><span class=”ws”> </span>sock.close()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if err is not None:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>raise err</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise OSError(&#34;getaddrinfo returns an empty list&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706022288″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if timeout is not _DEFAULT_TIMEOUT:</pre> <pre class=”line before”><span class=”ws”> </span>sock.settimeout(timeout)</pre> <pre class=”line before”><span class=”ws”> </span>if source_address:</pre> <pre class=”line before”><span class=”ws”> </span>sock.bind(source_address)</pre> <pre class=”line current”><span class=”ws”> </span>sock.connect(sa)</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>return sock</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except OSError as _:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551705963536″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>790</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># it will also try to release it and we&#39;ll have a double-release</pre> <pre class=”line before”><span class=”ws”> </span># mess.</pre> <pre class=”line before”><span class=”ws”> </span>response_conn = conn if not release_conn else None</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Make the request on the HTTPConnection object</pre> <pre class=”line current”><span class=”ws”> </span>response = self._make_request(</pre> <pre class=”line after”><span class=”ws”> </span>conn,</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>timeout=timeout_obj,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre></div> </div> <li><div class=”frame” id=”frame-2551705963648″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>496</em>, in <code class=”function”>_make_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>raise new_e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># conn.request() calls http.client.*.request, not the method in</pre> <pre class=”line before”><span class=”ws”> </span># urllib3.request. It also calls makefile (recv) on the socket.</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>conn.request(</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=headers,</pre> <pre class=”line after”><span class=”ws”> </span>chunked=chunked,</pre></div> </div> <li><div class=”frame” id=”frame-2551705963760″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>395</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># Now that framing headers are out of the way we send all the other headers.</pre> <pre class=”line before”><span class=”ws”> </span>if &#34;user-agent&#34; not in header_keys:</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _get_default_user_agent())</pre> <pre class=”line before”><span class=”ws”> </span>for header, value in headers.items():</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(header, value)</pre> <pre class=”line current”><span class=”ws”> </span>self.endheaders()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re given a body we start sending that in chunks.</pre> <pre class=”line after”><span class=”ws”> </span>if chunks is not None:</pre> <pre class=”line after”><span class=”ws”> </span>for chunk in chunks:</pre> <pre class=”line after”><span class=”ws”> </span># Sending empty chunks isn&#39;t allowed for TE: chunked</pre></div> </div> <li><div class=”frame” id=”frame-2551705963872″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1280</em>, in <code class=”function”>endheaders</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>if self.__state == _CS_REQ_STARTED:</pre> <pre class=”line before”><span class=”ws”> </span>self.__state = _CS_REQ_SENT</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>raise CannotSendHeader()</pre> <pre class=”line current”><span class=”ws”> </span>self._send_output(message_body, encode_chunked=encode_chunked)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def request(self, method, url, body=None, headers={}, *,</pre> <pre class=”line after”><span class=”ws”> </span>encode_chunked=False):</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</pre> <pre class=”line after”><span class=”ws”> </span>self._send_request(method, url, body, headers, encode_chunked)</pre></div> </div> <li><div class=”frame” id=”frame-2551705964096″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1040</em>, in <code class=”function”>_send_output</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>A message_body may be specified, to be appended to the request.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre> <pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.join(self._buffer)</pre> <pre class=”line before”><span class=”ws”> </span>del self._buffer[:]</pre> <pre class=”line current”><span class=”ws”> </span>self.send(msg)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if message_body is not None:</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># create a consistent interface to message_body</pre> <pre class=”line after”><span class=”ws”> </span>if hasattr(message_body, &#39;read&#39;):</pre></div> </div> <li><div class=”frame” id=”frame-2551705964208″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>980</em>, in <code class=”function”>send</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>file-like object that supports a .read() method, or an iterable object.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if self.sock is None:</pre> <pre class=”line before”><span class=”ws”> </span>if self.auto_open:</pre> <pre class=”line current”><span class=”ws”> </span>self.connect()</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise NotConnected()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if self.debuglevel &gt; 0:</pre> <pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div> </div> <li><div class=”frame” id=”frame-2551705964320″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>243</em>, in <code class=”function”>connect</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”> </span>super().set_tunnel(host, port=port, headers=headers)</pre> <pre class=”line before”><span class=”ws”> </span>self._tunnel_scheme = scheme</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>def connect(self) -&gt; None:</pre> <pre class=”line current”><span class=”ws”> </span>self.sock = self._new_conn()</pre> <pre class=”line after”><span class=”ws”> </span>if self._tunnel_host:</pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re tunneling it means we&#39;re connected to our proxy.</pre> <pre class=”line after”><span class=”ws”> </span>self._has_connected_to_proxy = True</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># TODO: Fix tunnel so it doesn&#39;t depend on self.sock state.</pre></div> </div> <li><div class=”frame” id=”frame-2551705964432″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>218</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>self,</pre> <pre class=”line before”><span class=”ws”> </span>f&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</pre> <pre class=”line before”><span class=”ws”> </span>) from e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>except OSError as e:</pre> <pre class=”line current”><span class=”ws”> </span>raise NewConnectionError(</pre> <pre class=”line after”><span class=”ws”> </span>self, f&#34;Failed to establish a new connection: {e}&#34;</pre> <pre class=”line after”><span class=”ws”> </span>) from e</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Audit hooks are only available in Python 3.8+</pre> <pre class=”line after”><span class=”ws”> </span>if _HAS_SYS_AUDIT:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551705963088″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>486</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>timeout = TimeoutSauce(connect=timeout, read=timeout)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>resp = conn.urlopen(</pre> <pre class=”line after”><span class=”ws”> </span>method=request.method,</pre> <pre class=”line after”><span class=”ws”> </span>url=url,</pre> <pre class=”line after”><span class=”ws”> </span>body=request.body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=request.headers,</pre> <pre class=”line after”><span class=”ws”> </span>redirect=False,</pre></div> </div> <li><div class=”frame” id=”frame-2551705963200″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>844</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>) and (conn and conn.proxy and not conn.has_connected_to_proxy):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)</pre> <pre class=”line before”><span class=”ws”> </span>elif isinstance(new_e, (OSError, HTTPException)):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = ProtocolError(&#34;Connection aborted.&#34;, new_e)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>retries = retries.increment(</pre> <pre class=”line after”><span class=”ws”> </span>method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]</pre> <pre class=”line after”><span class=”ws”> </span>)</pre> <pre class=”line after”><span class=”ws”> </span>retries.sleep()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Keep track of the error for the retry warning.</pre></div> </div> <li><div class=”frame” id=”frame-2551705963312″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”</cite>, line <em class=”line”>515</em>, in <code class=”function”>increment</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>history=history,</pre> <pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if new_retry.is_exhausted():</pre> <pre class=”line before”><span class=”ws”> </span>reason = error or ResponseError(cause)</pre> <pre class=”line current”><span class=”ws”> </span>raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>log.debug(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, url, new_retry)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return new_retry</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div> <li><div class=”frame” id=”frame-2551705960736″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1478</em>, in <code class=”function”>__call__</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -&gt; t.Any:</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;The WSGI server calls the Flask application object as the</pre> <pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre> <pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div> </div> <li><div class=”frame” id=”frame-2551705960960″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1458</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line before”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line before”><span class=”ws”> </span>error = e</pre> <pre class=”line current”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”> </span>return response(environ, start_response)</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre></div> </div> <li><div class=”frame” id=”frame-2551705960848″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1455</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>ctx = self.request_context(environ)</pre> <pre class=”line before”><span class=”ws”> </span>error: BaseException | None = None</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line current”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>error = e</pre> <pre class=”line after”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre></div> </div> <li><div class=”frame” id=”frame-2551705961072″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>869</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre> <pre class=”line after”><span class=”ws”> </span>self,</pre> <pre class=”line after”><span class=”ws”> </span>rv: ft.ResponseReturnValue | HTTPException,</pre></div> </div> <li><div class=”frame” id=”frame-2551705961184″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>867</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre></div> </div> <li><div class=”frame” id=”frame-2551705961296″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>852</em>, in <code class=”function”>dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == &#34;OPTIONS&#34;</pre> <pre class=”line before”><span class=”ws”> </span>):</pre> <pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre> <pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre> <pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre> <pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -&gt; Response:</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Dispatches the request and on top of that performs request</pre> <pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre> <pre class=”line after”><span class=”ws”> </span>error handling.</pre></div> </div> <li><div class=”frame” id=”frame-2551705961408″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>322</em>, in <code class=”function”>get_new_content_api</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre> <pre class=”line before”><span class=”ws”> </span>content = request.args.get(&#39;content&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div> </div> <li><div class=”frame” id=”frame-2551705961520″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551705961632″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551705961744″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551705961856″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>329</em>, in <code class=”function”>get_new_content</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre> <pre class=”line after”><span class=”ws”> </span>payload = {</pre> <pre class=”line after”><span class=”ws”> </span>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div> </div> <li><div class=”frame” id=”frame-2551705962080″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551705962192″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551705962304″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551705962416″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>355</em>, in <code class=”function”>get_new_content_chatglm</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;functions&#34;: {},</pre> <pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</pre> <pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre> <pre class=”line current”><span class=”ws”> </span>response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)</pre> <pre class=”line after”><span class=”ws”> </span>#print(response)</pre> <pre class=”line after”><span class=”ws”> </span>data = response.json()</pre> <pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre> <pre class=”line after”><span class=”ws”> </span>new_content = data[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre> <pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551705962528″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\api.py”</cite>, line <em class=”line”>59</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># By using the &#39;with&#39; statement we are sure the session is closed, thus we</pre> <pre class=”line before”><span class=”ws”> </span># avoid leaving sockets open which can trigger a ResourceWarning in some</pre> <pre class=”line before”><span class=”ws”> </span># cases, and look like a memory leak in others.</pre> <pre class=”line before”><span class=”ws”> </span>with sessions.Session() as session:</pre> <pre class=”line current”><span class=”ws”> </span>return session.request(method=method, url=url, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span>def get(url, params=None, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request.</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551705962752″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>589</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>send_kwargs = {</pre> <pre class=”line before”><span class=”ws”> </span>&#34;timeout&#34;: timeout,</pre> <pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: allow_redirects,</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>send_kwargs.update(settings)</pre> <pre class=”line current”><span class=”ws”> </span>resp = self.send(prep, **send_kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return resp</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def get(self, url, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div> </div> <li><div class=”frame” id=”frame-2551705962864″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>703</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Start time (approximately) of the request</pre> <pre class=”line before”><span class=”ws”> </span>start = preferred_clock()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Send the request</pre> <pre class=”line current”><span class=”ws”> </span>r = adapter.send(request, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Total elapsed time of the request (approximately)</pre> <pre class=”line after”><span class=”ws”> </span>elapsed = preferred_clock() – start</pre> <pre class=”line after”><span class=”ws”> </span>r.elapsed = timedelta(seconds=elapsed)</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551705962976″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>519</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if isinstance(e.reason, _SSLError):</pre> <pre class=”line before”><span class=”ws”> </span># This branch is for urllib3 v1.22 and later.</pre> <pre class=”line before”><span class=”ws”> </span>raise SSLError(e, request=request)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except ClosedPoolError as e:</pre> <pre class=”line after”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except _ProxyError as e:</pre></div> </div> </ul> <blockquote>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D86BEB0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </blockquote> </div> <div class=”plain”> <p> This is the Copy/Paste friendly version of the traceback. </p> <textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn sock = connection.create_connection( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection raise err File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen response = self._make_request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request conn.request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request self.endheaders() File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output self.send(msg) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send self.connect() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect self.sock = self._new_conn() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000002521D86BEB0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send resp = conn.urlopen( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen retries = retries.increment( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D86BEB0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__ return self.wsgi_app(environ, start_response) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app response = self.handle_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app response = self.full_dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request rv = self.dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request return session.request(method=method, url=url, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request resp = self.send(prep, **send_kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send r = adapter.send(request, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D86BEB0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </textarea> </div> <div class=”explanation”> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. <span class=”nojavascript”> If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.</span> </div> <div class=”footer”> Brought to you by <strong class=”arthur”>DON’T PANIC</strong>, your friendly Werkzeug powered traceback interpreter. </div> </div> <div class=”pin-prompt”> <div class=”inner”> <h3>Console Locked</h3> <p> The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> <p>PIN: <input type=text name=pin size=14> <input type=submit name=btn value=”Confirm Pin”> </form> </div> </div> </body> </html> <!– Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 203, in _new_conn sock = connection.create_connection( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 85, in create_connection raise err File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 790, in urlopen response = self._make_request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 496, in _make_request conn.request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 395, in request self.endheaders() File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1040, in _send_output self.send(msg) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 980, in send self.connect() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 243, in connect self.sock = self._new_conn() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002521D86BEB0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 486, in send resp = conn.urlopen( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 844, in urlopen retries = retries.increment( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D86BEB0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1478, in __call__ return self.wsgi_app(environ, start_response) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1458, in wsgi_app response = self.handle_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1455, in wsgi_app response = self.full_dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 867, in full_dispatch_request rv = self.dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File “F:\project\wxgzh\model_server.py”, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 355, in get_new_content_chatglm response = requests.request(“POST”, chatglm_url, json=payload, headers=headers) File “F:\project\wxgzh\venv\lib\site-packages\requests\api.py”, line 59, in request return session.request(method=method, url=url, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 589, in request resp = self.send(prep, **send_kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 703, in send r = adapter.send(request, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D86BEB0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) –>

<!doctype html> <html lang=en> <head> <title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D895280&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) // Werkzeug Debugger</title> <link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”> <link rel=”shortcut icon” href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”> <script src=”?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js”></script> <script> var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = “uImqR9BO9WQOrgY4YnuS”; </script> </head> <body style=”background-color: #fff”> <div class=”debugger”> <h1>ConnectionError</h1> <div class=”detail”> <p class=”errormsg”>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D895280&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </p> </div> <h2 class=”traceback”>Traceback <em>(most recent call last)</em></h2> <div class=”traceback”> <h3></h3> <ul><li><div class=”frame” id=”frame-2551706145392″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>203</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;Establish a socket connection and set nodelay settings on it.</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>:return: New socket connection.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>sock = connection.create_connection(</pre> <pre class=”line after”><span class=”ws”> </span>(self._dns_host, self.port),</pre> <pre class=”line after”><span class=”ws”> </span>self.timeout,</pre> <pre class=”line after”><span class=”ws”> </span>source_address=self.source_address,</pre> <pre class=”line after”><span class=”ws”> </span>socket_options=self.socket_options,</pre> <pre class=”line after”><span class=”ws”> </span>)</pre></div> </div> <li><div class=”frame” id=”frame-2551706145504″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>85</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>if sock is not None:</pre> <pre class=”line before”><span class=”ws”> </span>sock.close()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if err is not None:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>raise err</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise OSError(&#34;getaddrinfo returns an empty list&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706145616″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if timeout is not _DEFAULT_TIMEOUT:</pre> <pre class=”line before”><span class=”ws”> </span>sock.settimeout(timeout)</pre> <pre class=”line before”><span class=”ws”> </span>if source_address:</pre> <pre class=”line before”><span class=”ws”> </span>sock.bind(source_address)</pre> <pre class=”line current”><span class=”ws”> </span>sock.connect(sa)</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>return sock</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except OSError as _:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706086864″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>790</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># it will also try to release it and we&#39;ll have a double-release</pre> <pre class=”line before”><span class=”ws”> </span># mess.</pre> <pre class=”line before”><span class=”ws”> </span>response_conn = conn if not release_conn else None</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Make the request on the HTTPConnection object</pre> <pre class=”line current”><span class=”ws”> </span>response = self._make_request(</pre> <pre class=”line after”><span class=”ws”> </span>conn,</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>timeout=timeout_obj,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre></div> </div> <li><div class=”frame” id=”frame-2551706086976″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>496</em>, in <code class=”function”>_make_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>raise new_e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># conn.request() calls http.client.*.request, not the method in</pre> <pre class=”line before”><span class=”ws”> </span># urllib3.request. It also calls makefile (recv) on the socket.</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>conn.request(</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=headers,</pre> <pre class=”line after”><span class=”ws”> </span>chunked=chunked,</pre></div> </div> <li><div class=”frame” id=”frame-2551706087088″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>395</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># Now that framing headers are out of the way we send all the other headers.</pre> <pre class=”line before”><span class=”ws”> </span>if &#34;user-agent&#34; not in header_keys:</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _get_default_user_agent())</pre> <pre class=”line before”><span class=”ws”> </span>for header, value in headers.items():</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(header, value)</pre> <pre class=”line current”><span class=”ws”> </span>self.endheaders()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re given a body we start sending that in chunks.</pre> <pre class=”line after”><span class=”ws”> </span>if chunks is not None:</pre> <pre class=”line after”><span class=”ws”> </span>for chunk in chunks:</pre> <pre class=”line after”><span class=”ws”> </span># Sending empty chunks isn&#39;t allowed for TE: chunked</pre></div> </div> <li><div class=”frame” id=”frame-2551706087200″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1280</em>, in <code class=”function”>endheaders</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>if self.__state == _CS_REQ_STARTED:</pre> <pre class=”line before”><span class=”ws”> </span>self.__state = _CS_REQ_SENT</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>raise CannotSendHeader()</pre> <pre class=”line current”><span class=”ws”> </span>self._send_output(message_body, encode_chunked=encode_chunked)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def request(self, method, url, body=None, headers={}, *,</pre> <pre class=”line after”><span class=”ws”> </span>encode_chunked=False):</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</pre> <pre class=”line after”><span class=”ws”> </span>self._send_request(method, url, body, headers, encode_chunked)</pre></div> </div> <li><div class=”frame” id=”frame-2551706144832″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1040</em>, in <code class=”function”>_send_output</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>A message_body may be specified, to be appended to the request.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre> <pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.join(self._buffer)</pre> <pre class=”line before”><span class=”ws”> </span>del self._buffer[:]</pre> <pre class=”line current”><span class=”ws”> </span>self.send(msg)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if message_body is not None:</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># create a consistent interface to message_body</pre> <pre class=”line after”><span class=”ws”> </span>if hasattr(message_body, &#39;read&#39;):</pre></div> </div> <li><div class=”frame” id=”frame-2551706144944″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>980</em>, in <code class=”function”>send</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>file-like object that supports a .read() method, or an iterable object.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if self.sock is None:</pre> <pre class=”line before”><span class=”ws”> </span>if self.auto_open:</pre> <pre class=”line current”><span class=”ws”> </span>self.connect()</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise NotConnected()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if self.debuglevel &gt; 0:</pre> <pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div> </div> <li><div class=”frame” id=”frame-2551706145056″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>243</em>, in <code class=”function”>connect</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”> </span>super().set_tunnel(host, port=port, headers=headers)</pre> <pre class=”line before”><span class=”ws”> </span>self._tunnel_scheme = scheme</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>def connect(self) -&gt; None:</pre> <pre class=”line current”><span class=”ws”> </span>self.sock = self._new_conn()</pre> <pre class=”line after”><span class=”ws”> </span>if self._tunnel_host:</pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re tunneling it means we&#39;re connected to our proxy.</pre> <pre class=”line after”><span class=”ws”> </span>self._has_connected_to_proxy = True</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># TODO: Fix tunnel so it doesn&#39;t depend on self.sock state.</pre></div> </div> <li><div class=”frame” id=”frame-2551706145168″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>218</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>self,</pre> <pre class=”line before”><span class=”ws”> </span>f&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</pre> <pre class=”line before”><span class=”ws”> </span>) from e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>except OSError as e:</pre> <pre class=”line current”><span class=”ws”> </span>raise NewConnectionError(</pre> <pre class=”line after”><span class=”ws”> </span>self, f&#34;Failed to establish a new connection: {e}&#34;</pre> <pre class=”line after”><span class=”ws”> </span>) from e</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Audit hooks are only available in Python 3.8+</pre> <pre class=”line after”><span class=”ws”> </span>if _HAS_SYS_AUDIT:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706086416″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>486</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>timeout = TimeoutSauce(connect=timeout, read=timeout)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>resp = conn.urlopen(</pre> <pre class=”line after”><span class=”ws”> </span>method=request.method,</pre> <pre class=”line after”><span class=”ws”> </span>url=url,</pre> <pre class=”line after”><span class=”ws”> </span>body=request.body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=request.headers,</pre> <pre class=”line after”><span class=”ws”> </span>redirect=False,</pre></div> </div> <li><div class=”frame” id=”frame-2551706086528″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>844</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>) and (conn and conn.proxy and not conn.has_connected_to_proxy):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)</pre> <pre class=”line before”><span class=”ws”> </span>elif isinstance(new_e, (OSError, HTTPException)):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = ProtocolError(&#34;Connection aborted.&#34;, new_e)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>retries = retries.increment(</pre> <pre class=”line after”><span class=”ws”> </span>method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]</pre> <pre class=”line after”><span class=”ws”> </span>)</pre> <pre class=”line after”><span class=”ws”> </span>retries.sleep()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Keep track of the error for the retry warning.</pre></div> </div> <li><div class=”frame” id=”frame-2551706086640″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”</cite>, line <em class=”line”>515</em>, in <code class=”function”>increment</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>history=history,</pre> <pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if new_retry.is_exhausted():</pre> <pre class=”line before”><span class=”ws”> </span>reason = error or ResponseError(cause)</pre> <pre class=”line current”><span class=”ws”> </span>raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>log.debug(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, url, new_retry)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return new_retry</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div> <li><div class=”frame” id=”frame-2551706084176″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1478</em>, in <code class=”function”>__call__</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -&gt; t.Any:</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;The WSGI server calls the Flask application object as the</pre> <pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre> <pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div> </div> <li><div class=”frame” id=”frame-2551706083616″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1458</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line before”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line before”><span class=”ws”> </span>error = e</pre> <pre class=”line current”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”> </span>return response(environ, start_response)</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre></div> </div> <li><div class=”frame” id=”frame-2551706084064″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1455</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>ctx = self.request_context(environ)</pre> <pre class=”line before”><span class=”ws”> </span>error: BaseException | None = None</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line current”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>error = e</pre> <pre class=”line after”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre></div> </div> <li><div class=”frame” id=”frame-2551706084400″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>869</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre> <pre class=”line after”><span class=”ws”> </span>self,</pre> <pre class=”line after”><span class=”ws”> </span>rv: ft.ResponseReturnValue | HTTPException,</pre></div> </div> <li><div class=”frame” id=”frame-2551706084512″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>867</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre></div> </div> <li><div class=”frame” id=”frame-2551706084624″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>852</em>, in <code class=”function”>dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == &#34;OPTIONS&#34;</pre> <pre class=”line before”><span class=”ws”> </span>):</pre> <pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre> <pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre> <pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre> <pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -&gt; Response:</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Dispatches the request and on top of that performs request</pre> <pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre> <pre class=”line after”><span class=”ws”> </span>error handling.</pre></div> </div> <li><div class=”frame” id=”frame-2551706084736″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>322</em>, in <code class=”function”>get_new_content_api</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre> <pre class=”line before”><span class=”ws”> </span>content = request.args.get(&#39;content&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div> </div> <li><div class=”frame” id=”frame-2551706084848″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706084960″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706085072″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706085184″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>329</em>, in <code class=”function”>get_new_content</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre> <pre class=”line after”><span class=”ws”> </span>payload = {</pre> <pre class=”line after”><span class=”ws”> </span>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div> </div> <li><div class=”frame” id=”frame-2551706085408″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706085520″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706085632″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706085744″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>355</em>, in <code class=”function”>get_new_content_chatglm</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;functions&#34;: {},</pre> <pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</pre> <pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre> <pre class=”line current”><span class=”ws”> </span>response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)</pre> <pre class=”line after”><span class=”ws”> </span>#print(response)</pre> <pre class=”line after”><span class=”ws”> </span>data = response.json()</pre> <pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre> <pre class=”line after”><span class=”ws”> </span>new_content = data[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre> <pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706085856″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\api.py”</cite>, line <em class=”line”>59</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># By using the &#39;with&#39; statement we are sure the session is closed, thus we</pre> <pre class=”line before”><span class=”ws”> </span># avoid leaving sockets open which can trigger a ResourceWarning in some</pre> <pre class=”line before”><span class=”ws”> </span># cases, and look like a memory leak in others.</pre> <pre class=”line before”><span class=”ws”> </span>with sessions.Session() as session:</pre> <pre class=”line current”><span class=”ws”> </span>return session.request(method=method, url=url, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span>def get(url, params=None, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request.</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706086080″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>589</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>send_kwargs = {</pre> <pre class=”line before”><span class=”ws”> </span>&#34;timeout&#34;: timeout,</pre> <pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: allow_redirects,</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>send_kwargs.update(settings)</pre> <pre class=”line current”><span class=”ws”> </span>resp = self.send(prep, **send_kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return resp</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def get(self, url, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div> </div> <li><div class=”frame” id=”frame-2551706086192″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>703</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Start time (approximately) of the request</pre> <pre class=”line before”><span class=”ws”> </span>start = preferred_clock()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Send the request</pre> <pre class=”line current”><span class=”ws”> </span>r = adapter.send(request, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Total elapsed time of the request (approximately)</pre> <pre class=”line after”><span class=”ws”> </span>elapsed = preferred_clock() – start</pre> <pre class=”line after”><span class=”ws”> </span>r.elapsed = timedelta(seconds=elapsed)</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706086304″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>519</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if isinstance(e.reason, _SSLError):</pre> <pre class=”line before”><span class=”ws”> </span># This branch is for urllib3 v1.22 and later.</pre> <pre class=”line before”><span class=”ws”> </span>raise SSLError(e, request=request)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except ClosedPoolError as e:</pre> <pre class=”line after”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except _ProxyError as e:</pre></div> </div> </ul> <blockquote>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D895280&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </blockquote> </div> <div class=”plain”> <p> This is the Copy/Paste friendly version of the traceback. </p> <textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn sock = connection.create_connection( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection raise err File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen response = self._make_request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request conn.request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request self.endheaders() File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output self.send(msg) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send self.connect() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect self.sock = self._new_conn() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000002521D895280&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send resp = conn.urlopen( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen retries = retries.increment( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D895280&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__ return self.wsgi_app(environ, start_response) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app response = self.handle_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app response = self.full_dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request rv = self.dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request return session.request(method=method, url=url, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request resp = self.send(prep, **send_kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send r = adapter.send(request, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D895280&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </textarea> </div> <div class=”explanation”> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. <span class=”nojavascript”> If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.</span> </div> <div class=”footer”> Brought to you by <strong class=”arthur”>DON’T PANIC</strong>, your friendly Werkzeug powered traceback interpreter. </div> </div> <div class=”pin-prompt”> <div class=”inner”> <h3>Console Locked</h3> <p> The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> <p>PIN: <input type=text name=pin size=14> <input type=submit name=btn value=”Confirm Pin”> </form> </div> </div> </body> </html> <!– Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 203, in _new_conn sock = connection.create_connection( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 85, in create_connection raise err File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 790, in urlopen response = self._make_request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 496, in _make_request conn.request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 395, in request self.endheaders() File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1040, in _send_output self.send(msg) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 980, in send self.connect() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 243, in connect self.sock = self._new_conn() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002521D895280>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 486, in send resp = conn.urlopen( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 844, in urlopen retries = retries.increment( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D895280>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1478, in __call__ return self.wsgi_app(environ, start_response) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1458, in wsgi_app response = self.handle_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1455, in wsgi_app response = self.full_dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 867, in full_dispatch_request rv = self.dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File “F:\project\wxgzh\model_server.py”, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 355, in get_new_content_chatglm response = requests.request(“POST”, chatglm_url, json=payload, headers=headers) File “F:\project\wxgzh\venv\lib\site-packages\requests\api.py”, line 59, in request return session.request(method=method, url=url, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 589, in request resp = self.send(prep, **send_kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 703, in send r = adapter.send(request, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D895280>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) –>

ChatGPT不会取代人类?

<!doctype html> <html lang=en> <head> <title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8B2520&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) // Werkzeug Debugger</title> <link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”> <link rel=”shortcut icon” href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”> <script src=”?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js”></script> <script> var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = “uImqR9BO9WQOrgY4YnuS”; </script> </head> <body style=”background-color: #fff”> <div class=”debugger”> <h1>ConnectionError</h1> <div class=”detail”> <p class=”errormsg”>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8B2520&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </p> </div> <h2 class=”traceback”>Traceback <em>(most recent call last)</em></h2> <div class=”traceback”> <h3></h3> <ul><li><div class=”frame” id=”frame-2551706276912″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>203</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;Establish a socket connection and set nodelay settings on it.</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>:return: New socket connection.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>sock = connection.create_connection(</pre> <pre class=”line after”><span class=”ws”> </span>(self._dns_host, self.port),</pre> <pre class=”line after”><span class=”ws”> </span>self.timeout,</pre> <pre class=”line after”><span class=”ws”> </span>source_address=self.source_address,</pre> <pre class=”line after”><span class=”ws”> </span>socket_options=self.socket_options,</pre> <pre class=”line after”><span class=”ws”> </span>)</pre></div> </div> <li><div class=”frame” id=”frame-2551706277024″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>85</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>if sock is not None:</pre> <pre class=”line before”><span class=”ws”> </span>sock.close()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if err is not None:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>raise err</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise OSError(&#34;getaddrinfo returns an empty list&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706277136″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if timeout is not _DEFAULT_TIMEOUT:</pre> <pre class=”line before”><span class=”ws”> </span>sock.settimeout(timeout)</pre> <pre class=”line before”><span class=”ws”> </span>if source_address:</pre> <pre class=”line before”><span class=”ws”> </span>sock.bind(source_address)</pre> <pre class=”line current”><span class=”ws”> </span>sock.connect(sa)</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>return sock</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except OSError as _:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706214288″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>790</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># it will also try to release it and we&#39;ll have a double-release</pre> <pre class=”line before”><span class=”ws”> </span># mess.</pre> <pre class=”line before”><span class=”ws”> </span>response_conn = conn if not release_conn else None</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Make the request on the HTTPConnection object</pre> <pre class=”line current”><span class=”ws”> </span>response = self._make_request(</pre> <pre class=”line after”><span class=”ws”> </span>conn,</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>timeout=timeout_obj,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre></div> </div> <li><div class=”frame” id=”frame-2551706275904″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>496</em>, in <code class=”function”>_make_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>raise new_e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># conn.request() calls http.client.*.request, not the method in</pre> <pre class=”line before”><span class=”ws”> </span># urllib3.request. It also calls makefile (recv) on the socket.</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>conn.request(</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=headers,</pre> <pre class=”line after”><span class=”ws”> </span>chunked=chunked,</pre></div> </div> <li><div class=”frame” id=”frame-2551706276016″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>395</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># Now that framing headers are out of the way we send all the other headers.</pre> <pre class=”line before”><span class=”ws”> </span>if &#34;user-agent&#34; not in header_keys:</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _get_default_user_agent())</pre> <pre class=”line before”><span class=”ws”> </span>for header, value in headers.items():</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(header, value)</pre> <pre class=”line current”><span class=”ws”> </span>self.endheaders()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re given a body we start sending that in chunks.</pre> <pre class=”line after”><span class=”ws”> </span>if chunks is not None:</pre> <pre class=”line after”><span class=”ws”> </span>for chunk in chunks:</pre> <pre class=”line after”><span class=”ws”> </span># Sending empty chunks isn&#39;t allowed for TE: chunked</pre></div> </div> <li><div class=”frame” id=”frame-2551706276128″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1280</em>, in <code class=”function”>endheaders</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>if self.__state == _CS_REQ_STARTED:</pre> <pre class=”line before”><span class=”ws”> </span>self.__state = _CS_REQ_SENT</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>raise CannotSendHeader()</pre> <pre class=”line current”><span class=”ws”> </span>self._send_output(message_body, encode_chunked=encode_chunked)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def request(self, method, url, body=None, headers={}, *,</pre> <pre class=”line after”><span class=”ws”> </span>encode_chunked=False):</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</pre> <pre class=”line after”><span class=”ws”> </span>self._send_request(method, url, body, headers, encode_chunked)</pre></div> </div> <li><div class=”frame” id=”frame-2551706276352″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1040</em>, in <code class=”function”>_send_output</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>A message_body may be specified, to be appended to the request.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre> <pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.join(self._buffer)</pre> <pre class=”line before”><span class=”ws”> </span>del self._buffer[:]</pre> <pre class=”line current”><span class=”ws”> </span>self.send(msg)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if message_body is not None:</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># create a consistent interface to message_body</pre> <pre class=”line after”><span class=”ws”> </span>if hasattr(message_body, &#39;read&#39;):</pre></div> </div> <li><div class=”frame” id=”frame-2551706276464″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>980</em>, in <code class=”function”>send</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>file-like object that supports a .read() method, or an iterable object.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if self.sock is None:</pre> <pre class=”line before”><span class=”ws”> </span>if self.auto_open:</pre> <pre class=”line current”><span class=”ws”> </span>self.connect()</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise NotConnected()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if self.debuglevel &gt; 0:</pre> <pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div> </div> <li><div class=”frame” id=”frame-2551706276576″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>243</em>, in <code class=”function”>connect</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”> </span>super().set_tunnel(host, port=port, headers=headers)</pre> <pre class=”line before”><span class=”ws”> </span>self._tunnel_scheme = scheme</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>def connect(self) -&gt; None:</pre> <pre class=”line current”><span class=”ws”> </span>self.sock = self._new_conn()</pre> <pre class=”line after”><span class=”ws”> </span>if self._tunnel_host:</pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re tunneling it means we&#39;re connected to our proxy.</pre> <pre class=”line after”><span class=”ws”> </span>self._has_connected_to_proxy = True</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># TODO: Fix tunnel so it doesn&#39;t depend on self.sock state.</pre></div> </div> <li><div class=”frame” id=”frame-2551706276688″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>218</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>self,</pre> <pre class=”line before”><span class=”ws”> </span>f&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</pre> <pre class=”line before”><span class=”ws”> </span>) from e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>except OSError as e:</pre> <pre class=”line current”><span class=”ws”> </span>raise NewConnectionError(</pre> <pre class=”line after”><span class=”ws”> </span>self, f&#34;Failed to establish a new connection: {e}&#34;</pre> <pre class=”line after”><span class=”ws”> </span>) from e</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Audit hooks are only available in Python 3.8+</pre> <pre class=”line after”><span class=”ws”> </span>if _HAS_SYS_AUDIT:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706213840″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>486</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>timeout = TimeoutSauce(connect=timeout, read=timeout)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>resp = conn.urlopen(</pre> <pre class=”line after”><span class=”ws”> </span>method=request.method,</pre> <pre class=”line after”><span class=”ws”> </span>url=url,</pre> <pre class=”line after”><span class=”ws”> </span>body=request.body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=request.headers,</pre> <pre class=”line after”><span class=”ws”> </span>redirect=False,</pre></div> </div> <li><div class=”frame” id=”frame-2551706213952″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>844</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>) and (conn and conn.proxy and not conn.has_connected_to_proxy):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)</pre> <pre class=”line before”><span class=”ws”> </span>elif isinstance(new_e, (OSError, HTTPException)):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = ProtocolError(&#34;Connection aborted.&#34;, new_e)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>retries = retries.increment(</pre> <pre class=”line after”><span class=”ws”> </span>method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]</pre> <pre class=”line after”><span class=”ws”> </span>)</pre> <pre class=”line after”><span class=”ws”> </span>retries.sleep()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Keep track of the error for the retry warning.</pre></div> </div> <li><div class=”frame” id=”frame-2551706214064″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”</cite>, line <em class=”line”>515</em>, in <code class=”function”>increment</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>history=history,</pre> <pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if new_retry.is_exhausted():</pre> <pre class=”line before”><span class=”ws”> </span>reason = error or ResponseError(cause)</pre> <pre class=”line current”><span class=”ws”> </span>raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>log.debug(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, url, new_retry)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return new_retry</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div> <li><div class=”frame” id=”frame-2551706211040″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1478</em>, in <code class=”function”>__call__</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -&gt; t.Any:</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;The WSGI server calls the Flask application object as the</pre> <pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre> <pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div> </div> <li><div class=”frame” id=”frame-2551706211600″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1458</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line before”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line before”><span class=”ws”> </span>error = e</pre> <pre class=”line current”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”> </span>return response(environ, start_response)</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre></div> </div> <li><div class=”frame” id=”frame-2551706211488″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1455</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>ctx = self.request_context(environ)</pre> <pre class=”line before”><span class=”ws”> </span>error: BaseException | None = None</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line current”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>error = e</pre> <pre class=”line after”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre></div> </div> <li><div class=”frame” id=”frame-2551706211824″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>869</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre> <pre class=”line after”><span class=”ws”> </span>self,</pre> <pre class=”line after”><span class=”ws”> </span>rv: ft.ResponseReturnValue | HTTPException,</pre></div> </div> <li><div class=”frame” id=”frame-2551706211936″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>867</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre></div> </div> <li><div class=”frame” id=”frame-2551706212048″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>852</em>, in <code class=”function”>dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == &#34;OPTIONS&#34;</pre> <pre class=”line before”><span class=”ws”> </span>):</pre> <pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre> <pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre> <pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre> <pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -&gt; Response:</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Dispatches the request and on top of that performs request</pre> <pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre> <pre class=”line after”><span class=”ws”> </span>error handling.</pre></div> </div> <li><div class=”frame” id=”frame-2551706212160″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>322</em>, in <code class=”function”>get_new_content_api</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre> <pre class=”line before”><span class=”ws”> </span>content = request.args.get(&#39;content&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div> </div> <li><div class=”frame” id=”frame-2551706212272″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706212384″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706212496″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706212608″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>329</em>, in <code class=”function”>get_new_content</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre> <pre class=”line after”><span class=”ws”> </span>payload = {</pre> <pre class=”line after”><span class=”ws”> </span>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div> </div> <li><div class=”frame” id=”frame-2551706212832″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706212944″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706213056″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706213168″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>355</em>, in <code class=”function”>get_new_content_chatglm</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;functions&#34;: {},</pre> <pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</pre> <pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre> <pre class=”line current”><span class=”ws”> </span>response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)</pre> <pre class=”line after”><span class=”ws”> </span>#print(response)</pre> <pre class=”line after”><span class=”ws”> </span>data = response.json()</pre> <pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre> <pre class=”line after”><span class=”ws”> </span>new_content = data[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre> <pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706213280″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\api.py”</cite>, line <em class=”line”>59</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># By using the &#39;with&#39; statement we are sure the session is closed, thus we</pre> <pre class=”line before”><span class=”ws”> </span># avoid leaving sockets open which can trigger a ResourceWarning in some</pre> <pre class=”line before”><span class=”ws”> </span># cases, and look like a memory leak in others.</pre> <pre class=”line before”><span class=”ws”> </span>with sessions.Session() as session:</pre> <pre class=”line current”><span class=”ws”> </span>return session.request(method=method, url=url, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span>def get(url, params=None, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request.</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706213504″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>589</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>send_kwargs = {</pre> <pre class=”line before”><span class=”ws”> </span>&#34;timeout&#34;: timeout,</pre> <pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: allow_redirects,</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>send_kwargs.update(settings)</pre> <pre class=”line current”><span class=”ws”> </span>resp = self.send(prep, **send_kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return resp</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def get(self, url, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div> </div> <li><div class=”frame” id=”frame-2551706213616″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>703</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Start time (approximately) of the request</pre> <pre class=”line before”><span class=”ws”> </span>start = preferred_clock()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Send the request</pre> <pre class=”line current”><span class=”ws”> </span>r = adapter.send(request, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Total elapsed time of the request (approximately)</pre> <pre class=”line after”><span class=”ws”> </span>elapsed = preferred_clock() – start</pre> <pre class=”line after”><span class=”ws”> </span>r.elapsed = timedelta(seconds=elapsed)</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706213728″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>519</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if isinstance(e.reason, _SSLError):</pre> <pre class=”line before”><span class=”ws”> </span># This branch is for urllib3 v1.22 and later.</pre> <pre class=”line before”><span class=”ws”> </span>raise SSLError(e, request=request)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except ClosedPoolError as e:</pre> <pre class=”line after”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except _ProxyError as e:</pre></div> </div> </ul> <blockquote>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8B2520&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </blockquote> </div> <div class=”plain”> <p> This is the Copy/Paste friendly version of the traceback. </p> <textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn sock = connection.create_connection( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection raise err File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen response = self._make_request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request conn.request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request self.endheaders() File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output self.send(msg) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send self.connect() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect self.sock = self._new_conn() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000002521D8B2520&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send resp = conn.urlopen( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen retries = retries.increment( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8B2520&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__ return self.wsgi_app(environ, start_response) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app response = self.handle_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app response = self.full_dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request rv = self.dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request return session.request(method=method, url=url, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request resp = self.send(prep, **send_kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send r = adapter.send(request, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8B2520&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </textarea> </div> <div class=”explanation”> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. <span class=”nojavascript”> If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.</span> </div> <div class=”footer”> Brought to you by <strong class=”arthur”>DON’T PANIC</strong>, your friendly Werkzeug powered traceback interpreter. </div> </div> <div class=”pin-prompt”> <div class=”inner”> <h3>Console Locked</h3> <p> The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> <p>PIN: <input type=text name=pin size=14> <input type=submit name=btn value=”Confirm Pin”> </form> </div> </div> </body> </html> <!– Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 203, in _new_conn sock = connection.create_connection( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 85, in create_connection raise err File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 790, in urlopen response = self._make_request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 496, in _make_request conn.request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 395, in request self.endheaders() File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1040, in _send_output self.send(msg) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 980, in send self.connect() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 243, in connect self.sock = self._new_conn() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002521D8B2520>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 486, in send resp = conn.urlopen( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 844, in urlopen retries = retries.increment( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D8B2520>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1478, in __call__ return self.wsgi_app(environ, start_response) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1458, in wsgi_app response = self.handle_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1455, in wsgi_app response = self.full_dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 867, in full_dispatch_request rv = self.dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File “F:\project\wxgzh\model_server.py”, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 355, in get_new_content_chatglm response = requests.request(“POST”, chatglm_url, json=payload, headers=headers) File “F:\project\wxgzh\venv\lib\site-packages\requests\api.py”, line 59, in request return session.request(method=method, url=url, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 589, in request resp = self.send(prep, **send_kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 703, in send r = adapter.send(request, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D8B2520>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) –>

<!doctype html> <html lang=en> <head> <title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8D27C0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) // Werkzeug Debugger</title> <link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”> <link rel=”shortcut icon” href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”> <script src=”?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js”></script> <script> var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = “uImqR9BO9WQOrgY4YnuS”; </script> </head> <body style=”background-color: #fff”> <div class=”debugger”> <h1>ConnectionError</h1> <div class=”detail”> <p class=”errormsg”>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8D27C0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </p> </div> <h2 class=”traceback”>Traceback <em>(most recent call last)</em></h2> <div class=”traceback”> <h3></h3> <ul><li><div class=”frame” id=”frame-2551706392048″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>203</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;Establish a socket connection and set nodelay settings on it.</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>:return: New socket connection.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>sock = connection.create_connection(</pre> <pre class=”line after”><span class=”ws”> </span>(self._dns_host, self.port),</pre> <pre class=”line after”><span class=”ws”> </span>self.timeout,</pre> <pre class=”line after”><span class=”ws”> </span>source_address=self.source_address,</pre> <pre class=”line after”><span class=”ws”> </span>socket_options=self.socket_options,</pre> <pre class=”line after”><span class=”ws”> </span>)</pre></div> </div> <li><div class=”frame” id=”frame-2551706392160″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>85</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>if sock is not None:</pre> <pre class=”line before”><span class=”ws”> </span>sock.close()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if err is not None:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>raise err</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise OSError(&#34;getaddrinfo returns an empty list&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706392272″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if timeout is not _DEFAULT_TIMEOUT:</pre> <pre class=”line before”><span class=”ws”> </span>sock.settimeout(timeout)</pre> <pre class=”line before”><span class=”ws”> </span>if source_address:</pre> <pre class=”line before”><span class=”ws”> </span>sock.bind(source_address)</pre> <pre class=”line current”><span class=”ws”> </span>sock.connect(sa)</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>return sock</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except OSError as _:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706390928″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>790</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># it will also try to release it and we&#39;ll have a double-release</pre> <pre class=”line before”><span class=”ws”> </span># mess.</pre> <pre class=”line before”><span class=”ws”> </span>response_conn = conn if not release_conn else None</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Make the request on the HTTPConnection object</pre> <pre class=”line current”><span class=”ws”> </span>response = self._make_request(</pre> <pre class=”line after”><span class=”ws”> </span>conn,</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>timeout=timeout_obj,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre></div> </div> <li><div class=”frame” id=”frame-2551706391040″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>496</em>, in <code class=”function”>_make_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>raise new_e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># conn.request() calls http.client.*.request, not the method in</pre> <pre class=”line before”><span class=”ws”> </span># urllib3.request. It also calls makefile (recv) on the socket.</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>conn.request(</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=headers,</pre> <pre class=”line after”><span class=”ws”> </span>chunked=chunked,</pre></div> </div> <li><div class=”frame” id=”frame-2551706391152″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>395</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># Now that framing headers are out of the way we send all the other headers.</pre> <pre class=”line before”><span class=”ws”> </span>if &#34;user-agent&#34; not in header_keys:</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _get_default_user_agent())</pre> <pre class=”line before”><span class=”ws”> </span>for header, value in headers.items():</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(header, value)</pre> <pre class=”line current”><span class=”ws”> </span>self.endheaders()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re given a body we start sending that in chunks.</pre> <pre class=”line after”><span class=”ws”> </span>if chunks is not None:</pre> <pre class=”line after”><span class=”ws”> </span>for chunk in chunks:</pre> <pre class=”line after”><span class=”ws”> </span># Sending empty chunks isn&#39;t allowed for TE: chunked</pre></div> </div> <li><div class=”frame” id=”frame-2551706391264″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1280</em>, in <code class=”function”>endheaders</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>if self.__state == _CS_REQ_STARTED:</pre> <pre class=”line before”><span class=”ws”> </span>self.__state = _CS_REQ_SENT</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>raise CannotSendHeader()</pre> <pre class=”line current”><span class=”ws”> </span>self._send_output(message_body, encode_chunked=encode_chunked)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def request(self, method, url, body=None, headers={}, *,</pre> <pre class=”line after”><span class=”ws”> </span>encode_chunked=False):</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</pre> <pre class=”line after”><span class=”ws”> </span>self._send_request(method, url, body, headers, encode_chunked)</pre></div> </div> <li><div class=”frame” id=”frame-2551706391488″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1040</em>, in <code class=”function”>_send_output</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>A message_body may be specified, to be appended to the request.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre> <pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.join(self._buffer)</pre> <pre class=”line before”><span class=”ws”> </span>del self._buffer[:]</pre> <pre class=”line current”><span class=”ws”> </span>self.send(msg)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if message_body is not None:</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># create a consistent interface to message_body</pre> <pre class=”line after”><span class=”ws”> </span>if hasattr(message_body, &#39;read&#39;):</pre></div> </div> <li><div class=”frame” id=”frame-2551706391600″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>980</em>, in <code class=”function”>send</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>file-like object that supports a .read() method, or an iterable object.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if self.sock is None:</pre> <pre class=”line before”><span class=”ws”> </span>if self.auto_open:</pre> <pre class=”line current”><span class=”ws”> </span>self.connect()</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise NotConnected()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if self.debuglevel &gt; 0:</pre> <pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div> </div> <li><div class=”frame” id=”frame-2551706391712″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>243</em>, in <code class=”function”>connect</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”> </span>super().set_tunnel(host, port=port, headers=headers)</pre> <pre class=”line before”><span class=”ws”> </span>self._tunnel_scheme = scheme</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>def connect(self) -&gt; None:</pre> <pre class=”line current”><span class=”ws”> </span>self.sock = self._new_conn()</pre> <pre class=”line after”><span class=”ws”> </span>if self._tunnel_host:</pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re tunneling it means we&#39;re connected to our proxy.</pre> <pre class=”line after”><span class=”ws”> </span>self._has_connected_to_proxy = True</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># TODO: Fix tunnel so it doesn&#39;t depend on self.sock state.</pre></div> </div> <li><div class=”frame” id=”frame-2551706391824″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>218</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>self,</pre> <pre class=”line before”><span class=”ws”> </span>f&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</pre> <pre class=”line before”><span class=”ws”> </span>) from e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>except OSError as e:</pre> <pre class=”line current”><span class=”ws”> </span>raise NewConnectionError(</pre> <pre class=”line after”><span class=”ws”> </span>self, f&#34;Failed to establish a new connection: {e}&#34;</pre> <pre class=”line after”><span class=”ws”> </span>) from e</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Audit hooks are only available in Python 3.8+</pre> <pre class=”line after”><span class=”ws”> </span>if _HAS_SYS_AUDIT:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706341264″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>486</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>timeout = TimeoutSauce(connect=timeout, read=timeout)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>resp = conn.urlopen(</pre> <pre class=”line after”><span class=”ws”> </span>method=request.method,</pre> <pre class=”line after”><span class=”ws”> </span>url=url,</pre> <pre class=”line after”><span class=”ws”> </span>body=request.body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=request.headers,</pre> <pre class=”line after”><span class=”ws”> </span>redirect=False,</pre></div> </div> <li><div class=”frame” id=”frame-2551706390592″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>844</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>) and (conn and conn.proxy and not conn.has_connected_to_proxy):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)</pre> <pre class=”line before”><span class=”ws”> </span>elif isinstance(new_e, (OSError, HTTPException)):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = ProtocolError(&#34;Connection aborted.&#34;, new_e)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>retries = retries.increment(</pre> <pre class=”line after”><span class=”ws”> </span>method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]</pre> <pre class=”line after”><span class=”ws”> </span>)</pre> <pre class=”line after”><span class=”ws”> </span>retries.sleep()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Keep track of the error for the retry warning.</pre></div> </div> <li><div class=”frame” id=”frame-2551706390704″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”</cite>, line <em class=”line”>515</em>, in <code class=”function”>increment</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>history=history,</pre> <pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if new_retry.is_exhausted():</pre> <pre class=”line before”><span class=”ws”> </span>reason = error or ResponseError(cause)</pre> <pre class=”line current”><span class=”ws”> </span>raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>log.debug(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, url, new_retry)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return new_retry</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div> <li><div class=”frame” id=”frame-2551706339136″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1478</em>, in <code class=”function”>__call__</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -&gt; t.Any:</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;The WSGI server calls the Flask application object as the</pre> <pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre> <pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div> </div> <li><div class=”frame” id=”frame-2551706337344″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1458</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line before”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line before”><span class=”ws”> </span>error = e</pre> <pre class=”line current”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”> </span>return response(environ, start_response)</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre></div> </div> <li><div class=”frame” id=”frame-2551706339024″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1455</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>ctx = self.request_context(environ)</pre> <pre class=”line before”><span class=”ws”> </span>error: BaseException | None = None</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line current”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>error = e</pre> <pre class=”line after”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre></div> </div> <li><div class=”frame” id=”frame-2551706339248″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>869</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre> <pre class=”line after”><span class=”ws”> </span>self,</pre> <pre class=”line after”><span class=”ws”> </span>rv: ft.ResponseReturnValue | HTTPException,</pre></div> </div> <li><div class=”frame” id=”frame-2551706339360″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>867</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre></div> </div> <li><div class=”frame” id=”frame-2551706339472″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>852</em>, in <code class=”function”>dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == &#34;OPTIONS&#34;</pre> <pre class=”line before”><span class=”ws”> </span>):</pre> <pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre> <pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre> <pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre> <pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -&gt; Response:</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Dispatches the request and on top of that performs request</pre> <pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre> <pre class=”line after”><span class=”ws”> </span>error handling.</pre></div> </div> <li><div class=”frame” id=”frame-2551706339584″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>322</em>, in <code class=”function”>get_new_content_api</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre> <pre class=”line before”><span class=”ws”> </span>content = request.args.get(&#39;content&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div> </div> <li><div class=”frame” id=”frame-2551706339696″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706339808″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706339920″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706340032″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>329</em>, in <code class=”function”>get_new_content</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre> <pre class=”line after”><span class=”ws”> </span>payload = {</pre> <pre class=”line after”><span class=”ws”> </span>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div> </div> <li><div class=”frame” id=”frame-2551706340256″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706340368″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706340480″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706340592″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>355</em>, in <code class=”function”>get_new_content_chatglm</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;functions&#34;: {},</pre> <pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</pre> <pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre> <pre class=”line current”><span class=”ws”> </span>response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)</pre> <pre class=”line after”><span class=”ws”> </span>#print(response)</pre> <pre class=”line after”><span class=”ws”> </span>data = response.json()</pre> <pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre> <pre class=”line after”><span class=”ws”> </span>new_content = data[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre> <pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706340704″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\api.py”</cite>, line <em class=”line”>59</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># By using the &#39;with&#39; statement we are sure the session is closed, thus we</pre> <pre class=”line before”><span class=”ws”> </span># avoid leaving sockets open which can trigger a ResourceWarning in some</pre> <pre class=”line before”><span class=”ws”> </span># cases, and look like a memory leak in others.</pre> <pre class=”line before”><span class=”ws”> </span>with sessions.Session() as session:</pre> <pre class=”line current”><span class=”ws”> </span>return session.request(method=method, url=url, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span>def get(url, params=None, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request.</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706340928″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>589</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>send_kwargs = {</pre> <pre class=”line before”><span class=”ws”> </span>&#34;timeout&#34;: timeout,</pre> <pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: allow_redirects,</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>send_kwargs.update(settings)</pre> <pre class=”line current”><span class=”ws”> </span>resp = self.send(prep, **send_kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return resp</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def get(self, url, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div> </div> <li><div class=”frame” id=”frame-2551706341040″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>703</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Start time (approximately) of the request</pre> <pre class=”line before”><span class=”ws”> </span>start = preferred_clock()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Send the request</pre> <pre class=”line current”><span class=”ws”> </span>r = adapter.send(request, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Total elapsed time of the request (approximately)</pre> <pre class=”line after”><span class=”ws”> </span>elapsed = preferred_clock() – start</pre> <pre class=”line after”><span class=”ws”> </span>r.elapsed = timedelta(seconds=elapsed)</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706341152″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>519</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if isinstance(e.reason, _SSLError):</pre> <pre class=”line before”><span class=”ws”> </span># This branch is for urllib3 v1.22 and later.</pre> <pre class=”line before”><span class=”ws”> </span>raise SSLError(e, request=request)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except ClosedPoolError as e:</pre> <pre class=”line after”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except _ProxyError as e:</pre></div> </div> </ul> <blockquote>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8D27C0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </blockquote> </div> <div class=”plain”> <p> This is the Copy/Paste friendly version of the traceback. </p> <textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn sock = connection.create_connection( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection raise err File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen response = self._make_request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request conn.request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request self.endheaders() File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output self.send(msg) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send self.connect() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect self.sock = self._new_conn() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000002521D8D27C0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send resp = conn.urlopen( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen retries = retries.increment( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8D27C0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__ return self.wsgi_app(environ, start_response) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app response = self.handle_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app response = self.full_dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request rv = self.dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request return session.request(method=method, url=url, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request resp = self.send(prep, **send_kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send r = adapter.send(request, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8D27C0&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </textarea> </div> <div class=”explanation”> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. <span class=”nojavascript”> If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.</span> </div> <div class=”footer”> Brought to you by <strong class=”arthur”>DON’T PANIC</strong>, your friendly Werkzeug powered traceback interpreter. </div> </div> <div class=”pin-prompt”> <div class=”inner”> <h3>Console Locked</h3> <p> The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> <p>PIN: <input type=text name=pin size=14> <input type=submit name=btn value=”Confirm Pin”> </form> </div> </div> </body> </html> <!– Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 203, in _new_conn sock = connection.create_connection( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 85, in create_connection raise err File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 790, in urlopen response = self._make_request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 496, in _make_request conn.request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 395, in request self.endheaders() File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1040, in _send_output self.send(msg) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 980, in send self.connect() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 243, in connect self.sock = self._new_conn() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002521D8D27C0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 486, in send resp = conn.urlopen( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 844, in urlopen retries = retries.increment( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D8D27C0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1478, in __call__ return self.wsgi_app(environ, start_response) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1458, in wsgi_app response = self.handle_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1455, in wsgi_app response = self.full_dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 867, in full_dispatch_request rv = self.dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File “F:\project\wxgzh\model_server.py”, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 355, in get_new_content_chatglm response = requests.request(“POST”, chatglm_url, json=payload, headers=headers) File “F:\project\wxgzh\venv\lib\site-packages\requests\api.py”, line 59, in request return session.request(method=method, url=url, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 589, in request resp = self.send(prep, **send_kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 703, in send r = adapter.send(request, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D8D27C0>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) –>

此外,穆尔蒂还有另一个广为人知的身份,是英国首相苏纳克的岳父

关于ChatGPT可能会在未来取代人类的说法,穆尔蒂显然并不这么认为。他在接受采访时表示:

“ChatGPT是知识生成的一个很好补充,可以用来完成某些任务,比如写一篇文章……但我仍非常相信人类的大脑是最强大的想象力和机器。没有什么能打败人类的思想。”

<!doctype html> <html lang=en> <head> <title>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8EFA60&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) // Werkzeug Debugger</title> <link rel=”stylesheet” href=”?__debugger__=yes&amp;cmd=resource&amp;f=style.css”> <link rel=”shortcut icon” href=”?__debugger__=yes&amp;cmd=resource&amp;f=console.png”> <script src=”?__debugger__=yes&amp;cmd=resource&amp;f=debugger.js”></script> <script> var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = “uImqR9BO9WQOrgY4YnuS”; </script> </head> <body style=”background-color: #fff”> <div class=”debugger”> <h1>ConnectionError</h1> <div class=”detail”> <p class=”errormsg”>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8EFA60&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </p> </div> <h2 class=”traceback”>Traceback <em>(most recent call last)</em></h2> <div class=”traceback”> <h3></h3> <ul><li><div class=”frame” id=”frame-2551706527888″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>203</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;Establish a socket connection and set nodelay settings on it.</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>:return: New socket connection.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>sock = connection.create_connection(</pre> <pre class=”line after”><span class=”ws”> </span>(self._dns_host, self.port),</pre> <pre class=”line after”><span class=”ws”> </span>self.timeout,</pre> <pre class=”line after”><span class=”ws”> </span>source_address=self.source_address,</pre> <pre class=”line after”><span class=”ws”> </span>socket_options=self.socket_options,</pre> <pre class=”line after”><span class=”ws”> </span>)</pre></div> </div> <li><div class=”frame” id=”frame-2551706528000″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>85</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>if sock is not None:</pre> <pre class=”line before”><span class=”ws”> </span>sock.close()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if err is not None:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>raise err</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise OSError(&#34;getaddrinfo returns an empty list&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706528112″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>create_connection</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if timeout is not _DEFAULT_TIMEOUT:</pre> <pre class=”line before”><span class=”ws”> </span>sock.settimeout(timeout)</pre> <pre class=”line before”><span class=”ws”> </span>if source_address:</pre> <pre class=”line before”><span class=”ws”> </span>sock.bind(source_address)</pre> <pre class=”line current”><span class=”ws”> </span>sock.connect(sa)</pre> <pre class=”line after”><span class=”ws”> </span># Break explicitly a reference cycle</pre> <pre class=”line after”><span class=”ws”> </span>err = None</pre> <pre class=”line after”><span class=”ws”> </span>return sock</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except OSError as _:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706526768″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>790</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># it will also try to release it and we&#39;ll have a double-release</pre> <pre class=”line before”><span class=”ws”> </span># mess.</pre> <pre class=”line before”><span class=”ws”> </span>response_conn = conn if not release_conn else None</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Make the request on the HTTPConnection object</pre> <pre class=”line current”><span class=”ws”> </span>response = self._make_request(</pre> <pre class=”line after”><span class=”ws”> </span>conn,</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>timeout=timeout_obj,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre></div> </div> <li><div class=”frame” id=”frame-2551706526880″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>496</em>, in <code class=”function”>_make_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>raise new_e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># conn.request() calls http.client.*.request, not the method in</pre> <pre class=”line before”><span class=”ws”> </span># urllib3.request. It also calls makefile (recv) on the socket.</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>conn.request(</pre> <pre class=”line after”><span class=”ws”> </span>method,</pre> <pre class=”line after”><span class=”ws”> </span>url,</pre> <pre class=”line after”><span class=”ws”> </span>body=body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=headers,</pre> <pre class=”line after”><span class=”ws”> </span>chunked=chunked,</pre></div> </div> <li><div class=”frame” id=”frame-2551706526992″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>395</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span># Now that framing headers are out of the way we send all the other headers.</pre> <pre class=”line before”><span class=”ws”> </span>if &#34;user-agent&#34; not in header_keys:</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(&#34;User-Agent&#34;, _get_default_user_agent())</pre> <pre class=”line before”><span class=”ws”> </span>for header, value in headers.items():</pre> <pre class=”line before”><span class=”ws”> </span>self.putheader(header, value)</pre> <pre class=”line current”><span class=”ws”> </span>self.endheaders()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re given a body we start sending that in chunks.</pre> <pre class=”line after”><span class=”ws”> </span>if chunks is not None:</pre> <pre class=”line after”><span class=”ws”> </span>for chunk in chunks:</pre> <pre class=”line after”><span class=”ws”> </span># Sending empty chunks isn&#39;t allowed for TE: chunked</pre></div> </div> <li><div class=”frame” id=”frame-2551706527104″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1280</em>, in <code class=”function”>endheaders</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>if self.__state == _CS_REQ_STARTED:</pre> <pre class=”line before”><span class=”ws”> </span>self.__state = _CS_REQ_SENT</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>raise CannotSendHeader()</pre> <pre class=”line current”><span class=”ws”> </span>self._send_output(message_body, encode_chunked=encode_chunked)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def request(self, method, url, body=None, headers={}, *,</pre> <pre class=”line after”><span class=”ws”> </span>encode_chunked=False):</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Send a complete request to the server.&#34;&#34;&#34;</pre> <pre class=”line after”><span class=”ws”> </span>self._send_request(method, url, body, headers, encode_chunked)</pre></div> </div> <li><div class=”frame” id=”frame-2551706527328″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>1040</em>, in <code class=”function”>_send_output</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>A message_body may be specified, to be appended to the request.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>self._buffer.extend((b&#34;&#34;, b&#34;&#34;))</pre> <pre class=”line before”><span class=”ws”> </span>msg = b&#34;\r\n&#34;.join(self._buffer)</pre> <pre class=”line before”><span class=”ws”> </span>del self._buffer[:]</pre> <pre class=”line current”><span class=”ws”> </span>self.send(msg)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if message_body is not None:</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># create a consistent interface to message_body</pre> <pre class=”line after”><span class=”ws”> </span>if hasattr(message_body, &#39;read&#39;):</pre></div> </div> <li><div class=”frame” id=”frame-2551706527440″> <h4>File <cite class=”filename”>”C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”</cite>, line <em class=”line”>980</em>, in <code class=”function”>send</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>file-like object that supports a .read() method, or an iterable object.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if self.sock is None:</pre> <pre class=”line before”><span class=”ws”> </span>if self.auto_open:</pre> <pre class=”line current”><span class=”ws”> </span>self.connect()</pre> <pre class=”line after”><span class=”ws”> </span>else:</pre> <pre class=”line after”><span class=”ws”> </span>raise NotConnected()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>if self.debuglevel &gt; 0:</pre> <pre class=”line after”><span class=”ws”> </span>print(&#34;send:&#34;, repr(data))</pre></div> </div> <li><div class=”frame” id=”frame-2551706527552″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>243</em>, in <code class=”function”>connect</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”> </span>super().set_tunnel(host, port=port, headers=headers)</pre> <pre class=”line before”><span class=”ws”> </span>self._tunnel_scheme = scheme</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>def connect(self) -&gt; None:</pre> <pre class=”line current”><span class=”ws”> </span>self.sock = self._new_conn()</pre> <pre class=”line after”><span class=”ws”> </span>if self._tunnel_host:</pre> <pre class=”line after”><span class=”ws”> </span># If we&#39;re tunneling it means we&#39;re connected to our proxy.</pre> <pre class=”line after”><span class=”ws”> </span>self._has_connected_to_proxy = True</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># TODO: Fix tunnel so it doesn&#39;t depend on self.sock state.</pre></div> </div> <li><div class=”frame” id=”frame-2551706527664″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”</cite>, line <em class=”line”>218</em>, in <code class=”function”>_new_conn</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>self,</pre> <pre class=”line before”><span class=”ws”> </span>f&#34;Connection to {self.host} timed out. (connect timeout={self.timeout})&#34;,</pre> <pre class=”line before”><span class=”ws”> </span>) from e</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>except OSError as e:</pre> <pre class=”line current”><span class=”ws”> </span>raise NewConnectionError(</pre> <pre class=”line after”><span class=”ws”> </span>self, f&#34;Failed to establish a new connection: {e}&#34;</pre> <pre class=”line after”><span class=”ws”> </span>) from e</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Audit hooks are only available in Python 3.8+</pre> <pre class=”line after”><span class=”ws”> </span>if _HAS_SYS_AUDIT:</pre></div> </div> <li><div class=”exc-divider”>The above exception was the direct cause of the following exception:</div> <li><div class=”frame” id=”frame-2551706526320″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>486</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>pass</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>timeout = TimeoutSauce(connect=timeout, read=timeout)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>resp = conn.urlopen(</pre> <pre class=”line after”><span class=”ws”> </span>method=request.method,</pre> <pre class=”line after”><span class=”ws”> </span>url=url,</pre> <pre class=”line after”><span class=”ws”> </span>body=request.body,</pre> <pre class=”line after”><span class=”ws”> </span>headers=request.headers,</pre> <pre class=”line after”><span class=”ws”> </span>redirect=False,</pre></div> </div> <li><div class=”frame” id=”frame-2551706526432″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”</cite>, line <em class=”line”>844</em>, in <code class=”function”>urlopen</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>) and (conn and conn.proxy and not conn.has_connected_to_proxy):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = _wrap_proxy_error(new_e, conn.proxy.scheme)</pre> <pre class=”line before”><span class=”ws”> </span>elif isinstance(new_e, (OSError, HTTPException)):</pre> <pre class=”line before”><span class=”ws”> </span>new_e = ProtocolError(&#34;Connection aborted.&#34;, new_e)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>retries = retries.increment(</pre> <pre class=”line after”><span class=”ws”> </span>method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2]</pre> <pre class=”line after”><span class=”ws”> </span>)</pre> <pre class=”line after”><span class=”ws”> </span>retries.sleep()</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Keep track of the error for the retry warning.</pre></div> </div> <li><div class=”frame” id=”frame-2551706526544″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”</cite>, line <em class=”line”>515</em>, in <code class=”function”>increment</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>history=history,</pre> <pre class=”line before”><span class=”ws”> </span>)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if new_retry.is_exhausted():</pre> <pre class=”line before”><span class=”ws”> </span>reason = error or ResponseError(cause)</pre> <pre class=”line current”><span class=”ws”> </span>raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>log.debug(&#34;Incremented Retry for (url=&#39;%s&#39;): %r&#34;, url, new_retry)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return new_retry</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”exc-divider”>During handling of the above exception, another exception occurred:</div> <li><div class=”frame” id=”frame-2551706458368″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1478</em>, in <code class=”function”>__call__</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>def __call__(self, environ: dict, start_response: t.Callable) -&gt; t.Any:</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;The WSGI server calls the Flask application object as the</pre> <pre class=”line before”><span class=”ws”> </span>WSGI application. This calls :meth:`wsgi_app`, which can be</pre> <pre class=”line before”><span class=”ws”> </span>wrapped to apply middleware.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line current”><span class=”ws”> </span>return self.wsgi_app(environ, start_response)</pre></div> </div> <li><div class=”frame” id=”frame-2551706458592″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1458</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line before”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line before”><span class=”ws”> </span>error = e</pre> <pre class=”line current”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”> </span>return response(environ, start_response)</pre> <pre class=”line after”><span class=”ws”> </span>finally:</pre></div> </div> <li><div class=”frame” id=”frame-2551706458480″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>1455</em>, in <code class=”function”>wsgi_app</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>ctx = self.request_context(environ)</pre> <pre class=”line before”><span class=”ws”> </span>error: BaseException | None = None</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>ctx.push()</pre> <pre class=”line current”><span class=”ws”> </span>response = self.full_dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>error = e</pre> <pre class=”line after”><span class=”ws”> </span>response = self.handle_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>except: # noqa: B001</pre> <pre class=”line after”><span class=”ws”> </span>error = sys.exc_info()[1]</pre></div> </div> <li><div class=”frame” id=”frame-2551706458704″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>869</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line before”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre> <pre class=”line after”><span class=”ws”> </span>self,</pre> <pre class=”line after”><span class=”ws”> </span>rv: ft.ResponseReturnValue | HTTPException,</pre></div> </div> <li><div class=”frame” id=”frame-2551706458816″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>867</em>, in <code class=”function”>full_dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line before”><span class=”ws”> </span>request_started.send(self, _async_wrapper=self.ensure_sync)</pre> <pre class=”line before”><span class=”ws”> </span>rv = self.preprocess_request()</pre> <pre class=”line before”><span class=”ws”> </span>if rv is None:</pre> <pre class=”line current”><span class=”ws”> </span>rv = self.dispatch_request()</pre> <pre class=”line after”><span class=”ws”> </span>except Exception as e:</pre> <pre class=”line after”><span class=”ws”> </span>rv = self.handle_user_exception(e)</pre> <pre class=”line after”><span class=”ws”> </span>return self.finalize_request(rv)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def finalize_request(</pre></div> </div> <li><div class=”frame” id=”frame-2551706458928″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\flask\app.py”</cite>, line <em class=”line”>852</em>, in <code class=”function”>dispatch_request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>and req.method == &#34;OPTIONS&#34;</pre> <pre class=”line before”><span class=”ws”> </span>):</pre> <pre class=”line before”><span class=”ws”> </span>return self.make_default_options_response()</pre> <pre class=”line before”><span class=”ws”> </span># otherwise dispatch to the handler for that endpoint</pre> <pre class=”line before”><span class=”ws”> </span>view_args: dict[str, t.Any] = req.view_args # type: ignore[assignment]</pre> <pre class=”line current”><span class=”ws”> </span>return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def full_dispatch_request(self) -&gt; Response:</pre> <pre class=”line after”><span class=”ws”> </span>&#34;&#34;&#34;Dispatches the request and on top of that performs request</pre> <pre class=”line after”><span class=”ws”> </span>pre and postprocessing as well as HTTP exception catching and</pre> <pre class=”line after”><span class=”ws”> </span>error handling.</pre></div> </div> <li><div class=”frame” id=”frame-2551706459040″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>322</em>, in <code class=”function”>get_new_content_api</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>def get_new_content_api():</pre> <pre class=”line before”><span class=”ws”> </span>content = request.args.get(&#39;content&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>engine_type = request.args.get(&#39;engine_type&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_summary = request.args.get(&#39;need_summary&#39;)</pre> <pre class=”line before”><span class=”ws”> </span>need_keywords = request.args.get(&#39;need_keywords&#39;)</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line after”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line after”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre></div> </div> <li><div class=”frame” id=”frame-2551706459152″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706459264″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706459376″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706459488″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>329</em>, in <code class=”function”>get_new_content</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line before”><span class=”ws”></span>def get_new_content(engine_type,need_summary,need_keywords,init_content):</pre> <pre class=”line before”><span class=”ws”> </span>if engine_type == RewriteEnum.EngineType.WENXINYIYAN:</pre> <pre class=”line before”><span class=”ws”> </span>new_content = get_wp_post_wx_continue(need_summary,need_keywords ,init_content)</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line current”><span class=”ws”> </span>new_content = get_new_content_chatglm(init_content)</pre> <pre class=”line after”><span class=”ws”> </span>return new_content</pre> <pre class=”line after”><span class=”ws”></span>@retry(exceptions=ConnectionError,tries=tries,delay=1)</pre> <pre class=”line after”><span class=”ws”></span>def get_new_content_chatglm(content):</pre> <pre class=”line after”><span class=”ws”> </span>payload = {</pre> <pre class=”line after”><span class=”ws”> </span>&#34;model&#34;: &#34;chatglm3-6b&#34;,</pre></div> </div> <li><div class=”frame” id=”frame-2551706459712″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\decorator.py”</cite>, line <em class=”line”>232</em>, in <code class=”function”>fun</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>yield res</pre> <pre class=”line before”><span class=”ws”> </span>else:</pre> <pre class=”line before”><span class=”ws”> </span>def fun(*args, **kw):</pre> <pre class=”line before”><span class=”ws”> </span>if not kwsyntax:</pre> <pre class=”line before”><span class=”ws”> </span>args, kw = fix(args, kw, sig)</pre> <pre class=”line current”><span class=”ws”> </span>return caller(func, *(extras + args), **kw)</pre> <pre class=”line after”><span class=”ws”> </span>fun.__name__ = func.__name__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__doc__ = func.__doc__</pre> <pre class=”line after”><span class=”ws”> </span>fun.__wrapped__ = func</pre> <pre class=”line after”><span class=”ws”> </span>fun.__signature__ = sig</pre> <pre class=”line after”><span class=”ws”> </span>fun.__qualname__ = func.__qualname__</pre></div> </div> <li><div class=”frame” id=”frame-2551706459824″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>73</em>, in <code class=”function”>retry_decorator</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>@decorator</pre> <pre class=”line before”><span class=”ws”> </span>def retry_decorator(f, *fargs, **fkwargs):</pre> <pre class=”line before”><span class=”ws”> </span>args = fargs if fargs else list()</pre> <pre class=”line before”><span class=”ws”> </span>kwargs = fkwargs if fkwargs else dict()</pre> <pre class=”line current”><span class=”ws”> </span>return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,</pre> <pre class=”line after”><span class=”ws”> </span>logger)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return retry_decorator</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706459936″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\retry\api.py”</cite>, line <em class=”line”>33</em>, in <code class=”function”>__retry_internal</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>:returns: the result of the f function.</pre> <pre class=”line before”><span class=”ws”> </span>&#34;&#34;&#34;</pre> <pre class=”line before”><span class=”ws”> </span>_tries, _delay = tries, delay</pre> <pre class=”line before”><span class=”ws”> </span>while _tries:</pre> <pre class=”line before”><span class=”ws”> </span>try:</pre> <pre class=”line current”><span class=”ws”> </span>return f()</pre> <pre class=”line after”><span class=”ws”> </span>except exceptions as e:</pre> <pre class=”line after”><span class=”ws”> </span>_tries -= 1</pre> <pre class=”line after”><span class=”ws”> </span>if not _tries:</pre> <pre class=”line after”><span class=”ws”> </span>raise</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706460048″> <h4>File <cite class=”filename”>”F:\project\wxgzh\model_server.py”</cite>, line <em class=”line”>355</em>, in <code class=”function”>get_new_content_chatglm</code></h4> <div class=”source “><pre class=”line before”><span class=”ws”> </span>&#34;functions&#34;: {},</pre> <pre class=”line before”><span class=”ws”> </span>&#34;repetition_penalty&#34;: 1.1</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>headers = {&#34;content-type&#34;: &#34;application/json&#34;}</pre> <pre class=”line before”><span class=”ws”> </span>task_start_time = time.time()</pre> <pre class=”line current”><span class=”ws”> </span>response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers)</pre> <pre class=”line after”><span class=”ws”> </span>#print(response)</pre> <pre class=”line after”><span class=”ws”> </span>data = response.json()</pre> <pre class=”line after”><span class=”ws”> </span>print(json.dumps(data, indent=4))</pre> <pre class=”line after”><span class=”ws”> </span>new_content = data[&#39;choices&#39;][0][&#39;message&#39;][&#39;content&#39;]</pre> <pre class=”line after”><span class=”ws”> </span>new_content = new_content.replace(&#34;重新改写后:&#34;, &#34;&#34;).replace(&#34;&#34;, &#34;&#34;)</pre></div> </div> <li><div class=”frame” id=”frame-2551706525760″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\api.py”</cite>, line <em class=”line”>59</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># By using the &#39;with&#39; statement we are sure the session is closed, thus we</pre> <pre class=”line before”><span class=”ws”> </span># avoid leaving sockets open which can trigger a ResourceWarning in some</pre> <pre class=”line before”><span class=”ws”> </span># cases, and look like a memory leak in others.</pre> <pre class=”line before”><span class=”ws”> </span>with sessions.Session() as session:</pre> <pre class=”line current”><span class=”ws”> </span>return session.request(method=method, url=url, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”></span>def get(url, params=None, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request.</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706525984″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>589</em>, in <code class=”function”>request</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”> </span>send_kwargs = {</pre> <pre class=”line before”><span class=”ws”> </span>&#34;timeout&#34;: timeout,</pre> <pre class=”line before”><span class=”ws”> </span>&#34;allow_redirects&#34;: allow_redirects,</pre> <pre class=”line before”><span class=”ws”> </span>}</pre> <pre class=”line before”><span class=”ws”> </span>send_kwargs.update(settings)</pre> <pre class=”line current”><span class=”ws”> </span>resp = self.send(prep, **send_kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>return resp</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>def get(self, url, **kwargs):</pre> <pre class=”line after”><span class=”ws”> </span>r&#34;&#34;&#34;Sends a GET request. Returns :class:`Response` object.</pre></div> </div> <li><div class=”frame” id=”frame-2551706526096″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”</cite>, line <em class=”line”>703</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Start time (approximately) of the request</pre> <pre class=”line before”><span class=”ws”> </span>start = preferred_clock()</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span># Send the request</pre> <pre class=”line current”><span class=”ws”> </span>r = adapter.send(request, **kwargs)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span># Total elapsed time of the request (approximately)</pre> <pre class=”line after”><span class=”ws”> </span>elapsed = preferred_clock() – start</pre> <pre class=”line after”><span class=”ws”> </span>r.elapsed = timedelta(seconds=elapsed)</pre> <pre class=”line after”><span class=”ws”></span> </pre></div> </div> <li><div class=”frame” id=”frame-2551706526208″> <h4>File <cite class=”filename”>”F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”</cite>, line <em class=”line”>519</em>, in <code class=”function”>send</code></h4> <div class=”source library”><pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line before”><span class=”ws”> </span>if isinstance(e.reason, _SSLError):</pre> <pre class=”line before”><span class=”ws”> </span># This branch is for urllib3 v1.22 and later.</pre> <pre class=”line before”><span class=”ws”> </span>raise SSLError(e, request=request)</pre> <pre class=”line before”><span class=”ws”></span> </pre> <pre class=”line current”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except ClosedPoolError as e:</pre> <pre class=”line after”><span class=”ws”> </span>raise ConnectionError(e, request=request)</pre> <pre class=”line after”><span class=”ws”></span> </pre> <pre class=”line after”><span class=”ws”> </span>except _ProxyError as e:</pre></div> </div> </ul> <blockquote>requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8EFA60&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </blockquote> </div> <div class=”plain”> <p> This is the Copy/Paste friendly version of the traceback. </p> <textarea cols=”50″ rows=”10″ name=”code” readonly>Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 203, in _new_conn sock = connection.create_connection( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 85, in create_connection raise err File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py&#34;, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 790, in urlopen response = self._make_request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 496, in _make_request conn.request( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 395, in request self.endheaders() File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 1040, in _send_output self.send(msg) File &#34;C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py&#34;, line 980, in send self.connect() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 243, in connect self.sock = self._new_conn() File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py&#34;, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: &lt;urllib3.connection.HTTPConnection object at 0x000002521D8EFA60&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 486, in send resp = conn.urlopen( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py&#34;, line 844, in urlopen retries = retries.increment( File &#34;F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py&#34;, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8EFA60&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1478, in __call__ return self.wsgi_app(environ, start_response) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1458, in wsgi_app response = self.handle_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 1455, in wsgi_app response = self.full_dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 867, in full_dispatch_request rv = self.dispatch_request() File &#34;F:\project\wxgzh\venv\lib\site-packages\flask\app.py&#34;, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File &#34;F:\project\wxgzh\model_server.py&#34;, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File &#34;F:\project\wxgzh\venv\lib\site-packages\decorator.py&#34;, line 232, in fun return caller(func, *(extras + args), **kw) File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File &#34;F:\project\wxgzh\venv\lib\site-packages\retry\api.py&#34;, line 33, in __retry_internal return f() File &#34;F:\project\wxgzh\model_server.py&#34;, line 355, in get_new_content_chatglm response = requests.request(&#34;POST&#34;, chatglm_url, json=payload, headers=headers) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\api.py&#34;, line 59, in request return session.request(method=method, url=url, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 589, in request resp = self.send(prep, **send_kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py&#34;, line 703, in send r = adapter.send(request, **kwargs) File &#34;F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py&#34;, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=&#39;127.0.0.1&#39;, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(&#39;&lt;urllib3.connection.HTTPConnection object at 0x000002521D8EFA60&gt;: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。&#39;)) </textarea> </div> <div class=”explanation”> The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. <span class=”nojavascript”> If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.</span> </div> <div class=”footer”> Brought to you by <strong class=”arthur”>DON’T PANIC</strong>, your friendly Werkzeug powered traceback interpreter. </div> </div> <div class=”pin-prompt”> <div class=”inner”> <h3>Console Locked</h3> <p> The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server. <form> <p>PIN: <input type=text name=pin size=14> <input type=submit name=btn value=”Confirm Pin”> </form> </div> </div> </body> </html> <!– Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 203, in _new_conn sock = connection.create_connection( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 85, in create_connection raise err File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\connection.py”, line 73, in create_connection sock.connect(sa) ConnectionRefusedError: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 790, in urlopen response = self._make_request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 496, in _make_request conn.request( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 395, in request self.endheaders() File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1280, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 1040, in _send_output self.send(msg) File “C:\Users\Administrator\AppData\Local\Programs\Python\Python39\lib\http\client.py”, line 980, in send self.connect() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 243, in connect self.sock = self._new_conn() File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connection.py”, line 218, in _new_conn raise NewConnectionError( urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x000002521D8EFA60>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 The above exception was the direct cause of the following exception: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 486, in send resp = conn.urlopen( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\connectionpool.py”, line 844, in urlopen retries = retries.increment( File “F:\project\wxgzh\venv\lib\site-packages\urllib3\util\retry.py”, line 515, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D8EFA60>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) During handling of the above exception, another exception occurred: Traceback (most recent call last): File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1478, in __call__ return self.wsgi_app(environ, start_response) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1458, in wsgi_app response = self.handle_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 1455, in wsgi_app response = self.full_dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 869, in full_dispatch_request rv = self.handle_user_exception(e) File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 867, in full_dispatch_request rv = self.dispatch_request() File “F:\project\wxgzh\venv\lib\site-packages\flask\app.py”, line 852, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File “F:\project\wxgzh\model_server.py”, line 322, in get_new_content_api new_content = get_new_content(engine_type,need_summary,need_keywords,content) # 传递 len 参数,使用 30 作为长度 File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 329, in get_new_content new_content = get_new_content_chatglm(init_content) File “F:\project\wxgzh\venv\lib\site-packages\decorator.py”, line 232, in fun return caller(func, *(extras + args), **kw) File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 73, in retry_decorator return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, File “F:\project\wxgzh\venv\lib\site-packages\retry\api.py”, line 33, in __retry_internal return f() File “F:\project\wxgzh\model_server.py”, line 355, in get_new_content_chatglm response = requests.request(“POST”, chatglm_url, json=payload, headers=headers) File “F:\project\wxgzh\venv\lib\site-packages\requests\api.py”, line 59, in request return session.request(method=method, url=url, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 589, in request resp = self.send(prep, **send_kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\sessions.py”, line 703, in send r = adapter.send(request, **kwargs) File “F:\project\wxgzh\venv\lib\site-packages\requests\adapters.py”, line 519, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host=’127.0.0.1′, port=7861): Max retries exceeded with url: /v1/chat/completions (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x000002521D8EFA60>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’)) –>

他认为,人与人之间的区别在于人类的思维。这意味着,更聪明的人将能够更好地利用ChatGPT。

我们必须牢记,无论是您还是我,都有权访问相同的聊天系统。若在某种程度上存在竞争,您可以利用ChatGPT生成的内容作为您的起点,并在此基础上加入您个人的独特元素、智慧和调整。Murthy进一步解释道,到了那时候,教师们对您的认知将会远超对我这个人工智能助手的印象。

“懒惰的人会得C,只有聪明的人才会得A,”穆尔蒂说。“因此,我不太担心ChatGPT。”

Infosys,这家印度公司,于1999年3月在我国的纳斯达克交易所成功上市,成为首家在美国上市 Indian 公司。然而,它并没有停留在此,于2012年12月,Infosys 在纽约证券交易所进一步发展,再次实现了一次重要的上市历程。

值得注意的是,据报道,印度IT巨头Infosys也是OpenAI的早期投资者之一。早在2015年,Infosys便对OpenAI的ChatGPT项目进行了资金投入,联手其他投资者共同向ChatGPT提供了总额达10亿美元的捐款和贷款支持。

ChatGPTorHumanity?TheDebateContinues

AI时代,拥有个人微信机器人AI助手!AI时代不落人后!

免费ChatGPT问答,办公、写作、生活好得力助手!

搜索微信号AIGC666aigc999或上边扫码,即可拥有个人AI助手!