Cleanup the last few badly-named Frame types

This commit is contained in:
Moishe Lettvin
2024-03-28 12:36:24 -04:00
parent 22bbedec93
commit 27322108b7
26 changed files with 64 additions and 64 deletions

View File

@@ -14,7 +14,7 @@ from dailyai.pipeline.frames import (
SpriteFrame,
Frame,
LLMResponseEndFrame,
LLMMessagesQueueFrame,
LLMMessagesFrame,
AudioFrame,
PipelineStartedFrame,
)
@@ -129,7 +129,7 @@ async def main(room_url: str, token):
@transport.event_handler("on_first_other_participant_joined")
async def on_first_other_participant_joined(transport):
print(f"!!! in here, pipeline.source is {pipeline.source}")
await pipeline.queue_frames([LLMMessagesQueueFrame(messages)])
await pipeline.queue_frames([LLMMessagesFrame(messages)])
async def run_conversation():

View File

@@ -24,7 +24,7 @@ from dailyai.pipeline.aggregators import (
)
from dailyai.pipeline.frames import (
EndPipeFrame,
LLMMessagesQueueFrame,
LLMMessagesFrame,
Frame,
TextFrame,
LLMResponseEndFrame,
@@ -172,7 +172,7 @@ class StoryImageGenerator(FrameProcessor):
prompt = f"You are an illustrator for a children's story book. Here is the story so far:\n\n\"{' '.join(self._story[:-1])}\"\n\nGenerate a prompt for DALL-E to create an illustration for the next page. Here's the sentence for the next page:\n\n\"{self._story[-1:][0]}\"\n\n Your response should start with the phrase \"Children's book illustration of\"."
msgs = [{"role": "system", "content": prompt}]
image_prompt = ""
async for f in self._llm.process_frame(LLMMessagesQueueFrame(msgs)):
async for f in self._llm.process_frame(LLMMessagesFrame(msgs)):
if isinstance(f, TextFrame):
image_prompt += f.text
async for f in self._img.process_frame(TextFrame(image_prompt)):
@@ -253,7 +253,7 @@ async def main(room_url: str, token):
await local_pipeline.queue_frames(
[
ImageFrame(None, images["grandma-listening.png"]),
LLMMessagesQueueFrame(intro_messages),
LLMMessagesFrame(intro_messages),
AudioFrame(sounds["listening.wav"]),
EndPipeFrame(),
]

View File

@@ -7,7 +7,7 @@ from typing import AsyncGenerator
from dailyai.pipeline.aggregators import (
SentenceAggregator,
)
from dailyai.pipeline.frames import Frame, LLMMessagesQueueFrame, TextFrame
from dailyai.pipeline.frames import Frame, LLMMessagesFrame, TextFrame
from dailyai.pipeline.frame_processor import FrameProcessor
from dailyai.pipeline.pipeline import Pipeline
from dailyai.transports.daily_transport import DailyTransport
@@ -44,7 +44,7 @@ class TranslationProcessor(FrameProcessor):
},
{"role": "user", "content": frame.text},
]
yield LLMMessagesQueueFrame(context)
yield LLMMessagesFrame(context)
else:
yield frame