Skip to content

Commit 5009a28

Browse files
authored
fix: tti model (#2060)
1 parent 7ac65aa commit 5009a28

File tree

24 files changed

+47
-55
lines changed

24 files changed

+47
-55
lines changed

apps/setting/models_provider/impl/aliyun_bai_lian_model_provider/model/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: UTF-8 -*-
3-
from typing import List, Dict
3+
from typing import Dict
44

55
from setting.models_provider.base_model_provider import MaxKBBaseModel
66
from setting.models_provider.impl.base_chat_open_ai import BaseChatOpenAI

apps/setting/models_provider/impl/aws_bedrock_model_provider/model/llm.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
from typing import List, Dict
21
import os
32
import re
3+
from typing import Dict
4+
45
from botocore.config import Config
56
from langchain_community.chat_models import BedrockChat
7+
68
from setting.models_provider.base_model_provider import MaxKBBaseModel
79

810

apps/setting/models_provider/impl/azure_model_provider/model/azure_chat_model.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
@desc:
88
"""
99

10-
from typing import List, Dict, Optional, Any, Iterator, Type
10+
from typing import List, Dict
1111

12-
from langchain_core.callbacks import CallbackManagerForLLMRun
13-
from langchain_core.messages import BaseMessage, get_buffer_string, BaseMessageChunk, AIMessageChunk
14-
from langchain_core.outputs import ChatGenerationChunk
12+
from langchain_core.messages import BaseMessage, get_buffer_string
1513
from langchain_openai import AzureChatOpenAI
16-
from langchain_openai.chat_models.base import _convert_delta_to_message_chunk
1714

1815
from common.config.tokenizer_manage_config import TokenizerManage
1916
from setting.models_provider.base_model_provider import MaxKBBaseModel

apps/setting/models_provider/impl/azure_model_provider/model/stt.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import asyncio
21
import io
32
from typing import Dict
43

5-
from openai import OpenAI, AzureOpenAI
4+
from openai import AzureOpenAI
65

76
from common.config.tokenizer_manage_config import TokenizerManage
87
from setting.models_provider.base_model_provider import MaxKBBaseModel
@@ -61,4 +60,3 @@ def speech_to_text(self, audio_file):
6160
buffer.name = "file.mp3" # this is the important line
6261
res = client.audio.transcriptions.create(model=self.model, language="zh", file=buffer)
6362
return res.text
64-

apps/setting/models_provider/impl/base_chat_open_ai.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# coding=utf-8
22

3-
from typing import List, Dict, Optional, Any, Iterator, Type, cast
3+
from typing import List, Dict, Optional, Any, Iterator, cast
4+
45
from langchain_core.language_models import LanguageModelInput
56
from langchain_core.messages import BaseMessage, get_buffer_string
67
from langchain_core.outputs import ChatGenerationChunk, ChatGeneration

apps/setting/models_provider/impl/deepseek_model_provider/model/llm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@Author :Brian Yang
77
@Date :5/12/24 7:44 AM
88
"""
9-
from typing import List, Dict
9+
from typing import Dict
1010

1111
from setting.models_provider.base_model_provider import MaxKBBaseModel
1212
from setting.models_provider.impl.base_chat_open_ai import BaseChatOpenAI
@@ -29,4 +29,3 @@ def new_instance(model_type, model_name, model_credential: Dict[str, object], **
2929
**optional_params
3030
)
3131
return deepseek_chat_open_ai
32-

apps/setting/models_provider/impl/gemini_model_provider/model/llm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
from google.ai.generativelanguage_v1 import GenerateContentResponse
1212
from google.generativeai.responder import ToolDict
1313
from google.generativeai.types import FunctionDeclarationType, SafetySettingDict
14+
from google.generativeai.types import Tool as GoogleTool
1415
from langchain_core.callbacks import CallbackManagerForLLMRun
15-
from langchain_core.messages import BaseMessage, get_buffer_string
16+
from langchain_core.messages import BaseMessage
1617
from langchain_core.outputs import ChatGenerationChunk
1718
from langchain_google_genai import ChatGoogleGenerativeAI
1819
from langchain_google_genai._function_utils import _ToolConfigDict
1920
from langchain_google_genai.chat_models import _chat_with_retry, _response_to_result
20-
from google.generativeai.types import Tool as GoogleTool
21-
from common.config.tokenizer_manage_config import TokenizerManage
21+
2222
from setting.models_provider.base_model_provider import MaxKBBaseModel
2323

2424

apps/setting/models_provider/impl/kimi_model_provider/model/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
@date:2023/11/10 17:45
77
@desc:
88
"""
9-
from typing import List, Dict
9+
from typing import Dict
1010

1111
from setting.models_provider.base_model_provider import MaxKBBaseModel
1212
from setting.models_provider.impl.base_chat_open_ai import BaseChatOpenAI

apps/setting/models_provider/impl/openai_model_provider/model/llm.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
@date:2024/4/18 15:28
77
@desc:
88
"""
9-
from typing import List, Dict, Optional, Any
9+
from typing import List, Dict
1010

11-
from langchain_core.language_models import LanguageModelInput
1211
from langchain_core.messages import BaseMessage, get_buffer_string
13-
from langchain_core.runnables import RunnableConfig
1412
from langchain_openai.chat_models import ChatOpenAI
1513

1614
from common.config.tokenizer_manage_config import TokenizerManage

apps/setting/models_provider/impl/qwen_model_provider/model/llm.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@
1212
from langchain_community.llms.tongyi import generate_with_last_element_mark
1313
from langchain_core.callbacks import CallbackManagerForLLMRun
1414
from langchain_core.language_models import LanguageModelInput
15-
from langchain_core.messages import BaseMessage, get_buffer_string
15+
from langchain_core.messages import BaseMessage
1616
from langchain_core.outputs import ChatGenerationChunk, ChatGeneration
1717
from langchain_core.runnables import RunnableConfig, ensure_config
1818

19-
from common.config.tokenizer_manage_config import TokenizerManage
2019
from setting.models_provider.base_model_provider import MaxKBBaseModel
2120

2221

0 commit comments

Comments
 (0)