Skip to content

API Reference parrot.advisors.mixin

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.advisors.mixin

View source

Alias AbstractStore

Re-exported from parrot.stores.abstract.AbstractStore.

Alias AbstractTool

Re-exported from parrot.tools.abstract.AbstractTool.

Alias ApplyCriteriaTool

Re-exported from parrot.advisors.tools.ApplyCriteriaTool.

Alias CompareProductsTool

Re-exported from parrot.advisors.tools.CompareProductsTool.

Alias GetCurrentStateTool

Re-exported from parrot.advisors.tools.GetCurrentStateTool.

Alias GetNextQuestionTool

Re-exported from parrot.advisors.tools.GetNextQuestionTool.

Alias GetProductDetailsTool

Re-exported from parrot.advisors.tools.GetProductDetailsTool.

Class ProductAdvisorMixin

Mixin that adds product selection wizard capabilities to any Bot/Agent.

Features:

  • Guided product selection through discriminant questions
  • State management with Redis
  • Undo/redo support via Memento pattern
  • Works with VoiceBot and text chatbots
Parameter Type Default Description
*args ()
catalog Optional[ProductCatalog] None Pre-configured ProductCatalog
catalog_id str 'default' Identifier for multi-tenant catalogs
vector_store Optional[AbstractStore] None Vector store for product embeddings
selection_manager Optional[SelectionStateManager] None Custom state manager (uses default Redis if None)
question_set Optional[QuestionSet] None Pre-generated questions (generates if None)
auto_register_tools bool True Whether to auto-register advisor tools
**kwargs {}

Attributes:

Attribute Type Description
product_catalog Optional[ProductCatalog] Access the product catalog.
selection_manager Optional[SelectionStateManager] Access the selection state manager.

Method ProductAdvisorMixin.configure_advisor

Configure the product advisor components.

Call this after bot.configure() or override configure() to call it.

configure_advisor(catalog: Optional[ProductCatalog] = None, question_set: Optional[QuestionSet] = None) -> None

Parameter Type Default Description
catalog Optional[ProductCatalog] None
question_set Optional[QuestionSet] None

Method ProductAdvisorMixin.start_product_selection

Start a new product selection session.

Returns welcome message with first question.

start_product_selection(user_id: str, session_id: str, category: Optional[str] = None) -> str

Parameter Type Default Description
user_id str
session_id str
category Optional[str] None

Returns: str

Method ProductAdvisorMixin.undo_last_answer

Undo the last answer and restore previous state.

undo_last_answer(user_id: str, session_id: str) -> str

Parameter Type Default Description
user_id str
session_id str

Returns: str

Alias ProductCatalog

Re-exported from parrot.advisors.catalog.ProductCatalog.

Alias QuestionSet

Re-exported from parrot.advisors.questions.QuestionSet.

Alias RecommendProductTool

Re-exported from parrot.advisors.tools.RecommendProductTool.

Alias SearchProductsTool

Re-exported from parrot.advisors.tools.SearchProductsTool.

Alias SelectionStateManager

Re-exported from parrot.advisors.manager.SelectionStateManager.

Alias ShowProductImageTool

Re-exported from parrot.advisors.tools.ShowProductImageTool.

Alias StartSelectionTool

Re-exported from parrot.advisors.tools.StartSelectionTool.

Alias UndoSelectionTool

Re-exported from parrot.advisors.tools.UndoSelectionTool.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally