Azure / Azure/aistudio-copilot-sample

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

Open
#64 1 comment 0 reactions 1 assignee Claimed by @lebaro-msft View on GitHub
bug
Dominant language
Python
Stars
321
Forks
192
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.