Merge pull request #2727 from pipecat-ai/pk/strands-agents-needs-to-support-openaillmcontextframe-for-now
`StrandsAgentsProcessor` should still support `OpenAILLMContextFrame`…
This commit is contained in:
@@ -16,6 +16,7 @@ from pipecat.frames.frames import (
|
|||||||
LLMTextFrame,
|
LLMTextFrame,
|
||||||
)
|
)
|
||||||
from pipecat.metrics.metrics import LLMTokenUsage
|
from pipecat.metrics.metrics import LLMTokenUsage
|
||||||
|
from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContextFrame
|
||||||
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
|
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -71,7 +72,7 @@ class StrandsAgentsProcessor(FrameProcessor):
|
|||||||
direction: The direction of frame flow in the pipeline.
|
direction: The direction of frame flow in the pipeline.
|
||||||
"""
|
"""
|
||||||
await super().process_frame(frame, direction)
|
await super().process_frame(frame, direction)
|
||||||
if isinstance(frame, LLMContextFrame):
|
if isinstance(frame, (LLMContextFrame, OpenAILLMContextFrame)):
|
||||||
messages = frame.context.get_messages()
|
messages = frame.context.get_messages()
|
||||||
if messages:
|
if messages:
|
||||||
last_message = messages[-1]
|
last_message = messages[-1]
|
||||||
|
|||||||
Reference in New Issue
Block a user