Fix final ruff linting issues
- Remove duplicate import in __init__.py - Clean up extra blank lines in gemini.py - Remove extra blank line in _create_single_response method
This commit is contained in:
@@ -1,3 +1,2 @@
|
|||||||
from .file_api import GeminiFileAPI
|
from .file_api import GeminiFileAPI
|
||||||
from .gemini import GeminiMultimodalLiveLLMService
|
from .gemini import GeminiMultimodalLiveLLMService
|
||||||
from .file_api import GeminiFileAPI
|
|
||||||
|
|||||||
@@ -497,6 +497,7 @@ def parse_server_event(str):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error parsing server event: {e}")
|
print(f"Error parsing server event: {e}")
|
||||||
|
|
||||||
|
|
||||||
class ContextWindowCompressionConfig(BaseModel):
|
class ContextWindowCompressionConfig(BaseModel):
|
||||||
"""Configuration for context window compression.
|
"""Configuration for context window compression.
|
||||||
|
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ from pipecat.processors.aggregators.openai_llm_context import (
|
|||||||
from pipecat.processors.frame_processor import FrameDirection
|
from pipecat.processors.frame_processor import FrameDirection
|
||||||
from pipecat.services.google.frames import LLMSearchOrigin, LLMSearchResponseFrame, LLMSearchResult
|
from pipecat.services.google.frames import LLMSearchOrigin, LLMSearchResponseFrame, LLMSearchResult
|
||||||
from pipecat.services.llm_service import FunctionCallFromLLM, LLMService
|
from pipecat.services.llm_service import FunctionCallFromLLM, LLMService
|
||||||
|
|
||||||
|
|
||||||
from pipecat.services.openai.llm import (
|
from pipecat.services.openai.llm import (
|
||||||
OpenAIAssistantContextAggregator,
|
OpenAIAssistantContextAggregator,
|
||||||
OpenAIUserContextAggregator,
|
OpenAIUserContextAggregator,
|
||||||
@@ -74,11 +72,9 @@ from pipecat.utils.time import time_now_iso8601
|
|||||||
from pipecat.utils.tracing.service_decorators import traced_gemini_live, traced_stt
|
from pipecat.utils.tracing.service_decorators import traced_gemini_live, traced_stt
|
||||||
|
|
||||||
from . import events
|
from . import events
|
||||||
|
|
||||||
from .audio_transcriber import AudioTranscriber
|
from .audio_transcriber import AudioTranscriber
|
||||||
from .file_api import GeminiFileAPI
|
from .file_api import GeminiFileAPI
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import websockets
|
import websockets
|
||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
@@ -1025,7 +1021,6 @@ class GeminiMultimodalLiveLLMService(LLMService):
|
|||||||
|
|
||||||
async def _create_single_response(self, messages_list):
|
async def _create_single_response(self, messages_list):
|
||||||
"""Create a single response from a list of messages."""
|
"""Create a single response from a list of messages."""
|
||||||
|
|
||||||
# Refactor to combine this logic with same logic in GeminiMultimodalLiveContext
|
# Refactor to combine this logic with same logic in GeminiMultimodalLiveContext
|
||||||
messages = []
|
messages = []
|
||||||
for item in messages_list:
|
for item in messages_list:
|
||||||
@@ -1202,7 +1197,6 @@ class GeminiMultimodalLiveLLMService(LLMService):
|
|||||||
self._bot_text_buffer = ""
|
self._bot_text_buffer = ""
|
||||||
self._llm_output_buffer = ""
|
self._llm_output_buffer = ""
|
||||||
|
|
||||||
|
|
||||||
# Process grounding metadata if we have accumulated any
|
# Process grounding metadata if we have accumulated any
|
||||||
if self._accumulated_grounding_metadata:
|
if self._accumulated_grounding_metadata:
|
||||||
await self._process_grounding_metadata(
|
await self._process_grounding_metadata(
|
||||||
@@ -1295,7 +1289,6 @@ class GeminiMultimodalLiveLLMService(LLMService):
|
|||||||
# Collect text for tracing
|
# Collect text for tracing
|
||||||
self._llm_output_buffer += text
|
self._llm_output_buffer += text
|
||||||
|
|
||||||
|
|
||||||
await self.push_frame(LLMTextFrame(text=text))
|
await self.push_frame(LLMTextFrame(text=text))
|
||||||
await self.push_frame(TTSTextFrame(text=text))
|
await self.push_frame(TTSTextFrame(text=text))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user