update
This commit is contained in:
66
src/util.jl
66
src/util.jl
@@ -284,35 +284,6 @@ timeline = createTimeline(events)
|
||||
# 2) Assistant> Hi there! with a smile
|
||||
|
||||
"""
|
||||
# function createTimeline(events::T1; eventindex::Union{UnitRange, Nothing}=nothing
|
||||
# ) where {T1<:AbstractVector}
|
||||
# # Initialize empty timeline string
|
||||
# timeline = ""
|
||||
|
||||
# # Determine which indices to use - either provided range or full length
|
||||
# ind =
|
||||
# if eventindex !== nothing
|
||||
# [eventindex...]
|
||||
# else
|
||||
# 1:length(events)
|
||||
# end
|
||||
|
||||
# # Iterate through events and format each one
|
||||
# for (i, event) in zip(ind, events)
|
||||
# # If no outcome exists, format without outcome
|
||||
# if event[:outcome] === nothing
|
||||
# timeline *= "Event_$i $(event[:subject])> $(event[:actioninput])\n"
|
||||
# # If outcome exists, include it in formatting
|
||||
# else
|
||||
# timeline *= "Event_$i $(event[:subject])> $(event[:actioninput]) $(event[:outcome])\n"
|
||||
# end
|
||||
# end
|
||||
|
||||
# # Return formatted timeline string
|
||||
# return timeline
|
||||
# end
|
||||
|
||||
|
||||
function createTimeline(events::T1; eventindex::Union{UnitRange, Nothing}=nothing
|
||||
) where {T1<:AbstractVector}
|
||||
# Initialize empty timeline string
|
||||
@@ -329,13 +300,11 @@ function createTimeline(events::T1; eventindex::Union{UnitRange, Nothing}=nothin
|
||||
# Iterate through events and format each one
|
||||
for (i, event) in zip(ind, events)
|
||||
# If no outcome exists, format without outcome
|
||||
subject = titlecase(event[:subject])
|
||||
if event[:outcome] === nothing
|
||||
|
||||
timeline *= "Event_$i) Who: $subject Action_name: $(event[:actionname]) Action_input: $(event[:actioninput])\n"
|
||||
timeline *= "Event_$i $(event[:subject])> $(event[:actioninput])\n"
|
||||
# If outcome exists, include it in formatting
|
||||
else
|
||||
timeline *= "Event_$i) Who: $subject Action_name: $(event[:actionname]) Action_input: $(event[:actioninput]) Action output: $(event[:outcome])\n"
|
||||
timeline *= "Event_$i $(event[:subject])> $(event[:actioninput]) $(event[:outcome])\n"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -344,6 +313,37 @@ function createTimeline(events::T1; eventindex::Union{UnitRange, Nothing}=nothin
|
||||
end
|
||||
|
||||
|
||||
# function createTimeline(events::T1; eventindex::Union{UnitRange, Nothing}=nothing
|
||||
# ) where {T1<:AbstractVector}
|
||||
# # Initialize empty timeline string
|
||||
# timeline = ""
|
||||
|
||||
# # Determine which indices to use - either provided range or full length
|
||||
# ind =
|
||||
# if eventindex !== nothing
|
||||
# [eventindex...]
|
||||
# else
|
||||
# 1:length(events)
|
||||
# end
|
||||
|
||||
# # Iterate through events and format each one
|
||||
# for (i, event) in zip(ind, events)
|
||||
# # If no outcome exists, format without outcome
|
||||
# subject = titlecase(event[:subject])
|
||||
# if event[:outcome] === nothing
|
||||
|
||||
# timeline *= "Event_$i) Who: $subject Action_name: $(event[:actionname]) Action_input: $(event[:actioninput])\n"
|
||||
# # If outcome exists, include it in formatting
|
||||
# else
|
||||
# timeline *= "Event_$i) Who: $subject Action_name: $(event[:actionname]) Action_input: $(event[:actioninput]) Action output: $(event[:outcome])\n"
|
||||
# end
|
||||
# end
|
||||
|
||||
# # Return formatted timeline string
|
||||
# return timeline
|
||||
# end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user