Comments (8)
I've been playing around with this test with my flow.dag.yml
and it looks like where it's falling down is in flow.py:get_connection_names() where it does not inspect the mlindex_content
.
I'm not sure if the code has changed to break this, if the generated flow.dag.yml
interface has changed or perhaps this has never worked? Or maybe I'm doing something wrong!
from promptflow.
Looks like there has been a change to this recently https://learn.microsoft.com/en-us/azure/machine-learning/prompt-flow/tools-reference/index-lookup-tool?view=azureml-api-2#how-to-migrate-from-legacy-tools-to-the-index-lookup-tool.
from promptflow.
Pretty sure you hit the same problem I did: #2876
You have to do the metadata account set manually, for whatever reason the activity is not taking the config.json file into consideration:
az login
az account set --subscription <subscription_id>
az configure --defaults group=<resource_group_name> workspace=<workspace_name>
from promptflow.
I've hardcoded a connection in the flow.dag.yml
which has got me further.
I am now getting a response of:
{"error":{"code":"UserError","message":"Execution failure in 'index_lookup': (Exception) Exception occured in search_function_construction."}}
I have also deployed this to an AML endpoint using the deploy button in AML and get the same error there.
As it stands, from what I can tell, using Azure AI Search with Prompt Flow is currently unusable unless invoked from AML Studio.
from promptflow.
The response didn't show the full error reason, you could reach the error detail from the app service's container logs.
If the error caused by connection missing, I could explain more about the connections when deploy to app service.
When deploying to Azure App service, promptflow will use connection locally ( here the locally means the connections meta stored in local sqlite ), I took a look at your flow, there are 2 connections, the AI search one and the OpenAI one. If you wanna use Azure AI connections which stored in the Azure AI project, please set the connection provider config to let promptflow fetching Azure AI connections ( you may need to add command in the container startup script, also remember to add the app service as reader roles to your AI project to access the connection keys ). Refer to here for the connection config.
from promptflow.
Usually we won't assume user is deploying app service with AzureAI connections, that will cause many problems, like the permission, the service principal role, balabala, so by default we will guide user setup connections again for there app service locally by setting the app service environment variables. The locally setup guides you could reach via the following documentation:
https://microsoft.github.io/promptflow/cloud/azureai/deploy-to-azure-appservice.html#view-and-test-the-web-app
from promptflow.
Heya, thanks for your response! Unfortunately, even after setting the connection.provider=local
setting, it does not pick up the AI Search connection unless I manually add it to the flow.dag.yaml
.
Regarding the Exception occured in search_function_construction
error. I get this both locally and when the flow is deployed as an AML endpoint. Here is the exception from the logs:
[2024-05-21 07:14:14,056][flowinvoker][ERROR] - Flow run failed with error: {'message': "Execution failure in 'index_lookup': (Exception) Exception occured in search_function_construction.", 'messageFormat': "Execution failure in '{node_name}'.", 'messageParameters': {'node_name': 'index_lookup'}, 'referenceCode': 'Tool/promptflow_vectordb.tool.common_index_lookup', 'code': 'UserError', 'innerError': {'code': 'ToolExecutionError', 'innerError': None}, 'additionalInfo': [{'type': 'ToolExecutionErrorDetails', 'info': {'type': 'Exception', 'message': 'Exception occured in search_function_construction.', 'traceback': 'Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py", line 18, in measure_execution_time
yield
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 54, in _get_search_func
search_func = build_search_func(index, top_k, query_type)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup_extensions/utils.py", line 37, in build_search_func
store = index.as_langchain_vectorstore()
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/azureml/rag/mlindex.py", line 212, in as_langchain_vectorstore
return azuresearch.AzureSearch(
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/langchain_community/vectorstores/azuresearch.py", line 268, in __init__
self.client = _get_search_client(
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/langchain_community/vectorstores/azuresearch.py", line 84, in _get_search_client
from azure.search.documents.indexes.models import (
ImportError: cannot import name \'ExhaustiveKnnAlgorithmConfiguration\' from \'azure.search.documents.indexes.models\' (/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/azure/search/documents/indexes/models/__init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/tracing/_trace.py", line 470, in wrapped
output = func(*args, **kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/core/logging/utils.py", line 98, in wrapper
res = func(*args, **kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 125, in search
search_func = _get_search_func(mlindex_content, top_k, query_type)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 54, in _get_search_func
search_func = build_search_func(index, top_k, query_type)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py", line 21, in measure_execution_time
raise Exception(error_msg) from e
Exception: Exception occured in search_function_construction.
', 'filename': '/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py', 'lineno': 21, 'name': 'measure_execution_time'}}], 'debugInfo': {'type': 'ToolExecutionError', 'message': "Execution failure in 'index_lookup': (Exception) Exception occured in search_function_construction.", 'stackTrace': '
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/flow_executor.py", line 1008, in _exec
output, aggregation_inputs = self._exec_inner_with_trace(
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/flow_executor.py", line 913, in _exec_inner_with_trace
output, nodes_outputs = self._traverse_nodes(inputs, context)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/flow_executor.py", line 1189, in _traverse_nodes
nodes_outputs, bypassed_nodes = self._submit_to_scheduler(context, inputs, batch_nodes)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/flow_executor.py", line 1244, in _submit_to_scheduler
return scheduler.execute(self._line_timeout_sec)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/_flow_nodes_scheduler.py", line 131, in execute
raise e
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/_flow_nodes_scheduler.py", line 113, in execute
self._dag_manager.complete_nodes(self._collect_outputs(completed_futures))
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/_flow_nodes_scheduler.py", line 160, in _collect_outputs
each_node_result = each_future.result()
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/executor/_flow_nodes_scheduler.py", line 181, in _exec_single_node_in_thread
result = context.invoke_tool(node, f, kwargs=kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/_core/flow_execution_context.py", line 90, in invoke_tool
result = self._invoke_tool_inner(node, f, kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/_core/flow_execution_context.py", line 206, in _invoke_tool_inner
raise ToolExecutionError(node_name=node_name, module=module) from e
', 'innerException': {'type': 'Exception', 'message': 'Exception occured in search_function_construction.', 'stackTrace': '
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/_core/flow_execution_context.py", line 182, in _invoke_tool_inner
return f(**kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow/tracing/_trace.py", line 470, in wrapped
output = func(*args, **kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/core/logging/utils.py", line 98, in wrapper
res = func(*args, **kwargs)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 125, in search
search_func = _get_search_func(mlindex_content, top_k, query_type)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 54, in _get_search_func
search_func = build_search_func(index, top_k, query_type)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/contextlib.py", line 137, in __exit__
self.gen.throw(typ, value, traceback)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py", line 21, in measure_execution_time
raise Exception(error_msg) from e
', 'innerException': {'type': 'ImportError', 'message': "cannot import name 'ExhaustiveKnnAlgorithmConfiguration' from 'azure.search.documents.indexes.models' (/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/azure/search/documents/indexes/models/__init__.py)", 'stackTrace': 'Traceback (most recent call last):
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/utils/profiling.py", line 18, in measure_execution_time
yield
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup.py", line 54, in _get_search_func
search_func = build_search_func(index, top_k, query_type)
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/promptflow_vectordb/tool/common_index_lookup_extensions/utils.py", line 37, in build_search_func
store = index.as_langchain_vectorstore()
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/azureml/rag/mlindex.py", line 212, in as_langchain_vectorstore
return azuresearch.AzureSearch(
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/langchain_community/vectorstores/azuresearch.py", line 268, in __init__
self.client = _get_search_client(
File "/azureml-envs/prompt-flow/runtime/lib/python3.9/site-packages/langchain_community/vectorstores/azuresearch.py", line 84, in _get_search_client
from azure.search.documents.indexes.models import (
', 'innerException': None}}}}
from promptflow.
Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!
from promptflow.
Related Issues (20)
- [Feature Request] Visualizing the evaluations should look different from the promptflow traces, should provide some kind of data visualization HOT 5
- [BUG] [VSCode Extension] Not able to import modules outside of the flow directory HOT 3
- [BUG] KeyError thrown due to environment variables not persisting when calling the promptflow endpoint
- Support remote tracing for CMK-enabled ML workspaces HOT 1
- [BUG]calling pf_client.run inside the callable target function for evaluate got "Error: (AssertionError) daemonic processes are not allowed to have children." HOT 2
- Lisence issue for the dependency on docutils(GPL 3.0) HOT 4
- [BUG] ValueError: Missing required inputs for target : ['question'] while using evalutor_config HOT 3
- [Performance] how to disable all dump, for ex. _node_run_postprocess in run_tracker.py HOT 1
- [BUG] Evaluator respond with Nan values as the first token is a text HOT 1
- [Feature Request] pass addition inputs to target function when using the evaluate method HOT 2
- [Feature Request] Have option to return trace as part of out put of a PromptFlow when deployed as endpoint HOT 11
- [BUG] Running evaluate from promptflow.evals.evaluate and setting trace.destination="none" or "local" causes evaluations to not be available
- [BUG] prompt eval method does not take credential and creates PFClient without passing in credential HOT 1
- [BUG] Tracing Contextvar reset HOT 4
- Failed to load trace[BUG] HOT 3
- [BUG] Flow is not enabled HOT 1
- [BUG]evaluator keeps failing with promptflow-eval 0.3.1 but works with 0.3.0 HOT 3
- [BUG] Race condition with global state in process pool HOT 2
- [FeatureAsk] Instantiating a model config for Azure OAI using AAD instead of `api_key` HOT 5
- [Contribution Request] Integrate Unify into Promptflow HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promptflow.