|
21 | 21 | from pipecat.pipeline.task import PipelineParams, PipelineTask |
22 | 22 | from pipecat.processors.aggregators.llm_context import LLMContext |
23 | 23 | from pipecat.processors.aggregators.llm_response_universal import LLMContextAggregatorPair |
24 | | -from pipecat.runner.types import DailyRunnerArguments, RunnerArguments |
25 | | -from pipecat.runner.utils import create_transport |
| 24 | +from pipecat.runner.types import RunnerArguments |
26 | 25 | from pipecat.serializers.protobuf import ProtobufFrameSerializer |
| 26 | +from pipecat.services.aws.llm import AWSBedrockLLMService |
27 | 27 | from pipecat.services.cartesia.tts import CartesiaTTSService |
28 | 28 | from pipecat.services.deepgram.stt import DeepgramSTTService |
29 | 29 | from pipecat.services.llm_service import FunctionCallParams |
30 | | -from pipecat.services.openai.llm import OpenAILLMService |
31 | 30 | from pipecat.transports.base_transport import BaseTransport, TransportParams |
32 | 31 | from pipecat.transports.daily.transport import DailyParams |
33 | 32 | from pipecat.transports.websocket.fastapi import FastAPIWebsocketParams, FastAPIWebsocketTransport |
@@ -74,7 +73,11 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): |
74 | 73 | voice_id="71a7ad14-091c-4e8e-a314-022ece01c121", # British Reading Lady |
75 | 74 | ) |
76 | 75 |
|
77 | | - llm = OpenAILLMService(api_key=os.getenv("OPENAI_API_KEY")) |
| 76 | + # Automatically uses AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_REGION env vars. |
| 77 | + llm = AWSBedrockLLMService( |
| 78 | + model="us.amazon.nova-2-lite-v1:0", |
| 79 | + params=AWSBedrockLLMService.InputParams(temperature=0.8), |
| 80 | + ) |
78 | 81 |
|
79 | 82 | # You can also register a function_name of None to get all functions |
80 | 83 | # sent to the same callback with an additional function_name parameter. |
@@ -117,8 +120,9 @@ async def on_function_calls_started(service, function_calls): |
117 | 120 | messages = [ |
118 | 121 | { |
119 | 122 | "role": "system", |
120 | | - "content": "You are a helpful LLM in a WebRTC call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.", |
| 123 | + "content": "You are a helpful LLM in a voice call. Your goal is to demonstrate your capabilities in a succinct way. Your output will be spoken aloud, so avoid special characters that can't easily be spoken, such as emojis or bullet points. Respond to what the user said in a creative and helpful way.", |
121 | 124 | }, |
| 125 | + {"role": "user", "content": "Say hello and briefly introduce yourself."}, |
122 | 126 | ] |
123 | 127 |
|
124 | 128 | context = LLMContext(messages, tools) |
|
0 commit comments