Tuchuanhuhuhu commited on
Commit
ed2aa75
·
1 Parent(s): 4799527

chore: 川虎助理适配最新版本的openai和langchain

Browse files
modules/models/ChuanhuAgent.py CHANGED
@@ -13,7 +13,7 @@ from langchain.docstore.document import Document
13
  from langchain.tools import BaseTool, StructuredTool, Tool, tool
14
  from langchain.callbacks.stdout import StdOutCallbackHandler
15
  from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
16
- from langchain.callbacks.manager import BaseCallbackManager
17
  from duckduckgo_search import DDGS
18
  from itertools import islice
19
 
 
13
  from langchain.tools import BaseTool, StructuredTool, Tool, tool
14
  from langchain.callbacks.stdout import StdOutCallbackHandler
15
  from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
16
+ from langchain.callbacks.base import BaseCallbackManager
17
  from duckduckgo_search import DDGS
18
  from itertools import islice
19
 
modules/models/base_model.py CHANGED
@@ -21,7 +21,7 @@ import aiohttp
21
  from enum import Enum
22
 
23
  from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
24
- from langchain.callbacks.manager import BaseCallbackManager
25
 
26
  from typing import Any, Dict, List, Optional, Union
27
 
 
21
  from enum import Enum
22
 
23
  from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
24
+ from langchain.callbacks.base import BaseCallbackManager
25
 
26
  from typing import Any, Dict, List, Optional, Union
27
 
modules/utils.py CHANGED
@@ -385,6 +385,7 @@ def save_file(filename, model, chatbot):
385
  "system": system,
386
  "history": history,
387
  "chatbot": chatbot,
 
388
  "single_turn": model.single_turn,
389
  "temperature": model.temperature,
390
  "top_p": model.top_p,
 
385
  "system": system,
386
  "history": history,
387
  "chatbot": chatbot,
388
+ "model_name": model.model_name,
389
  "single_turn": model.single_turn,
390
  "temperature": model.temperature,
391
  "top_p": model.top_p,
requirements.txt CHANGED
@@ -8,7 +8,8 @@ tqdm
8
  colorama
9
  googlesearch-python
10
  Pygments
11
- langchain==0.0.316
 
12
  markdown
13
  PyPDF2
14
  pdfplumber
@@ -22,14 +23,13 @@ duckduckgo-search>=3.9.5
22
  arxiv
23
  wikipedia
24
  google.generativeai
25
- openai==0.28.1
26
  unstructured
27
  google-api-python-client
28
  tabulate
29
  ujson
30
  python-docx
31
  websocket_client
32
- pydantic==1.10.8
33
  google-search-results
34
  anthropic==0.3.11
35
  Pillow>=10.1.0
 
8
  colorama
9
  googlesearch-python
10
  Pygments
11
+ openai==1.3.7
12
+ langchain==0.0.345
13
  markdown
14
  PyPDF2
15
  pdfplumber
 
23
  arxiv
24
  wikipedia
25
  google.generativeai
 
26
  unstructured
27
  google-api-python-client
28
  tabulate
29
  ujson
30
  python-docx
31
  websocket_client
32
+ pydantic==2.5.2
33
  google-search-results
34
  anthropic==0.3.11
35
  Pillow>=10.1.0