Add support for prefix state code
This commit is contained in:
@@ -37,6 +37,7 @@ from .config import EngineConfig
|
||||
from .context_sync import AssistantContextSyncProcessor
|
||||
from .fastgpt_llm import FastGPTLLMService
|
||||
from .product_protocol import ProductWebsocketSerializer
|
||||
from .response_state import StateTagResponseProcessor
|
||||
from .services import create_llm_service, create_stt_service, create_tts_service
|
||||
from .text_input import ProductTextInputProcessor
|
||||
from .text_stream import ProductTextStreamProcessor, maybe_sync_assistant_context
|
||||
@@ -153,21 +154,26 @@ async def run_pipeline_with_serializer(
|
||||
assistant_aggregator=assistant_aggregator,
|
||||
)
|
||||
|
||||
pipeline = Pipeline(
|
||||
processors = [
|
||||
transport.input(),
|
||||
ProductTextInputProcessor(),
|
||||
stt,
|
||||
ProductTranscriptStreamProcessor(),
|
||||
context_sync,
|
||||
user_aggregator,
|
||||
llm,
|
||||
]
|
||||
if config.agent.response_state.enabled:
|
||||
processors.append(StateTagResponseProcessor(config.agent.response_state))
|
||||
processors.extend(
|
||||
[
|
||||
transport.input(),
|
||||
ProductTextInputProcessor(),
|
||||
stt,
|
||||
ProductTranscriptStreamProcessor(),
|
||||
context_sync,
|
||||
user_aggregator,
|
||||
llm,
|
||||
text_stream,
|
||||
tts,
|
||||
transport.output(),
|
||||
assistant_aggregator,
|
||||
]
|
||||
)
|
||||
pipeline = Pipeline(processors)
|
||||
|
||||
task = PipelineTask(
|
||||
pipeline,
|
||||
|
||||
Reference in New Issue
Block a user