adding GoogleLLMOpenAIBetaService

This commit is contained in:
Vaibhav159
2025-02-27 21:30:06 +05:30
parent a0a8ea1641
commit 4824220260
2 changed files with 24 additions and 0 deletions

View File

@@ -5,6 +5,13 @@ All notable changes to **Pipecat** will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- Added `GoogleLLMOpenAIBetaService` for Google LLM integration with an
OpenAI-compatible interface.
## [0.0.58] - 2025-02-26
### Added

View File

@@ -54,6 +54,7 @@ from pipecat.processors.frame_processor import FrameDirection
from pipecat.services.ai_services import ImageGenService, LLMService, STTService, TTSService
from pipecat.services.google.frames import LLMSearchResponseFrame
from pipecat.services.openai import (
BaseOpenAILLMService,
OpenAIAssistantContextAggregator,
OpenAIUserContextAggregator,
)
@@ -1188,6 +1189,22 @@ class GoogleLLMService(LLMService):
return GoogleContextAggregatorPair(_user=user, _assistant=assistant)
class GoogleLLMOpenAIBetaService(BaseOpenAILLMService):
"""This class implements inference with Google's AI LLM models using the OpenAI format.
Ref - https://ai.google.dev/gemini-api/docs/openai
"""
def __init__(
self,
*,
api_key: str,
base_url: str = "https://generativelanguage.googleapis.com/v1beta/openai/",
model: str = "gemini-2.0-flash",
**kwargs,
):
super().__init__(api_key=api_key, base_url=base_url, model=model, **kwargs)
class GoogleTTSService(TTSService):
class InputParams(BaseModel):
pitch: Optional[str] = None