haive.core.engine.retriever.providers.ChatGPTPluginRetrieverConfigΒΆ
ChatGPT Plugin Retriever implementation for the Haive framework.
from typing import Any This module provides a configuration class for the ChatGPT Plugin retriever, which integrates with ChatGPT plugins to retrieve information from external services and APIs. This enables access to real-time data and specialized knowledge sources through the ChatGPT plugin ecosystem.
The ChatGPTPluginRetriever works by: 1. Connecting to ChatGPT plugin APIs 2. Making requests to plugin endpoints 3. Processing plugin responses into documents 4. Supporting various plugin types and formats
This retriever is particularly useful when: - Integrating with existing ChatGPT plugins - Need access to real-time external data - Want to leverage specialized plugin knowledge - Building systems that use plugin ecosystems - Accessing services through plugin interfaces
The implementation integrates with LangChainβs ChatGPTPluginRetriever while providing a consistent Haive configuration interface.
ClassesΒΆ
Configuration for ChatGPT Plugin retriever in the Haive framework. |
Module ContentsΒΆ
- class haive.core.engine.retriever.providers.ChatGPTPluginRetrieverConfig.ChatGPTPluginRetrieverConfig[source]ΒΆ
Bases:
haive.core.common.mixins.secure_config.SecureConfigMixin
,haive.core.engine.retriever.retriever.BaseRetrieverConfig
Configuration for ChatGPT Plugin retriever in the Haive framework.
This retriever integrates with ChatGPT plugins to access external services and data sources through the plugin ecosystem.
- retriever_typeΒΆ
The type of retriever (always CHATGPT_PLUGIN).
- Type:
- api_keyΒΆ
API key for plugin authentication.
- Type:
Optional[SecretStr]
Examples
>>> from haive.core.engine.retriever import ChatGPTPluginRetrieverConfig >>> >>> # Create the ChatGPT Plugin retriever config >>> config = ChatGPTPluginRetrieverConfig( ... name="chatgpt_plugin_retriever", ... plugin_url="https://api.example-plugin.com", ... plugin_name="ExamplePlugin", ... top_k=10 ... ) >>> >>> # Instantiate and use the retriever >>> retriever = config.instantiate() >>> docs = retriever.get_relevant_documents("latest product information") >>> >>> # Example with database connection >>> db_config = ChatGPTPluginRetrieverConfig( ... name="db_chatgpt_plugin_retriever", ... plugin_url="https://api.db-plugin.com", ... plugin_name="DatabasePlugin", ... aiopg_dsn="postgresql://user:pass@host:port/db" ... )
- instantiate()[source]ΒΆ
Create a ChatGPT Plugin retriever from this configuration.
- Returns:
Instantiated retriever ready for plugin integration.
- Return type:
ChatGPTPluginRetriever
- Raises:
ImportError β If required packages are not available.
ValueError β If plugin configuration is invalid.