Failed to load package tool 'Vector Index Lookup': (ModuleNotFoundError) No module named 'promptflow.runtime'

798 Views Asked by At

I am trying to test a Flow from Azure promptflow via VSCode (my flow from the Azure Promptflow interface worked) to build a : "Bring Your Own Data Chat QnA"

When I run the command :

pf flow test --flow <flow-name>

I get this error : Flow test failed with ResolveToolError: Tool load failed in 'search_question_from_indexed_docs': (ToolLoadError) Failed to load package tool 'Vector Index Lookup': (ModuleNotFoundError) No module named 'promptflow.runtime'

Here is my flow model : Chat with my own data

Maybe It's the fact that I don't use compute locally, I don't know I did a lot of reseach but found nothing. Thx for helping.

here is my flow.dag.yaml :

nodes:
- name: embed_the_question
  type: python
  source:
    type: package
    tool: promptflow.tools.embedding.embedding
  inputs:
    connection: ******
    deployment_name: *******
    input: ${inputs.chat_input}
  use_variants: false
- name: search_question_from_indexed_docs
  type: python
  source:
    type: package
    tool: promptflow_vectordb.tool.vector_index_lookup.VectorIndexLookup.search
  inputs:
    path: ******
    query: ${embed_the_question.output}
    top_k: 2
  use_variants: false
  aggregation: false
- name: generate_prompt_context
  type: python
  source:
    type: code
    path: generate_prompt_context.py
  inputs:
    search_result: ${search_question_from_indexed_docs.output}
  use_variants: false
- name: Prompt_variants
  use_variants: true
- name: chat_with_context
  type: llm
  source:
    type: code
    path: chat_with_context.jinja2
  inputs:
    deployment_name: ******
    temperature: 0
    top_p: 1
    max_tokens: 1000
    presence_penalty: 0
    frequency_penalty: 0
    prompt_text: ${Prompt_variants.output}
  provider: AzureOpenAI
  connection: ********
  api: chat
  module: promptflow.tools.aoai
  use_variants: false
node_variants:
  Prompt_variants:
    default_variant_id: variant_0
    variants:
      variant_0:
        node:
          type: prompt
          source:
            type: code
            path: Prompt_variants.jinja2
          inputs:
            contexts: ${generate_prompt_context.output}
            chat_history: ${inputs.chat_history}
            chat_input: ${inputs.chat_input}
      variant_1:
        node:
          type: prompt
          source:
            type: code
            path: Prompt_variants__variant_1.jinja2
          inputs:
            chat_input: ${inputs.chat_input}
            contexts: ${generate_prompt_context.output}
            chat_history: ${inputs.chat_history}
      variant_2:
        node:
          type: prompt
          source:
            type: code
            path: Prompt_variants__variant_2.jinja2
          inputs:
            contexts: ${generate_prompt_context.output}
            chat_history: ${inputs.chat_history}
            chat_input: ${inputs.chat_input}

I tried to look out if there was any package like promptflow.runtime but no. I try to use the visual editor, nothing more.

0

There are 0 best solutions below