LLM-Geo icon indicating copy to clipboard operation
LLM-Geo copied to clipboard

如何在 jupyter notebook 中设置代理呢?貌似在国内不能直接使用OpenAI API

Open LYCnight opened this issue 4 months ago • 2 comments

文件

LLM_Geo_API4.ipynb

运行结果

response_for_graph = solution.get_LLM_response_for_graph() solution.graph_response = response_for_graph solution.save_solution()

clear_output(wait=True) display(Code(solution.code_for_graph, language='python'))


Error in get_LLM_reply(), will sleep 10 seconds, then retry 1/3: Request timed out. Error in get_LLM_reply(), will sleep 10 seconds, then retry 2/3: Request timed out. Error in get_LLM_reply(), will sleep 10 seconds, then retry 3/3: Request timed out.

UnboundLocalError Traceback (most recent call last) Cell In[6], line 1 ----> 1 response_for_graph = solution.get_LLM_response_for_graph() 2 solution.graph_response = response_for_graph 3 solution.save_solution()

File /data/AI4E/lzd/ToolCall/LLM-Geo/LLM_Geo_kernel.py:152, in Solution.get_LLM_response_for_graph(self, execuate) 150 def get_LLM_response_for_graph(self, execuate=True): 151 # self.chat_history.append() --> 152 response = self.get_LLM_reply( 153 prompt=self.graph_prompt, 154 system_role=self.role, 155 model=self.model, 156 ) 157 self.graph_response = response 158 try:

File /data/AI4E/lzd/ToolCall/LLM-Geo/LLM_Geo_kernel.py:129, in Solution.get_LLM_reply(self, prompt, verbose, temperature, stream, retry_cnt, sleep_sec, system_role, model) 127 response_chucks = [] 128 if stream: --> 129 for chunk in response: 130 response_chucks.append(chunk) 131 content = chunk.choices[0].delta.content

UnboundLocalError: local variable 'response' referenced before assignment

LYCnight avatar Sep 28 '24 07:09 LYCnight