PennylaneAgent
What it is
- A thin wrapper around the core
Agentabstraction that wires in the Pennylane integration tools and a predefined system prompt. - Factory function
create_agent()builds and returns a ready-to-usePennylaneAgent.
Public API
-
create_agent(agent_shared_state: AgentSharedState | None = None, agent_configuration: AgentConfiguration | None = None) -> PennylaneAgent- Creates a
PennylaneAgentconfigured with:- Chat model:
naas_abi_marketplace.ai.chatgpt.models.gpt_4_1_mini.model - Tools: Pennylane integration tools via
as_tools(...) - Defaults:
AgentConfiguration(system_prompt=SYSTEM_PROMPT)if not providedAgentSharedState(thread_id="0")if not providedMemorySaver()for memory
- Chat model:
- Creates a
-
class PennylaneAgent(Agent)- No additional methods/attributes; inherits behavior from
naas_abi_core.services.agent.Agent.Agent.
- No additional methods/attributes; inherits behavior from
Configuration/Dependencies
- Environment/configuration:
- Uses
ABIModule.get_instance().configuration.pennylane_api_tokento build the integration configuration:PennylaneIntegrationConfiguration(api_key=pennylane_api_token)
- Uses
- Key imports:
- Core agent framework:
naas_abi_core.services.agent.Agent(Agent,AgentConfiguration,AgentSharedState,MemorySaver) - Pennylane integration:
naas_abi_marketplace.applications.pennylane.integrations.PennylaneIntegration.as_tools - Chat model:
naas_abi_marketplace.ai.chatgpt.models.gpt_4_1_mini.model
- Core agent framework:
- Constants:
NAME,DESCRIPTION,MODEL,TEMPERATURE,AVATAR_URL,SYSTEM_PROMPT- Note:
MODELandTEMPERATUREare defined but not used increate_agent().
Usage
from naas_abi_marketplace.applications.pennylane.agents.PennylaneAgent import create_agent
agent = create_agent()
# Interact using the base Agent interface (methods depend on naas_abi_core Agent implementation)
# e.g., agent.run(...) / agent.invoke(...) as supported by the Agent class.
Caveats
- If
pennylane_api_tokenis missing/invalid, the Pennylane tools may not function (the system prompt instructs users to configurePENNYLANE_API_TOKENin.env). - The exact interaction methods (e.g.,
run,invoke) are not defined here; they come from the inheritedAgentclass.