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

[Feature Request] Promptflow can't save some node output when exception happens #3100

Open
vhan2kpmg opened this issue May 2, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request long-term

Comments

@vhan2kpmg
Copy link

vhan2kpmg commented May 2, 2024

Is your feature request related to a problem? Please describe.
At the moment when exception happens from run as a function, for example, content management policy exception triggered all nodes output are lost:

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

Describe the solution you'd like
when exception happens can we have some nodes output saved somewhere? for example: node1->node2->node3 when node2 triggers exception we can still have output from node1?

Describe alternatives you've considered
Not sure

Additional context
Not sure

@vhan2kpmg vhan2kpmg added the enhancement New feature or request label May 2, 2024
@D-W- D-W- self-assigned this May 6, 2024
@D-W- D-W- added the long-term label May 6, 2024
@D-W-
Copy link
Contributor

D-W- commented May 6, 2024

Hi @vhan2kpmg , we currently model flow-as-function feature like a function call. Which means when calling the flow function, no intermedia data will be persisted. We won't change its behavior in near future. I've added a long term tag to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request long-term
Projects
None yet
Development

No branches or pull requests

2 participants