GeminiAgent
What it is
A thin wrapper around naas_abi_core.services.agent.IntentAgent that configures a “Gemini” intent-based agent with:
- A predefined system prompt and suggestions metadata
- A Google Gemini chat model (
google_gemini_2_5_flash) - Image generation/storage tools exposed via a workflow
- A set of intents mapping user phrases to either the model or a tool
Public API
Constants
NAME: Display name ("Gemini").DESCRIPTION: Human-readable description of the agent.AVATAR_URL: Avatar image URL.SYSTEM_PROMPT: Base system prompt template containing a[TOOLS]placeholder.SUGGESTIONS: UI/UX suggestion templates (list of{label, value}).
Functions
create_agent(agent_shared_state: Optional[AgentSharedState] = None, agent_configuration: Optional[AgentConfiguration] = None) -> Optional[IntentAgent]- Builds and returns a configured
GeminiAgent. - Injects available tool names/descriptions into
SYSTEM_PROMPT. - Registers intents for multimodal analysis (handled by the model) and image generation (handled by a tool named
generate_and_store_image).
- Builds and returns a configured
Classes
class GeminiAgent(IntentAgent)- No additional behavior; inherits all functionality from
IntentAgent.
- No additional behavior; inherits all functionality from
Configuration/Dependencies
- Depends on
naas_abi_core.services.agent.IntentAgenttypes:AgentConfiguration,AgentSharedState,Intent,IntentAgent,IntentType
- Loads module configuration:
from naas_abi_marketplace.ai.gemini import ABIModule- Uses
module.configuration.gemini_api_key
- Uses model:
from naas_abi_marketplace.ai.gemini.models.google_gemini_2_5_flash import model
- Adds tools via workflow:
ImageGenerationStorageWorkflowandImageGenerationStorageWorkflowConfiguration- Tools are appended from
image_workflow.as_tools()
- Defaulting behavior:
- If
agent_configurationisNone, createsAgentConfiguration(system_prompt=...) - If
agent_shared_stateisNone, createsAgentSharedState(thread_id="0") memory=Noneis passed to the agent
- If
Usage
from naas_abi_marketplace.ai.gemini.agents.GeminiAgent import create_agent
agent = create_agent()
# agent is an IntentAgent (GeminiAgent) configured with model, tools, and intents.
Caveats
create_agent()requires the Gemini module configuration to providegemini_api_key; if missing/misconfigured, agent creation may fail at runtime.- The set of tools injected into the system prompt depends on
ImageGenerationStorageWorkflow.as_tools(), and image generation intents target a tool namedgenerate_and_store_image.