#4843 Skill: Applying Innovative Thinking Method SCAMPER
#4843 Skill: Applying Innovative Thinking Method SCAMPER
#4843 Provide a skill markdown document for applying innovative thinking method SCAMPER
I will now generate a comprehensive skill guide and operational playbook for applying the SCAMPER innovative thinking methodology.
How is this skill assigned to an AI agent?
Assigning a skill markdown document to an AI agent depends on the agent framework or platform being used, but it fundamentally works through context injection—providing the instructions either statically in the system prompt or dynamically via retrieval.
Here is how it is implemented across the standard agent architectures:
1. Custom Agent Platforms & Assistants (Gems, GPTs, Claude Projects)
For managed persona-based systems (such as Gemini Gems, OpenAI Custom GPTs, or Claude Projects/Artifacts), skills are assigned directly through UI configuration:
System Instructions / Base Prompt: Paste the core methodology, rules, and triggers directly into the agent’s "Instructions" box.
Knowledge / Reference Files: Upload the
.mdfile as a knowledge source. In the instructions, add an explicit directive:"When the user requests brainstorming, product redesign, or innovative thinking, consult and follow the SCAMPER methodology outlined in scamper_skill_guide.md."
2. Static System Prompt Injection (Code-Based Frameworks)
In frameworks like LangChain, LlamaIndex, AutoGen, or direct API integration, the markdown file is loaded at startup and injected into the system message.
from pathlib import Path
from langchain_core.messages import SystemMessage
# Read the skill document
skill_content = Path("scamper_skill_guide.md").read_text()
# Inject into the system prompt
system_prompt = f"""
You are an innovation and design strategy agent.
You have access to the following operating skill:
{skill_content}
Apply this methodology systematically whenever tasked with product or process ideation.
"""
messages = [SystemMessage(content=system_prompt), ...]
3. Dynamic Tool Calling & On-Demand Retrieval
When an agent manages dozens of skills, injecting all of them into the system prompt wastes context window tokens and dilutes attention. Instead, the skill is assigned dynamically:
As a Tool (Function Calling): The model has a tool like
get_skill(skill_name="scamper"). The system prompt lists only summaries and trigger criteria. When a relevant query arrives, the model invokes the tool to pull the full.mdinstructions into memory.RAG (Retrieval-Augmented Generation): The skill library is vectorized and stored in a vector database. When a user asks a question about ideation or SCAMPER, semantic search fetches the relevant sections and appends them to the working context.
Key Requirements for Reliable Execution
Regardless of deployment method, ensure the markdown document contains clear boundaries so the agent knows how to act:
| Component | Purpose |
| Trigger Conditions | Tells the agent when to activate the skill (e.g., "Activate when users request creative ideation or feature reimagining"). |
| Step-by-Step Procedure | Clear sequential steps the model must follow rather than open-ended advice. |
| Output Schema / Format | Defines the exact structure (tables, headers, bullet points) the agent must return to the user. |
| Negative Constraints | Defines what not to do (e.g., "Do not skip straight to solutions without running through each SCAMPER category"). |
Provide this example using Google Gemini API in Python
To assign this SCAMPER skill document to Gemini using the official Google GenAI Python SDK (google-genai), pass the markdown document into system_instruction via GenerateContentConfig.
1. Installation and API Key Setup
Install the SDK:
pip install -U google-genai
Set your API key in your terminal or .env file:
export GEMINI_API_KEY="your-api-key-here"
2. Implementation
Place scamper_skill_guide.md in your project folder alongside your script. The script reads the markdown file and passes it directly as a system instruction to instruct the agent:
from pathlib import Path
from google import genai
from google.genai import types
# 1. Load the skill instructions from the markdown file
skill_path = Path("scamper_skill_guide.md")
if not skill_path.exists():
raise FileNotFoundError("Please ensure 'scamper_skill_guide.md' is in your working directory.")
scamper_instructions = skill_path.read_text(encoding="utf-8")
# 2. Initialize the Gemini client (picks up GEMINI_API_KEY automatically)
client = genai.Client()
# 3. Configure the agent with the SCAMPER skill as system instruction
config = types.GenerateContentConfig(
system_instruction=(
"You are an expert product innovation and design thinking assistant.\n"
"Strictly adhere to the following SCAMPER skill guide and protocol "
"when analyzing user challenges:\n\n"
f"{scamper_instructions}"
),
temperature=0.7, # Slightly higher temperature encourages creative divergence
)
# 4. Generate ideas for a target product or process
target_problem = (
"Run a full SCAMPER session on the traditional physical passport/travel ID. "
"Focus on modern security, user convenience, and cross-border logistics."
)
response = client.models.generate_content(
model="gemini-2.5-flash",
contents=target_problem,
config=config,
)
print(response.text)
3. Interactive Multi-Turn Ideation Chat
If you want the model to act as a facilitator that coaches the user through SCAMPER step-by-step rather than dumping all ideas at once, instantiate a persistent chat session:
chat = client.chats.create(
model="gemini-2.5-flash",
config=config
)
# Turn 1
response = chat.send_message("Let's redesign an electric bicycle for extreme winter commuters.")
print(response.text)
# Turn 2: Gemini retains the SCAMPER methodology context across subsequent prompts
response = chat.send_message("Let's dive deeper into 'M' (Modify/Magnify) for battery performance.")
print(response.text)Show me how to constrain the Gemini output to a structured JSON schema using Pydantic in python.
To constrain Gemini's output to a strict JSON structure, define a standard Pydantic model and pass it directly to response_schema alongside response_mime_type="application/json" in GenerateContentConfig.
The google-genai SDK converts the Pydantic class into an internal JSON Schema that the model follows.
Implementation
from enum import Enum
from pathlib import Path
from typing import List
from pydantic import BaseModel, Field
from google import genai
from google.genai import types
# 1. Define SCAMPER categories as an Enum
class ScamperCategory(str, Enum):
SUBSTITUTE = "Substitute"
COMBINE = "Combine"
ADAPT = "Adapt"
MODIFY_MAGNIFY = "Modify/Magnify"
PUT_TO_ANOTHER_USE = "Put to Another Use"
ELIMINATE = "Eliminate"
REVERSE_REARRANGE = "Reverse/Rearrange"
# 2. Define the individual idea structure
class ScamperIdea(BaseModel):
category: ScamperCategory = Field(
description="The SCAMPER category used for this idea."
)
title: str = Field(
description="Short, descriptive title of the innovative concept."
)
description: str = Field(
description="Detailed explanation of the change and mechanism."
)
feasibility_score: int = Field(
ge=1, le=5, description="Feasibility rating from 1 (moonshot) to 5 (immediate)."
)
expected_impact: str = Field(
description="Primary user or business benefit."
)
# 3. Define the root container schema
class ScamperAnalysisReport(BaseModel):
target_subject: str = Field(
description="The product, service, or process analyzed."
)
core_problem_statement: str = Field(
description="The bottleneck or limitation addressed."
)
ideas: List[ScamperIdea] = Field(
description="Collection of generated SCAMPER ideas across relevant categories."
)
# 4. Initialize client and run inference
client = genai.Client(api_key=".................")
config = types.GenerateContentConfig(
system_instruction="You are an expert innovation strategist specializing in SCAMPER.",
response_mime_type="application/json",
response_schema=ScamperAnalysisReport,
temperature=0.4, # Lower temperature prevents schema deviations while keeping ideas creative
)
prompt = (
"Run a SCAMPER ideation session to modernize airport security checkpoints, "
"focusing on passenger throughput and non-intrusive scanning."
)
response = client.models.generate_content(
model="gemini-2.5-flash",
contents=prompt,
config=config,
)
# 5. Parse and validate the response directly back into your Pydantic model
report = ScamperAnalysisReport.model_validate_json(response.text)
print(f"Target: {report.target_subject}")
print(f"Problem: {report.core_problem_statement}\n")
for idea in report.ideas:
print(f"[{idea.category.value}] {idea.title} (Feasibility: {idea.feasibility_score}/5)")
print(f" Concept: {idea.description}")
print(f" Impact: {idea.expected_impact}\n")
Key Mechanics
response_mime_type="application/json": Enforces raw JSON syntax without markdown backticks (no
```jsonblocks to strip).response_schema=ScamperAnalysisReport: Translates field types, nested classes,
Enumconstraints, andField(ge=..., le=...)ranges directly into the model's generation constraints.model_validate_json(...): Restores full type safety in Python, providing IDE autocomplete and instant validation error handling if parsing fails.
Describe how to package the skill and Pydantic class(es) together
Packaging a skill markdown guide and its Pydantic models together turns unstructured guidelines into a modular, self-contained Python component.
The standard pattern is to organize the skill into a reusable package or class module that couples:
The Skill Asset: Markdown instructions (loaded cleanly from package data).
The Output Contract: Pydantic schema enforcing data boundaries.
The Execution Harness: A runner or factory that binds the instructions and schema directly into Gemini's
GenerateContentConfig.
1. Recommended Package Structure
Structure the skill as an importable module within your application or agent library:
my_agent_platform/
├── skills/
│ ├── __init__.py
│ └── scamper/
│ ├── __init__.py # Public exports (classes & runner)
│ ├── instructions.md # The methodology guide & constraints
│ ├── schemas.py # Pydantic data structures
│ └── skill.py # Packaging wrapper / execution logic
└── main.py
2. Code Implementation
skills/scamper/schemas.py
Defines the output structure and validation rules:
from enum import Enum
from typing import List
from pydantic import BaseModel, Field
class ScamperCategory(str, Enum):
SUBSTITUTE = "Substitute"
COMBINE = "Combine"
ADAPT = "Adapt"
MODIFY_MAGNIFY = "Modify/Magnify"
PUT_TO_ANOTHER_USE = "Put to Another Use"
ELIMINATE = "Eliminate"
REVERSE_REARRANGE = "Reverse/Rearrange"
class ScamperIdea(BaseModel):
category: ScamperCategory = Field(description="The SCAMPER category used.")
title: str = Field(description="Action-oriented concept title.")
description: str = Field(description="Technical or operational mechanism.")
feasibility_score: int = Field(ge=1, le=5, description="1 (moonshot) to 5 (immediate).")
expected_impact: str = Field(description="Primary user or business benefit.")
class ScamperAnalysisReport(BaseModel):
target_subject: str = Field(description="Item or process analyzed.")
core_problem_statement: str = Field(description="The core limitation or bottleneck.")
ideas: List[ScamperIdea] = Field(description="List of ideas produced.")
skills/scamper/skill.py
Bundles the markdown content, Pydantic model, and configuration into an executable skill object:
from pathlib import Path
from google import genai
from google.genai import types
from .schemas import ScamperAnalysisReport
class ScamperSkill:
"""Encapsulates the SCAMPER methodology instructions and structured schema."""
def __init__(self):
# Resolve instructions.md relative to this file's location
guide_file = Path(__file__).parent / "instructions.md"
self.instructions = guide_file.read_text(encoding="utf-8")
self.response_schema = ScamperAnalysisReport
def get_config(self, temperature: float = 0.5) -> types.GenerateContentConfig:
"""Returns the turnkey GenerateContentConfig for Gemini."""
return types.GenerateContentConfig(
system_instruction=self.instructions,
response_mime_type="application/json",
response_schema=self.response_schema,
temperature=temperature,
)
def execute(
self,
client: genai.Client,
subject: str,
model: str = "gemini-2.5-flash",
) -> ScamperAnalysisReport:
"""Runs the skill against a target subject and returns validated Pydantic output."""
response = client.models.generate_content(
model=model,
contents=f"Execute a SCAMPER ideation session on: {subject}",
config=self.get_config(),
)
return self.response_schema.model_validate_json(response.text)
skills/scamper/__init__.py
Exposes a clean API for consumers:
from .schemas import ScamperIdea, ScamperAnalysisReport, ScamperCategory
from .skill import ScamperSkill
__all__ = [
"ScamperSkill",
"ScamperIdea",
"ScamperAnalysisReport",
"ScamperCategory",
]
3. Usage in Agent Workflows
Consumers of your agent framework can now import and invoke the skill in three lines:
from google import genai
from skills.scamper import ScamperSkill
client = genai.Client()
scamper = ScamperSkill()
# Run the packaged skill
report = scamper.execute(client, subject="Urban food delivery packaging")
print(f"Target: {report.target_subject}")
for idea in report.ideas:
print(f"- [{idea.category.value}] {idea.title}: {idea.description}")
Packaging Benefits
Zero Schema Drift: The system prompt (
instructions.md) and data contract (schemas.py) live side-by-side in source control. If you update categories or prompt rules, the schema stays synchronized.Portable Integration: You can pass
skill.get_config()to standalone scripts, exposeskill.execute()as a callable tool in LangGraph/AutoGen, or bundle it as an internal library viapyproject.toml.Runtime Safety: The caller always receives an instantiated Pydantic model (
ScamperAnalysisReport), guaranteeing type completion and automated runtime validation.
To expose the packaged ScamperSkill to an autonomous Gemini router, define a plain Python function with explicit type hints and docstrings. The google-genai SDK converts standard Python functions directly into model tool declarations.
When the router identifies an ideation request, it invokes the tool, triggers the underlying sub-agent execution, and feeds the structured findings back into the orchestrator loop.
1. Tool Definition Wrapper (tools.py)
Create a tool function that instantiates the skill and returns serializable data (dict or JSON string) for the router:
from google import genai
from skills.scamper import ScamperSkill
# Shared client instance
client = genai.Client()
scamper_service = ScamperSkill()
def run_scamper_ideation(target_subject: str) -> dict:
"""Runs a structured SCAMPER innovative thinking session on a specific subject, product, or workflow.
Use this tool whenever the user needs creative brainstorming, feature redesign,
or systematic innovation exploration across SCAMPER categories (Substitute, Combine,
Adapt, Modify, Put to another use, Eliminate, Reverse).
Args:
target_subject: The specific product, service, feature, or workflow to innovate.
Returns:
dict: A structured report containing problem statement and categorized innovation ideas.
"""
report = scamper_service.execute(client=client, subject=target_subject)
# Convert Pydantic object to native dictionary for tool response serialization
return report.model_dump()
2. Autonomous Agent Router Implementation (agent.py)
Pass run_scamper_ideation to config.tools. Set mode="AUTO" on function_calling_config so Gemini autonomously decides whether to answer directly or route to the tool.
from google import genai
from google.genai import types
from tools import run_scamper_ideation
client = genai.Client()
# System instructions defining router behavior and scope
ROUTER_SYSTEM_INSTRUCTION = """
You are an executive product strategy orchestrator.
When the user asks for creative solutions, redesigns, or innovation workflows,
delegate the analysis to the `run_scamper_ideation` tool.
Once the tool returns the ideas, synthesize the highest-leverage concepts
and present a prioritized strategic recommendation to the user.
"""
config = types.GenerateContentConfig(
system_instruction=ROUTER_SYSTEM_INSTRUCTION,
tools=[run_scamper_ideation],
temperature=0.2,
)
# Multi-turn chat session with autonomous function calling
chat = client.chats.create(
model="gemini-2.5-flash",
config=config,
)
user_query = "Our team is redesigning hospital patient wristbands to reduce medical errors. Help us brainstorm."
# The SDK automatically handles the tool call loop (model call -> execute python function -> return result)
response = chat.send_message(user_query)
print(response.text)
Key Mechanics
Docstring as Tool Meta-Prompt: Gemini relies directly on the function docstring and argument descriptions to understand when and how to route queries to the tool.
Separation of Concerns: The router agent operates with a low temperature (
0.2) for orchestration and synthesis, while the nestedScamperSkillruns at its own configured temperature (0.5) to encourage creative divergence.Automatic Execution Loop: Under
google-genai, passing a standard Python callable intoolsenables automatic function execution by default: Gemini invokes the function, receives the Pydantic dictionary output, and synthesizes the final response in one call.
Show me how to manually handle tool execution and send function responses back to Gemini in python.
To handle tool execution manually using the google-genai SDK, disable automatic tool execution, inspect the model's function call requests, execute your custom logic locally, and pass the results back as a types.Part.from_function_response in the conversation history.
Step-by-Step Implementation
from google import genai
from google.genai import types
from skills.scamper import ScamperSkill
client = genai.Client()
scamper_service = ScamperSkill()
# 1. Define the local function and its tool declaration
def run_scamper_ideation(target_subject: str) -> dict:
"""Executes a structured SCAMPER innovation session on a target subject."""
report = scamper_service.execute(client=client, subject=target_subject)
return report.model_dump()
# Map function names to actual callables for lookup
TOOL_REGISTRY = {
"run_scamper_ideation": run_scamper_ideation,
}
# 2. Configure manual tool calling
# Passing tools as Python functions lets Gemini auto-generate the tool schemas,
# but using client.models.generate_content directly gives you control over the loop.
config = types.GenerateContentConfig(
system_instruction="You are a strategic innovation consultant. Use tools when asked to brainstorm or redesign products.",
tools=[run_scamper_ideation],
temperature=0.2,
)
# 3. Initialize message history
contents = [
types.Content(
role="user",
parts=[types.Part.from_text("Redesign a standard commercial airplane tray table.")],
)
]
# --- Round 1: Model decides to call a function ---
response = client.models.generate_content(
model="gemini-2.5-flash",
contents=contents,
config=config,
)
# Append the model's response (which contains function_calls) to history
contents.append(response.candidates[0].content)
# 4. Check for function calls and execute manually
function_calls = response.function_calls
if function_calls:
tool_response_parts = []
for call in function_calls:
func_name = call.name
func_args = call.args
print(f"-> Router requested function: {func_name}")
print(f"-> Arguments: {func_args}\n")
# Execute the matched function
if func_name in TOOL_REGISTRY:
tool_result = TOOL_REGISTRY[func_name](**func_args)
else:
tool_result = {"error": f"Function {func_name} not found"}
# Format the result back into a FunctionResponse part
tool_response_parts.append(
types.Part.from_function_response(
name=func_name,
response={"result": tool_result},
)
)
# 5. Append function response(s) under the 'user' role
contents.append(
types.Content(
role="user",
parts=tool_response_parts,
)
)
# --- Round 2: Gemini consumes the tool response and synthesizes final output ---
final_response = client.models.generate_content(
model="gemini-2.5-flash",
contents=contents,
config=config,
)
print("=== Final Synthesized Output ===")
print(final_response.text)
Core Mechanics of the Manual Loop
Inspect with
response.function_calls: Instead of automatically invoking the Python function behind the scenes, you inspectcall.nameandcall.argsto validate permissions, log queries, or request human approval before execution.Keep Turn History Intact: When handling calls manually, you must append the assistant's turn containing the
function_calldirectly intocontentsbefore providing the tool's answer. Omitting it breaks the conversation ordering.Part.from_function_response: The function output must be packaged withtypes.Part.from_function_response(name=..., response={...})whereresponsetakes a dictionary.Role Mapping: The tool execution response is sent back with
role="user". Gemini then ingests the payload and performs final reasoning.
Provide a Python application using Google Gemini API and a list of skill descriptions to create the skill library previously discussed. Include directories and files generation
This end-to-end Python script takes a list of skill descriptions, calls the Google Gemini API with structured outputs (response_schema), and writes out fully organized skill packages directly to your filesystem.
Generated Directory Structure
For each skill processed, the application generates a self-contained directory under skills/:
skills/
└── <skill_slug>/
├── __init__.py # Exports skill class and Pydantic schemas
├── instructions.md # Full operational markdown prompt and rules
├── schemas.py # Generated Pydantic schema code for the skill's output
└── skill.py # Execution harness binding instructions + schemas
Prerequisites
Install the official Google GenAI and Pydantic packages:
pip install -U google-genai pydantic
Set your API key:
export GEMINI_API_KEY="your-api-key-here"
Skill Library Generator Application (generate_library.py)
import os
import re
from pathlib import Path
from typing import List
from pydantic import BaseModel, Field
from google import genai
from google.genai import types
# ==========================================
# 1. Pydantic Contract for Meta-Generation
# ==========================================
class SkillBundleSpecification(BaseModel):
"""Structured format Gemini must return for each skill package."""
slug: str = Field(
description="Lowercase snake_case folder name (e.g. 'scamper', 'first_principles')."
)
class_name: str = Field(
description="PascalCase class name (e.g. 'ScamperSkill', 'FirstPrinciplesSkill')."
)
report_schema_name: str = Field(
description="PascalCase name of the primary Pydantic report model (e.g. 'ScamperReport')."
)
instructions_md: str = Field(
description="Complete operational guidelines, steps, edge cases, and examples in Markdown."
)
schemas_py: str = Field(
description="Valid Python code defining Pydantic schemas required for the skill output."
)
# ==========================================
# 2. File and Directory Builder
# ==========================================
def write_skill_package(base_dir: Path, spec: SkillBundleSpecification) -> None:
"""Creates the skill folder and writes __init__.py, instructions.md, schemas.py, and skill.py."""
skill_dir = base_dir / spec.slug
skill_dir.mkdir(parents=True, exist_ok=True)
# 1. instructions.md
(skill_dir / "instructions.md").write_text(spec.instructions_md.strip(), encoding="utf-8")
# 2. schemas.py
(skill_dir / "schemas.py").write_text(spec.schemas_py.strip(), encoding="utf-8")
# 3. skill.py - Generic execution harness
skill_py_code = f'''from pathlib import Path
from google import genai
from google.genai import types
from .schemas import {spec.report_schema_name}
class {spec.class_name}:
"""Packaged execution harness for the {spec.slug} skill."""
def __init__(self):
guide_file = Path(__file__).parent / "instructions.md"
self.instructions = guide_file.read_text(encoding="utf-8")
self.response_schema = {spec.report_schema_name}
def get_config(self, temperature: float = 0.4) -> types.GenerateContentConfig:
return types.GenerateContentConfig(
system_instruction=self.instructions,
response_mime_type="application/json",
response_schema=self.response_schema,
temperature=temperature,
)
def execute(
self,
client: genai.Client,
subject: str,
model: str = "gemini-2.5-flash",
) -> {spec.report_schema_name}:
response = client.models.generate_content(
model=model,
contents=f"Execute analysis on: {{subject}}",
config=self.get_config(),
)
return self.response_schema.model_validate_json(response.text)
'''
(skill_dir / "skill.py").write_text(skill_py_code, encoding="utf-8")
# 4. __init__.py - Exposing clean package imports
init_py_code = f'''from .schemas import {spec.report_schema_name}
from .skill import {spec.class_name}
__all__ = ["{spec.class_name}", "{spec.report_schema_name}"]
'''
(skill_dir / "__init__.py").write_text(init_py_code, encoding="utf-8")
print(f"✓ Generated package at: {skill_dir}")
# ==========================================
# 3. Main Generator Pipeline
# ==========================================
SYSTEM_PROMPT = """You are a senior AI agent architect.
Given an innovation/thinking skill description, generate the complete skill package:
1. 'slug': lowercase_snake_case folder name.
2. 'class_name': PascalCase skill class name.
3. 'report_schema_name': PascalCase name of the primary output model.
4. 'instructions_md': In-depth, exhaustive Markdown guide detailing the methodology, prompts, and steps.
5. 'schemas_py': Syntactically valid Python code with Pydantic BaseModel definitions (using standard typing and pydantic imports) that define the structured data model for this skill. Ensure the root model name matches report_schema_name.
"""
def generate_skill_library(skill_descriptions: List[str], output_dir: str = "skills"):
client = genai.Client(api_key="................")
output_path = Path(output_dir)
output_path.mkdir(parents=True, exist_ok=True)
# Root library __init__.py
(output_path / "__init__.py").touch()
config = types.GenerateContentConfig(
system_instruction=SYSTEM_PROMPT,
response_mime_type="application/json",
response_schema=SkillBundleSpecification,
temperature=0.3,
)
for idx, desc in enumerate(skill_descriptions, 1):
print(f"\nProcessing [{idx}/{len(skill_descriptions)}]: {desc[:50]}...")
prompt = f"Build an agent skill package for the following methodology:\n\n{desc}"
response = client.models.generate_content(
model="gemini-2.5-flash",
contents=prompt,
config=config,
)
# Parse output into our Pydantic spec and build directory files
spec = SkillBundleSpecification.model_validate_json(response.text)
write_skill_package(output_path, spec)
# ==========================================
# 4. Execution Entry Point
# ==========================================
if __name__ == "__main__":
# Define the skills you want to generate
skills_to_build = [
(
"SCAMPER Innovative Thinking: Guide the model through Substitute, Combine, "
"Adapt, Modify/Magnify, Put to another use, Eliminate, and Reverse to redesign products."
),
(
"First Principles Deconstruction: Break down complex business or engineering problems "
"into elemental foundational truths, identify flawed assumptions, and reconstruct solutions from scratch."
),
(
"Six Thinking Hats: Analyze a critical decision from all six Edward de Bono perspectives: "
"White (Data), Red (Emotion), Black (Risks), Yellow (Benefits), Green (Creativity), and Blue (Process)."
),
]
generate_skill_library(skill_descriptions=skills_to_build, output_dir="skills")
How to Consume the Generated Library
Once the script completes, any generated skill can be imported and executed in your agent runtime:
from google import genai
from skills.scamper import ScamperSkill
from skills.six_thinking_hats import SixThinkingHatsSkill
client = genai.Client(api_key="...............")
# 1. Run SCAMPER
scamper = ScamperSkill()
scamper_report = scamper.execute(client, subject="Smart re-usable coffee mug")
print(f"SCAMPER generated {len(scamper_report.ideas)} concepts.")
# 2. Run Six Thinking Hats
hats = SixThinkingHatsSkill()
hats_report = hats.execute(client, subject="Replacing physical offices with VR workspaces")
print(f"Analysis complete for: {hats_report.subject}")What determines best temperature(s)?
The "best" temperature in generative AI sampling governs the trade-off between determinism (precision) and entropy (creativity).
Mathematically, temperature scales the raw output logits before the softmax function converts them into token probabilities:
As T --> 0, the highest-scoring token dominates (approaching greedy decoding). As T increases, the probability distribution flattens, giving lower-ranked tokens a higher likelihood of selection.
Key Determining Factors
| Factor | Low Temperature (0.0 – 0.3) | High Temperature (0.7 – 1.2) |
| Tolerance for Hallucination | Zero tolerance. Factual Q&A, math, citations, policy extraction. | Tolerant. Storytelling, speculative brainstorming, roleplay. |
| Output Format Rigidity | Strict schemas. JSON parsing, SQL queries, regex generation. | Freeform prose. Creative essays, poetry, conversational dialogue. |
| Pipeline Predictability | Deterministic. Tool calling, agent routing, classification. | Stochastic. Generating multiple distinct options or alternatives. |
| Verification Loop | No verifier. Single-shot execution needing the safest top token. | External verifier. Best-of-N sampling, unit test execution loops. |
Recommended Settings by Task
0.0(Greedy / Deterministic): Classification, code debugging, mathematical calculation, JSON/schema generation, and agent routing logic where consistency and tool-call reliability matter most.0.2–0.4(Focused & Factual): Technical documentation, factual synthesis, data summarization, and business reports where slight linguistic variance is fine but accuracy is critical.0.7–0.9(Balanced & Creative): Brainstorming frameworks (e.g., SCAMPER, lateral thinking), marketing copy, creative writing, and natural multi-turn conversational agents.1.0+ (High Entropy): Generative poetry, exploratory ideation runs, or synthetic data variation where novelty outweighs strict adherence.
From <https://gemini.google.com/app/abc8b76b0ae00ee6> Google Gemini (3.8 Flash)
Comments
Post a Comment