This commit is contained in:
2025-01-04 16:10:23 +07:00
parent 82167fe006
commit cff0d31ae6
4 changed files with 349 additions and 443 deletions

View File

@@ -169,11 +169,38 @@ function vectorOfDictToText(vecd::Vector; withkey=true)::String
end
# function eventdict(;
# event_description::Union{String, Nothing}=nothing,
# timestamp::Union{DateTime, Nothing}=nothing,
# subject::Union{String, Nothing}=nothing,
# action_or_dialogue::Union{String, Nothing}=nothing,
# location::Union{String, Nothing}=nothing,
# equipment_used::Union{String, Nothing}=nothing,
# material_used::Union{String, Nothing}=nothing,
# outcome::Union{String, Nothing}=nothing,
# note::Union{String, Nothing}=nothing,
# )
# return Dict{Symbol, Any}(
# :event_description=> event_description,
# :timestamp=> timestamp,
# :subject=> subject,
# :action_or_dialogue=> action_or_dialogue,
# :location=> location,
# :equipment_used=> equipment_used,
# :material_used=> material_used,
# :outcome=> outcome,
# :note=> note,
# )
# end
function eventdict(;
event_description::Union{String, Nothing}=nothing,
timestamp::Union{DateTime, Nothing}=nothing,
subject::Union{String, Nothing}=nothing,
action_or_dialogue::Union{String, Nothing}=nothing,
thought::Union{AbstractDict, Nothing}=nothing,
actionname::Union{String, Nothing}=nothing, # "CHAT", "CHECKINVENTORY", "PRESENTBOX", etc
actioninput::Union{String, Nothing}=nothing,
location::Union{String, Nothing}=nothing,
equipment_used::Union{String, Nothing}=nothing,
material_used::Union{String, Nothing}=nothing,
@@ -184,7 +211,9 @@ function eventdict(;
:event_description=> event_description,
:timestamp=> timestamp,
:subject=> subject,
:action_or_dialogue=> action_or_dialogue,
:thought=> thought,
:actionname=> actionname,
:actioninput=> actioninput,
:location=> location,
:equipment_used=> equipment_used,
:material_used=> material_used,
@@ -193,8 +222,6 @@ function eventdict(;
)
end
# """ Convert a single chat dictionary into LLM model instruct format.
# # Llama 3 instruct format example