mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-11-14 09:01:45 +00:00
docs(pipecat): update context aggregator example
This commit is contained in:
parent
4a5804f5a5
commit
a9b23e0603
1 changed files with 6 additions and 6 deletions
|
|
@ -147,11 +147,11 @@ from fastapi import FastAPI, WebSocket
|
|||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from pipecat.audio.vad.silero import SileroVADAnalyzer
|
||||
from pipecat.frames.frames import LLMMessagesFrame
|
||||
from pipecat.pipeline.pipeline import Pipeline
|
||||
from pipecat.pipeline.runner import PipelineRunner
|
||||
from pipecat.pipeline.task import PipelineParams, PipelineTask
|
||||
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext
|
||||
from pipecat.pipeline.task import PipelineTask
|
||||
from pipecat.processors.aggregators.llm_context import LLMContext
|
||||
from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair
|
||||
from pipecat.serializers.protobuf import ProtobufFrameSerializer
|
||||
from pipecat.services.openai.llm import OpenAILLMService
|
||||
from pipecat.services.openai.tts import OpenAITTSService
|
||||
|
|
@ -198,8 +198,8 @@ async def run_bot(websocket_client, user_id: str, session_id: str):
|
|||
),
|
||||
)
|
||||
|
||||
context = OpenAILLMContext([{"role": "system", "content": SYSTEM_PROMPT}])
|
||||
context_aggregator = llm.create_context_aggregator(context)
|
||||
context = LLMContext([{"role": "system", "content": SYSTEM_PROMPT}])
|
||||
context_aggregator = LLMContextAggregatorPair(context)
|
||||
|
||||
pipeline = Pipeline([
|
||||
transport.input(),
|
||||
|
|
@ -212,7 +212,7 @@ async def run_bot(websocket_client, user_id: str, session_id: str):
|
|||
context_aggregator.assistant(),
|
||||
])
|
||||
|
||||
task = PipelineTask(pipeline, params=PipelineParams(allow_interruptions=True))
|
||||
task = PipelineTask(pipeline)
|
||||
|
||||
@transport.event_handler("on_client_disconnected")
|
||||
async def on_client_disconnected(transport, client):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue