Closed liucheng-ms closed 5 days ago
12 files 12 suites 7m 23s :stopwatch: 19 tests 19 :white_check_mark: 0 :zzz: 0 :x: 228 runs 228 :white_check_mark: 0 :zzz: 0 :x:
Results for commit e20a5d01.
:recycle: This comment has been updated with latest results.
4 files 4 suites 4m 14s :stopwatch: 242 tests 204 :white_check_mark: 38 :zzz: 0 :x: 968 runs 816 :white_check_mark: 152 :zzz: 0 :x:
Results for commit e20a5d01.
:recycle: This comment has been updated with latest results.
0 tests 0 :white_check_mark: 0s :stopwatch: 0 suites 0 :zzz: 0 files 0 :x:
Results for commit e20a5d01.
:recycle: This comment has been updated with latest results.
6 tests 6 :white_check_mark: 1m 17s :stopwatch: 1 suites 0 :zzz: 1 files 0 :x:
Results for commit e20a5d01.
:recycle: This comment has been updated with latest results.
796 tests 796 :white_check_mark: 3m 44s :stopwatch: 1 suites 0 :zzz: 1 files 0 :x:
Results for commit e20a5d01.
:recycle: This comment has been updated with latest results.
245 tests 239 :white_check_mark: 5m 11s :stopwatch: 1 suites 6 :zzz: 1 files 0 :x:
Results for commit e20a5d01.
:recycle: This comment has been updated with latest results.
4 files 4 suites 1h 4m 5s :stopwatch: 722 tests 680 :white_check_mark: 42 :zzz: 0 :x: 2 888 runs 2 720 :white_check_mark: 168 :zzz: 0 :x:
Results for commit e20a5d01.
:recycle: This comment has been updated with latest results.
Description
This PR introduces an enhanced method for capturing the trace of generator output functions within the Promptflow tracing framework. In the previous approach, when a function returned a generator, the associated span would terminate, and the output would be a string representing the generator object. Subsequently, a new span would be initiated when another function consumed this generator.
With the modifications proposed in this PR, the span persists beyond the point where a function returns a generator, concluding only after the generator has been fully consumed. Consequently, the output of the span encapsulating the generator or iterator object is now a comprehensive list of the iterated objects.
These changes significantly improve the transparency and intelligibility of the tracing process for generator outputs.
Example with OpenAI Call
Consider the following code for a node:
With the changes in this PR, specifying
stream=True
yields a generator object from theclient.chat.completions.create
call.Original Implementation
openai_chat
. The first span ended when the call finished, and the output was a string representing the generator object. The second span started when the generator was consumed and ended when the generator was fully consumed.New Implementation
openai_chat
. The span ends when the generator is fully consumed.All Promptflow Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines