Files
pipecat/examples/unified-format-function-calling/standard-function-calling-gemini.py
2025-03-05 14:12:30 -03:00

28 lines
610 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#
# Copyright (c) 20242025, Daily
#
# SPDX-License-Identifier: BSD 2-Clause License
#
import asyncio
import os
from base_function_calling import WeatherBot
from dotenv import load_dotenv
from pipecat.services.google import GoogleLLMService
load_dotenv(override=True)
class GeminiWeatherBot(WeatherBot):
"""Main class defining the LLM and passing it to the base handler."""
def __init__(self):
llm = GoogleLLMService(api_key=os.getenv("GOOGLE_API_KEY"), model="gemini-2.0-flash-001")
super().__init__(llm)
if __name__ == "__main__":
asyncio.run(GeminiWeatherBot().run())