promptflow.rag.config 模块#

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

基类:object

用于创建 Azure AI 搜索索引的配置类。

参数:
  • ai_search_index_name (Optional[str]) – Azure AI 搜索索引的名称。

  • ai_search_connection_id – Azure AI 搜索连接配置。

  • ai_search_connection_id – Azure AI 搜索索引的名称。

get_connection_id() Optional[str]#

从连接配置或连接 ID 获取连接 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)#

基类: IndexDataSource

用于从 OpenAI <thing> 创建 ML 索引的配置类。

参数:
  • ai_search_index_name (str) – 用作源的 Azure AI 搜索索引的名称。

  • ai_search_content_key (str) – Azure AI 搜索索引中内容字段的键。

  • ai_search_embedding_key (str) – Azure AI 搜索索引中嵌入字段的键。

  • ai_search_title_key (str) – Azure AI 搜索索引中标题字段的键。

  • ai_search_metadata_key (str) – Azure AI 搜索索引中元数据字段的键。

  • ai_search_connection_id (str) – Azure AI 搜索索引的连接 ID。

  • num_docs_to_import (int) – 从现有 Azure AI 搜索索引导入的文档数量。默认为 50。

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

基类:object

连接的配置类。

参数:
  • subscription (str) – 连接的订阅。

  • resource_group (str) – 连接的资源组。

  • workspace (str) – 连接的工作区。

  • connection_name (str) – 连接名称。

build_connection_id() str#

从连接配置构建连接 ID

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)#

基类:object

嵌入模型的配置类。

参数:
  • model_name (Optional[str]) – 嵌入模型的名称。

  • deployment_name (Optional[str]) – 嵌入模型的部署名称。

  • connection_id (Optional[str]) – 嵌入模型的连接 ID。

  • connection_config (Optional[ConnectionConfig]) – 嵌入模型的连接配置。

get_connection_id() Optional[str]#

从连接配置或连接 ID 获取连接 ID

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

基类: IndexDataSource

用于从 Git 存储库中文件创建 ML 索引的配置类。

参数:
  • git_url (str) – 要使用的存储库链接。

  • git_branch_name (str) – 要从目标存储库使用的分支名称。

  • git_connection_id (str) – GitHub 的连接 ID。

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

基类:object

定义将处理成 ML 索引的数据的配置的基类。不应直接实例化此类。请改用其子类之一。

参数:

input_type (Union[str, IndexInputType]) – 描述索引源的类型枚举。用于避免直接类型检查。

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

基类: IndexDataSource

用于从本地文件集合创建 ML 索引的配置类。

参数:

input_data (str) – 索引源文件本地位置的输入字符串。