promptflow.rag.config module#

class promptflow.rag.config.AzureAISearchConfig(*, ai_search_index_name: Optional[str] = None, ai_search_connection_config: Optional[ConnectionConfig] = None, connection_id: Optional[str] = None)#

Bases: object

Config class for creating an Azure AI Search index.

Parameters:
  • ai_search_index_name (Optional[str]) – The name of the Azure AI Search index.

  • ai_search_connection_id – The Azure AI Search connection Config.

  • ai_search_connection_id – The name of the Azure AI Search index.

get_connection_id() Optional[str]#

Get connection id from connection config or connection id

class promptflow.rag.config.AzureAISearchSource(*, ai_search_index_name: str, ai_search_content_key: str, ai_search_embedding_key: str, ai_search_title_key: str, ai_search_metadata_key: str, ai_search_connection_id: Optional[str] = None, num_docs_to_import: int = 50)#

Bases: IndexDataSource

Config class for creating an ML index from an OpenAI <thing>.

Parameters:
  • ai_search_index_name (str) – The name of the Azure AI Search index to use as the source.

  • ai_search_content_key (str) – The key for the content field in the Azure AI Search index.

  • ai_search_embedding_key (str) – The key for the embedding field in the Azure AI Search index.

  • ai_search_title_key (str) – The key for the title field in the Azure AI Search index.

  • ai_search_metadata_key (str) – The key for the metadata field in the Azure AI Search index.

  • ai_search_connection_id (str) – The connection ID for the Azure AI Search index.

  • num_docs_to_import (int) – Number of documents to import from the existing Azure AI Search index. Defaults to 50.

class promptflow.rag.config.ConnectionConfig(*, subscription_id: str, resource_group_name: str, workspace_name: str, connection_name: str)#

Bases: object

Config class for connection.

Parameters:
  • subscription (str) – The subscription of a connection.

  • resource_group (str) – The resource group of a connection.

  • workspace (str) – The workspace of a connection.

  • connection_name (str) – The connection name.

build_connection_id() str#

Construct connection id from connection config

class promptflow.rag.config.EmbeddingsModelConfig(*, model_name: Optional[str] = None, deployment_name: Optional[str] = None, connection_id: Optional[str] = None, connection_config: Optional[ConnectionConfig] = None)#

Bases: object

Config class for a embedding model.

Parameters:
  • model_name (Optional[str]) – The name of the embedding model.

  • deployment_name (Optional[str]) – The deployment_name for the embedding model.

  • connection_id (Optional[str]) – The connection id for the embedding model.

  • connection_config (Optional[ConnectionConfig]) – The connection configuration for the embedding model.

get_connection_id() Optional[str]#

Get connection id from connection config or connection id

class promptflow.rag.config.GitSource(*, git_url: str, git_branch_name: str, git_connection_id: str)#

Bases: IndexDataSource

Config class for creating an ML index from files located in a git repository.

Parameters:
  • git_url (str) – A link to the repository to use.

  • git_branch_name (str) – The name of the branch to use from the target repository.

  • git_connection_id (str) – The connection ID for GitHub

class promptflow.rag.config.IndexDataSource(*, input_type: Union[str, IndexInputType])#

Bases: object

Base class for configs that define data that will be processed into an ML index. This class should not be instantiated directly. Use one of its child classes instead.

Parameters:

input_type (Union[str, IndexInputType]) – A type enum describing the source of the index. Used to avoid direct type checking.

class promptflow.rag.config.LocalSource(*, input_data: str)#

Bases: IndexDataSource

Config class for creating an ML index from a collection of local files.

Parameters:

input_data (str) – An input string for the local location of index source files.