fix: type (#67)
This commit is contained in:
parent
3afdab8acf
commit
c96442d6aa
@ -84,7 +84,7 @@ class BaseChatStep(IChatStep):
|
|||||||
post_response_handler: PostResponseHandler,
|
post_response_handler: PostResponseHandler,
|
||||||
chat_model: BaseChatModel = None,
|
chat_model: BaseChatModel = None,
|
||||||
paragraph_list=None,
|
paragraph_list=None,
|
||||||
manage: = None,
|
manage: PipelineManage = None,
|
||||||
padding_problem_text: str = None,
|
padding_problem_text: str = None,
|
||||||
stream: bool = True,
|
stream: bool = True,
|
||||||
client_id=None, client_type=None,
|
client_id=None, client_type=None,
|
||||||
@ -125,7 +125,7 @@ class BaseChatStep(IChatStep):
|
|||||||
post_response_handler: PostResponseHandler,
|
post_response_handler: PostResponseHandler,
|
||||||
chat_model: BaseChatModel = None,
|
chat_model: BaseChatModel = None,
|
||||||
paragraph_list=None,
|
paragraph_list=None,
|
||||||
manage: = None,
|
manage: PipelineManage = None,
|
||||||
padding_problem_text: str = None,
|
padding_problem_text: str = None,
|
||||||
client_id=None, client_type=None):
|
client_id=None, client_type=None):
|
||||||
# 调用模型
|
# 调用模型
|
||||||
@ -151,7 +151,7 @@ class BaseChatStep(IChatStep):
|
|||||||
post_response_handler: PostResponseHandler,
|
post_response_handler: PostResponseHandler,
|
||||||
chat_model: BaseChatModel = None,
|
chat_model: BaseChatModel = None,
|
||||||
paragraph_list=None,
|
paragraph_list=None,
|
||||||
manage: = None,
|
manage: PipelineManage = None,
|
||||||
padding_problem_text: str = None,
|
padding_problem_text: str = None,
|
||||||
client_id=None, client_type=None):
|
client_id=None, client_type=None):
|
||||||
# 调用模型
|
# 调用模型
|
||||||
|
|||||||
@ -15,7 +15,7 @@ from django.db.models import QuerySet
|
|||||||
from langchain.chat_models.base import BaseChatModel
|
from langchain.chat_models.base import BaseChatModel
|
||||||
from rest_framework import serializers
|
from rest_framework import serializers
|
||||||
|
|
||||||
from application.chat_pipeline.pipeline_manage import PiplineManage
|
from application.chat_pipeline.pipeline_manage import PipelineManage
|
||||||
from application.chat_pipeline.step.chat_step.i_chat_step import PostResponseHandler
|
from application.chat_pipeline.step.chat_step.i_chat_step import PostResponseHandler
|
||||||
from application.chat_pipeline.step.chat_step.impl.base_chat_step import BaseChatStep
|
from application.chat_pipeline.step.chat_step.impl.base_chat_step import BaseChatStep
|
||||||
from application.chat_pipeline.step.generate_human_message_step.impl.base_generate_human_message_step import \
|
from application.chat_pipeline.step.generate_human_message_step.impl.base_generate_human_message_step import \
|
||||||
@ -108,7 +108,7 @@ def get_post_handler(chat_info: ChatInfo):
|
|||||||
paragraph_list: List[Paragraph],
|
paragraph_list: List[Paragraph],
|
||||||
problem_text: str,
|
problem_text: str,
|
||||||
answer_text,
|
answer_text,
|
||||||
manage: PiplineManage,
|
manage: PipelineManage,
|
||||||
step: BaseChatStep,
|
step: BaseChatStep,
|
||||||
padding_problem_text: str = None,
|
padding_problem_text: str = None,
|
||||||
client_id=None,
|
client_id=None,
|
||||||
@ -178,7 +178,7 @@ class ChatMessageSerializer(serializers.Serializer):
|
|||||||
client_id = self.data.get('client_id')
|
client_id = self.data.get('client_id')
|
||||||
client_type = self.data.get('client_type')
|
client_type = self.data.get('client_type')
|
||||||
chat_info = self.is_valid(raise_exception=True)
|
chat_info = self.is_valid(raise_exception=True)
|
||||||
pipline_manage_builder = PiplineManage.builder()
|
pipline_manage_builder = PipelineManage.builder()
|
||||||
# 如果开启了问题优化,则添加上问题优化步骤
|
# 如果开启了问题优化,则添加上问题优化步骤
|
||||||
if chat_info.application.problem_optimization:
|
if chat_info.application.problem_optimization:
|
||||||
pipline_manage_builder.append_step(BaseResetProblemStep)
|
pipline_manage_builder.append_step(BaseResetProblemStep)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user