🙇♂️
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import praw | |
import logging | |
import os | |
from datetime import datetime, timedelta | |
from google.adk.tools.tool_context import ToolContext | |
from google.cloud import firestore | |
def search_yesterday_reddit_posts( | |
subreddit_names: list[str] = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.adk.agents import Agent | |
from google.adk.tools import google_search | |
from trend_spotter.config import MODEL | |
google_search_sub_agent_prompt = """ | |
**Role:** | |
- You are a specialist Research Assistant. | |
- Your only purpose is to execute a Google Search based on instructions. | |
**Tools:** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.adk.agents import Agent, SequentialAgent | |
from trend_spotter.config import MODEL | |
from trend_spotter.sub_agents.reddit_agent import reddit_agent | |
from trend_spotter.sub_agents.workshop_group import ( | |
product_manager_agent, | |
solution_architect_agent, | |
reporter_agent, | |
) | |
solution_design_group = SequentialAgent( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"document_id": "76d892c9-2d7e-458f-ab57-a64ecc28d4b2", | |
"created_at": "timestamp_placeholder", | |
"user_profile": { | |
"salary_per_month": "90000 THB", | |
"age": 30, | |
"current_savings": "5000 THB", | |
"risk_tolerance": "Moderate" | |
}, | |
"financial_goals": [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import uuid | |
from google.adk.agents import Agent, SequentialAgent, LoopAgent, ParallelAgent | |
from google.adk.tools.tool_context import ToolContext | |
from google.genai import types | |
from google.adk.tools import exit_loop | |
model_name = "gemini-2.5-flash-preview-04-17" | |
# Tools |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.adk.agents import Agent | |
from google.adk.tools import google_search | |
root_agent = Agent( | |
model="gemini-2.0-flash-exp", | |
name="question_answer_agent", | |
description="A helpful assistant agent that can answer questions.", | |
instruction="""Respond to the query using google search""", | |
tools=[google_search], | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
from zoneinfo import ZoneInfo | |
from google.adk.agents import Agent | |
def get_weather(city: str) -> dict: | |
"""Retrieves the current weather report for a specified city. | |
Args: | |
city (str): The name of the city for which to retrieve the weather report. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.adk.agents import Agent | |
root_agent = Agent( | |
name="noob_agent", | |
model="gemini-2.0-flash", | |
description=("Simple agent without any tools"), | |
instruction=("You are a helpful agent who can answer user questions."), | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from genai_client import client | |
from google.genai import types | |
import sqlite3 | |
db_file = "sample.db" | |
db_conn = sqlite3.connect(db_file) | |
def list_tables() -> list[str]: | |
"""Retrieve the names of all tables in the database.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
db_file = "sample.db" | |
db_conn = sqlite3.connect(db_file) | |
def list_tables() -> list[str]: | |
"""Retrieve the names of all tables in the database.""" | |
# Include print logging statements so you can see when functions are being called. | |
print(" - DB CALL: list_tables()") |
NewerOlder