microsoft / microsoft/promptflow
[Feature Request] Promptflow can't save some node output when exception happens
Open
@D-W- is already working on this.
Since May 6, 2024.
enhancement
long-term
- Dominant language
- Python
- Stars
- 11.2k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.