import os, sys
from google import genai
from dotenv import load_dotenv
from google.genai import types # Import types for strict schema

load_dotenv()

client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))

# @NR List available models BEFORE selecting one
print("List of models that support generateContent:")
for m in client.models.list():
    for action in m.supported_actions:
        if action == "generateContent":
            print(m.name)

#sys.exit()
# Gemini 3 models support 'thinking_level' for agentic reasoning
response = client.models.generate_content(
    model="gemini-3-flash-preview",
    contents="Plan a 3-step agentic workflow to analyze this directory.",
    config=types.GenerateContentConfig(
        # Use the dedicated ThinkingConfig object
        thinking_config=types.ThinkingConfig(include_thoughts=True)
    )
)

# In agentic workflows, we often want to see the 'thought' process
if response.candidates[0].grounding_metadata:
    print(f"Thoughts: {response.candidates[0].grounding_metadata}")

print(f"Agent Plan: {response.text}")
