adding GoogleLLMOpenAIBetaService
This commit is contained in:
@@ -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/),
|
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).
|
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
|
## [0.0.58] - 2025-02-26
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ from pipecat.processors.frame_processor import FrameDirection
|
|||||||
from pipecat.services.ai_services import ImageGenService, LLMService, STTService, TTSService
|
from pipecat.services.ai_services import ImageGenService, LLMService, STTService, TTSService
|
||||||
from pipecat.services.google.frames import LLMSearchResponseFrame
|
from pipecat.services.google.frames import LLMSearchResponseFrame
|
||||||
from pipecat.services.openai import (
|
from pipecat.services.openai import (
|
||||||
|
BaseOpenAILLMService,
|
||||||
OpenAIAssistantContextAggregator,
|
OpenAIAssistantContextAggregator,
|
||||||
OpenAIUserContextAggregator,
|
OpenAIUserContextAggregator,
|
||||||
)
|
)
|
||||||
@@ -1188,6 +1189,22 @@ class GoogleLLMService(LLMService):
|
|||||||
return GoogleContextAggregatorPair(_user=user, _assistant=assistant)
|
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 GoogleTTSService(TTSService):
|
||||||
class InputParams(BaseModel):
|
class InputParams(BaseModel):
|
||||||
pitch: Optional[str] = None
|
pitch: Optional[str] = None
|
||||||
|
|||||||
Reference in New Issue
Block a user