Skip to content

Commit 7b39518

Browse files
committed
AbstractDict generalization
1 parent 3864e1d commit 7b39518

File tree

3 files changed

+38
-51
lines changed

3 files changed

+38
-51
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "UniLM"
22
uuid = "2a65a866-de6b-4bc8-8daf-c130204fdf93"
33
authors = ["Marius Fersigan <[email protected]> and contributors"]
4-
version = "0.5.2"
4+
version = "0.5.3"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"

src/api.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@kwdef mutable struct GPTFunctionSignature
22
name::String
33
description::Union{String,Nothing} = nothing
4-
parameters::Union{Dict,Nothing} = nothing
4+
parameters::Union{AbstractDict,Nothing} = nothing
55
end
66

77
StructTypes.StructType(::Type{GPTFunctionSignature}) = StructTypes.Struct()
@@ -27,7 +27,7 @@ end
2727

2828
struct GPTFunction
2929
name::String
30-
arguments::Dict{String,String}
30+
arguments::AbstractDict{String,String}
3131
end
3232

3333
StructTypes.StructType(::Type{GPTFunction}) = StructTypes.CustomStruct()
@@ -124,14 +124,14 @@ iscall(m::Message) = m.role == RoleTool
124124
struct JsonSchemaAPI
125125
name::String
126126
description::String
127-
schema::Dict
127+
schema::AbstractDict
128128
end
129129

130130
StructTypes.StructType(::Type{JsonSchemaAPI}) = StructTypes.Struct()
131131

132132
struct ResponseFormat
133133
type::String
134-
json_schema::Union{JsonSchemaAPI,Dict,Nothing}
134+
json_schema::Union{JsonSchemaAPI,AbstractDict,Nothing}
135135
ResponseFormat() = new("json_object", nothing)
136136
ResponseFormat(json_schema) = new("json_schema", json_schema)
137137
end
@@ -172,7 +172,7 @@ Creates a new `Chat` object with default settings:
172172
presence_penalty::Union{Float64,Nothing} = nothing # -2.0 - 2.0
173173
response_format::Union{ResponseFormat,Nothing} = nothing
174174
frequency_penalty::Union{Float64,Nothing} = nothing # -2.0 - 2.0
175-
logit_bias::Union{Dict{String,Float64},Nothing} = nothing
175+
logit_bias::Union{AbstractDict{String,Float64},Nothing} = nothing
176176
user::Union{String,Nothing} = nothing
177177
seed::Union{Int64,Nothing} = nothing
178178
function Chat(

test/Manifest.toml

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.11.1"
3+
julia_version = "1.11.3"
44
manifest_format = "2.0"
55
project_hash = "b26e740fbd18195a80b86c0494e5eda92dadc1ff"
66

77
[[deps.Accessors]]
8-
deps = ["CompositionsBase", "ConstructionBase", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown"]
9-
git-tree-sha1 = "b392ede862e506d451fc1616e79aa6f4c673dab8"
8+
deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "MacroTools"]
9+
git-tree-sha1 = "0ba8f4c1f06707985ffb4804fdad1bf97b233897"
1010
uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
11-
version = "0.1.38"
11+
version = "0.1.41"
1212

1313
[deps.Accessors.extensions]
14-
AccessorsAxisKeysExt = "AxisKeys"
15-
AccessorsDatesExt = "Dates"
16-
AccessorsIntervalSetsExt = "IntervalSets"
17-
AccessorsStaticArraysExt = "StaticArrays"
18-
AccessorsStructArraysExt = "StructArrays"
19-
AccessorsTestExt = "Test"
20-
AccessorsUnitfulExt = "Unitful"
14+
AxisKeysExt = "AxisKeys"
15+
IntervalSetsExt = "IntervalSets"
16+
LinearAlgebraExt = "LinearAlgebra"
17+
StaticArraysExt = "StaticArrays"
18+
StructArraysExt = "StructArrays"
19+
TestExt = "Test"
20+
UnitfulExt = "Unitful"
2121

2222
[deps.Accessors.weakdeps]
2323
AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5"
24-
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
2524
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
25+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2626
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
2727
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2828
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
@@ -31,9 +31,9 @@ version = "0.1.38"
3131

3232
[[deps.Aqua]]
3333
deps = ["Compat", "Pkg", "Test"]
34-
git-tree-sha1 = "49b1d7a9870c87ba13dc63f8ccfcf578cb266f95"
34+
git-tree-sha1 = "500941611ff835a025f484f55836f6feea61720a"
3535
uuid = "4c88cf16-eb10-579e-8560-4a9242c79595"
36-
version = "0.8.9"
36+
version = "0.8.11"
3737

3838
[[deps.ArgTools]]
3939
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
@@ -58,15 +58,13 @@ deps = ["TOML", "UUIDs"]
5858
git-tree-sha1 = "8ae8d32e09f0dcf42a36b90d4e17f5dd2e4c4215"
5959
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
6060
version = "4.16.0"
61-
weakdeps = ["Dates", "LinearAlgebra"]
6261

6362
[deps.Compat.extensions]
6463
CompatLinearAlgebraExt = "LinearAlgebra"
6564

66-
[[deps.CompilerSupportLibraries_jll]]
67-
deps = ["Artifacts", "Libdl"]
68-
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
69-
version = "1.1.1+0"
65+
[deps.Compat.weakdeps]
66+
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
67+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
7068

7169
[[deps.CompositionsBase]]
7270
git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad"
@@ -122,14 +120,14 @@ weakdeps = ["Dates", "Test"]
122120
InverseFunctionsTestExt = "Test"
123121

124122
[[deps.JET]]
125-
deps = ["CodeTracking", "InteractiveUtils", "JuliaInterpreter", "LoweredCodeUtils", "MacroTools", "Pkg", "PrecompileTools", "Preferences", "Test"]
126-
git-tree-sha1 = "5c5ac91e775b585864015c5c1703cee283071a47"
123+
deps = ["CodeTracking", "InteractiveUtils", "JuliaInterpreter", "JuliaSyntax", "LoweredCodeUtils", "MacroTools", "Pkg", "PrecompileTools", "Preferences", "Test"]
124+
git-tree-sha1 = "a453c9b3320dd73f5b05e8882446b6051cb254c4"
127125
uuid = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
128-
version = "0.9.12"
126+
version = "0.9.18"
129127

130128
[deps.JET.extensions]
131129
JETCthulhuExt = "Cthulhu"
132-
ReviseExt = "Revise"
130+
JETReviseExt = "Revise"
133131

134132
[deps.JET.weakdeps]
135133
Cthulhu = "f68482b8-f384-11e8-15f7-abe071a5a75f"
@@ -149,9 +147,14 @@ version = "1.14.1"
149147

150148
[[deps.JuliaInterpreter]]
151149
deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"]
152-
git-tree-sha1 = "2984284a8abcfcc4784d95a9e2ea4e352dd8ede7"
150+
git-tree-sha1 = "4bf4b400a8234cff0f177da4a160a90296159ce9"
153151
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
154-
version = "0.9.36"
152+
version = "0.9.41"
153+
154+
[[deps.JuliaSyntax]]
155+
git-tree-sha1 = "937da4713526b96ac9a178e2035019d3b78ead4a"
156+
uuid = "70703baa-626e-46a2-a12c-08ffd08c73b4"
157+
version = "0.4.10"
155158

156159
[[deps.LibCURL]]
157160
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
@@ -182,26 +185,20 @@ version = "1.11.0+1"
182185
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
183186
version = "1.11.0"
184187

185-
[[deps.LinearAlgebra]]
186-
deps = ["Libdl", "OpenBLAS_jll", "libblastrampoline_jll"]
187-
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
188-
version = "1.11.0"
189-
190188
[[deps.Logging]]
191189
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
192190
version = "1.11.0"
193191

194192
[[deps.LoweredCodeUtils]]
195193
deps = ["JuliaInterpreter"]
196-
git-tree-sha1 = "260dc274c1bc2cb839e758588c63d9c8b5e639d1"
194+
git-tree-sha1 = "688d6d9e098109051ae33d126fcfc88c4ce4a021"
197195
uuid = "6f1432cf-f94c-5a45-995e-cdbf5db27b0b"
198-
version = "3.0.5"
196+
version = "3.1.0"
199197

200198
[[deps.MacroTools]]
201-
deps = ["Markdown", "Random"]
202-
git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df"
199+
git-tree-sha1 = "72aebe0b5051e5143a079a4685a46da330a40472"
203200
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
204-
version = "0.5.13"
201+
version = "0.5.15"
205202

206203
[[deps.Markdown]]
207204
deps = ["Base64"]
@@ -225,11 +222,6 @@ version = "2023.12.12"
225222
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
226223
version = "1.2.0"
227224

228-
[[deps.OpenBLAS_jll]]
229-
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
230-
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
231-
version = "0.3.27+1"
232-
233225
[[deps.Parsers]]
234226
deps = ["Dates", "PrecompileTools", "UUIDs"]
235227
git-tree-sha1 = "8489905bcdbcfac64d1daa51ca07c0d8f0283821"
@@ -312,11 +304,6 @@ deps = ["Libdl"]
312304
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
313305
version = "1.2.13+1"
314306

315-
[[deps.libblastrampoline_jll]]
316-
deps = ["Artifacts", "Libdl"]
317-
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
318-
version = "5.11.0+0"
319-
320307
[[deps.nghttp2_jll]]
321308
deps = ["Artifacts", "Libdl"]
322309
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"

0 commit comments

Comments
 (0)