[功能请求]当异常发生时,Promptflow无法保存某些节点输出,

dojqjjoe  于 2个月前  发布在  其他
关注(0)|答案(1)|浏览(35)

您的功能请求是否与问题相关?请描述。

当从 run as a function 发生异常时,例如 content management policy 触发的异常导致所有节点输出丢失:

f = load_flow(source="../../examples/flows/chat/chat-basic/")
f.context.streaming = True
try:
  result = f(
      chat_history=[
          {
              "inputs": {"chat_input": "Hi"},
              "outputs": {"chat_output": "Hello! How can I assist you today?"},
          }
      ],
      question="How are you?",
  )
except WrappedOpenAIError as exc:
  # we lost succeeded node output as well
  pass

answer = ""
# the result will be a generator, iterate it to get the result
for r in result["answer"]:
    answer += r

描述您希望的解决方案

当发生异常时,我们是否可以将某些节点输出保存在某个地方?例如:node1->node2->node3 当 node2 触发异常时,我们仍然可以从 node1 获得输出吗?

描述您考虑过的替代方案

不确定

附加上下文

不确定

332nm8kg

332nm8kg1#

你好,@vhan2kpmg ,我们目前将流程建模为函数特征,就像调用函数一样。这意味着在调用流程函数时,不会持久化中间数据。我们近期内不会改变它的行为。我已经添加了一个长期标签来跟踪这个问题。

相关问题