formatting

This commit is contained in:
Ankur Duggal
2024-06-12 15:01:19 -07:00
parent c7a0d0db64
commit effc69e4e4
2 changed files with 45 additions and 34 deletions

View File

@@ -26,10 +26,20 @@ from pipecat.frames.frames import (
class BaseOpenPipeLLMService(LLMService): class BaseOpenPipeLLMService(LLMService):
def __init__(self, model: str, c_id=None, api_key=None, openpipe_api_key=None, openpipe_base_url=None, prompt=None): def __init__(
self,
model: str,
c_id=None,
api_key=None,
openpipe_api_key=None,
openpipe_base_url=None,
prompt=None):
super().__init__() super().__init__()
self._model = model self._model = model
self._client = self.create_client(api_key=api_key, openpipe_api_key=openpipe_api_key, openpipe_base_url=openpipe_base_url) self._client = self.create_client(
api_key=api_key,
openpipe_api_key=openpipe_api_key,
openpipe_base_url=openpipe_base_url)
self.c_id = c_id if c_id else secrets.token_urlsafe(16) self.c_id = c_id if c_id else secrets.token_urlsafe(16)
self.prompt = prompt self.prompt = prompt
logger.debug(f"Client Created: {self._client}") logger.debug(f"Client Created: {self._client}")
@@ -142,6 +152,7 @@ class BaseOpenPipeLLMService(LLMService):
if context: if context:
await self._process_context(context) await self._process_context(context)
class OpenPipeLLMService(BaseOpenPipeLLMService): class OpenPipeLLMService(BaseOpenPipeLLMService):
def __init__(self, model="gpt-4o", cli_id=None, **kwargs): def __init__(self, model="gpt-4o", cli_id=None, **kwargs):