aistudio-copilot-sample icon indicating copy to clipboard operation
aistudio-copilot-sample copied to clipboard

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

Open HosseinHeris opened this issue 1 year ago • 1 comments
trafficstars

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.

HosseinHeris avatar Dec 08 '23 00:12 HosseinHeris

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 avatar Dec 11 '23 20:12 qubitron