Update examples
This commit is contained in:
@@ -69,9 +69,9 @@ from pipecat.processors.aggregators.llm_response_universal import (
|
||||
)
|
||||
from pipecat.runner.types import RunnerArguments
|
||||
from pipecat.runner.utils import create_transport
|
||||
from pipecat.services.cartesia.tts import CartesiaTTSService
|
||||
from pipecat.services.cartesia.tts import CartesiaTTSService, CartesiaTTSSettings
|
||||
from pipecat.services.deepgram.stt import DeepgramSTTService
|
||||
from pipecat.services.google.llm import GoogleLLMService
|
||||
from pipecat.services.google.llm import GoogleLLMService, GoogleLLMSettings
|
||||
from pipecat.services.llm_service import FunctionCallParams
|
||||
from pipecat.transports.base_transport import BaseTransport, TransportParams
|
||||
from pipecat.transports.daily.transport import DailyParams
|
||||
@@ -183,11 +183,24 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
||||
|
||||
tts = CartesiaTTSService(
|
||||
api_key=os.getenv("CARTESIA_API_KEY"),
|
||||
voice_id="f9836c6e-a0bd-460e-9d3c-f7299fa60f94", # Southern Lady
|
||||
settings=CartesiaTTSSettings(
|
||||
voice="f9836c6e-a0bd-460e-9d3c-f7299fa60f94", # Southern Lady
|
||||
),
|
||||
)
|
||||
|
||||
system_prompt = """\
|
||||
You are a helpful assistant who converses with a user and answers questions.
|
||||
|
||||
You have access to the tool, query_knowledge_base, that allows you to query the knowledge base for the answer to the user's question.
|
||||
|
||||
Your response will be turned into speech so use only simple words and punctuation.
|
||||
"""
|
||||
|
||||
llm = GoogleLLMService(
|
||||
model=VOICE_MODEL,
|
||||
settings=GoogleLLMSettings(
|
||||
model=VOICE_MODEL,
|
||||
),
|
||||
system_instruction=system_prompt,
|
||||
api_key=os.getenv("GOOGLE_API_KEY"),
|
||||
)
|
||||
llm.register_function("query_knowledge_base", query_knowledge_base)
|
||||
@@ -205,15 +218,7 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments):
|
||||
)
|
||||
tools = ToolsSchema(standard_tools=[query_function])
|
||||
|
||||
system_prompt = """\
|
||||
You are a helpful assistant who converses with a user and answers questions.
|
||||
|
||||
You have access to the tool, query_knowledge_base, that allows you to query the knowledge base for the answer to the user's question.
|
||||
|
||||
Your response will be turned into speech so use only simple words and punctuation.
|
||||
"""
|
||||
messages = [
|
||||
{"role": "system", "content": system_prompt},
|
||||
{"role": "user", "content": "Greet the user."},
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user