This commit is contained in:
narawat lamaiin
2024-12-09 20:29:28 +07:00
parent 159d1717a4
commit d4895a728d
27 changed files with 7742 additions and 4002 deletions

View File

@@ -1,103 +1,103 @@
module SQLLLM
# export
""" Order by dependencies of each file. The 1st included file must not depend on any other
files and each file can only depend on the file included before it.
"""
include("type.jl")
using .type
include("util.jl")
using .util
include("llmfunction.jl")
using .llmfunction
include("interface.jl")
using .interface
# ---------------------------------------------- 100 --------------------------------------------- #
end # module SQLLLM
module SQLLLM
# export
""" Order by dependencies of each file. The 1st included file must not depend on any other
files and each file can only depend on the file included before it.
"""
include("type.jl")
using .type
include("util.jl")
using .util
include("llmfunction.jl")
using .llmfunction
include("interface.jl")
using .interface
# ---------------------------------------------- 100 --------------------------------------------- #
end # module SQLLLM

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,81 +1,81 @@
module type
module type
end # module type

View File

@@ -1,116 +1,80 @@
module util
export getDataFrameValue, dfRowtoString, dfToString
using DataFrames
""" get a value from a dataframe row by a given key
"""
getDataFrameValue(row::DataFrameRow, key::Symbol) = row.:($key)
""" convert df row into key:value string
"""
function dfRowtoString(row::DataFrameRow)::String
str = ""
for key in keys(row)
value = getDataFrameValue(row, key)
str *= "$key: $value, "
end
result = str[1:end-2] # remove ", " at the end of row
return result
end
""" convert df table into string
"""
function dfToString(df::DataFrame)
dfstr = ""
for (i, row) in enumerate(eachrow(df))
rowstr = dfRowtoString(row)
dfstr *= "$i) $rowstr\n"
end
return dfstr
end
module util
end # module util