Skip to content

Instantly share code, notes, and snippets.

View marttp's full-sized avatar
🙇‍♂️
Let's improve equality of developer and make the world better together

Thanaphoom Babparn marttp

🙇‍♂️
Let's improve equality of developer and make the world better together
View GitHub Profile
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] = [
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:**
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(
{
"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": [
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
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],
)
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.
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."),
)
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."""
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()")