Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection 'AzureAISearch' required for flow 'copilot_promptflow' is not found. #64

Open
HosseinHeris opened this issue Dec 8, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@HosseinHeris
Copy link

Just followed the readme. Created the search index. Made sure the .env contains keys, etc related to azure search. Also made sure the yaml in contains the search index:

  • name: retrieve_documentation
    type: python
    source:
    type: code
    path: retrieve_documentation.py
    inputs:
    search: AzureAISearch
    question: ${inputs.question}
    index_name: product-info
    embedding: ${question_embedding.output}
    However, running the command for prompt flow "python src/run.py --implementation promptflow --question "what is the waterproof rating of the tent I just ordered?"" I kept receiving the following error on both my local machine and code space:
    python src/run.py --implementation promptflow --question "what is the waterproof rating of the tent I just ordered?"
    Traceback (most recent call last):
    File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/_utils.py", line 815, in get_local_connections_from_executable
    conn = client.connections.get(name=n, with_secrets=True)
    File "/usr/local/lib/python3.10/site-packages/promptflow/_telemetry/activity.py", line 138, in wrapper
    return f(self, *args, **kwargs)
    File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/operations/_connection_operations.py", line 54, in get
    orm_connection = ORMConnection.get(name, raise_error)
    File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/_orm/retry.py", line 43, in f_retry
    return f(*args, **kwargs)
    File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/_orm/connection.py", line 52, in get
    raise ConnectionNotFoundError(f"Connection {name!r} is not found.")
    promptflow._sdk._errors.ConnectionNotFoundError: Connection 'AzureAISearch' is not found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/workspaces/aistudio-copilot-sample/src/run.py", line 285, in
result = asyncio.run(
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/workspaces/aistudio-copilot-sample/src/copilot_promptflow/chat.py", line 28, in chat_completion
result = pf_client.test(flow=str(Path(file).parent.resolve()), inputs=inputs)
File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/_pf_client.py", line 234, in test
return self.flows.test(
File "/usr/local/lib/python3.10/site-packages/promptflow/_telemetry/activity.py", line 138, in wrapper
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/operations/_flow_operations.py", line 71, in test
result = self._test(
File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/operations/_flow_operations.py", line 127, in _test
return submitter.flow_test(
File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/operations/_test_submitter.py", line 152, in flow_test
connections = SubmitterHelper.resolve_connections(flow=self.flow, client=self._client)
File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/operations/_run_submitter.py", line 216, in resolve_connections
return get_local_connections_from_executable(executable=executable, client=client)
File "/usr/local/lib/python3.10/site-packages/promptflow/_sdk/_utils.py", line 819, in get_local_connections_from_executable
raise Exception(f"Connection {n!r} required for flow {executable.name!r} is not found.")
Exception: Connection 'AzureAISearch' required for flow 'copilot_promptflow' is not found.

@qubitron
Copy link
Contributor

Thanks for reporting! This is a regression that was introduced in prompt flow, we are currently working on a fix and will update this issue when we have it.

@qubitron qubitron added the bug Something isn't working label Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants