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ΒΆ

ChatGPTPluginRetrieverConfig

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:

RetrieverType

plugin_urlΒΆ

URL of the ChatGPT plugin.

Type:

str

api_keyΒΆ

API key for plugin authentication.

Type:

Optional[SecretStr]

plugin_nameΒΆ

Name of the plugin.

Type:

str

top_kΒΆ

Number of results to retrieve.

Type:

int

aiopg_dsnΒΆ

Database connection string for plugin data.

Type:

Optional[str]

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"
... )
get_input_fields()[source]ΒΆ

Return input field definitions for ChatGPT Plugin retriever.

Return type:

dict[str, tuple[type, Any]]

get_output_fields()[source]ΒΆ

Return output field definitions for ChatGPT Plugin retriever.

Return type:

dict[str, tuple[type, Any]]

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.