Skip to content

Commit

Permalink
Reformat, remove extra export
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjthomas9 committed Feb 15, 2024
1 parent 4ee1c77 commit 3705a26
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/GoogleGenAI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ end
# safety_settings: Safety settings for generated text. Defaults to None.
# stop_sequences: Stop sequences to halt text generation. Can be a string
# or iterable of strings. Defaults to None.
function generate_content(provider::GoogleProvider, model_name::String, input::String; kwargs...)
function generate_content(
provider::GoogleProvider, model_name::String, input::String; kwargs...
)
url = "$(provider.base_url)/models/$model_name:generateContent?key=$(provider.api_key)"
generation_config = Dict{String,Any}()
for (key, value) in kwargs
Expand All @@ -57,7 +59,7 @@ function generate_content(provider::GoogleProvider, model_name::String, input::S

body = Dict(
"contents" => [Dict("parts" => [Dict("text" => input)])],
"generationConfig" => generation_config
"generationConfig" => generation_config,
)
response = HTTP.post(
url; headers=Dict("Content-Type" => "application/json"), body=JSON3.write(body)
Expand Down Expand Up @@ -144,7 +146,6 @@ function list_models(provider::GoogleProvider)
end
list_models(api_key::String) = list_models(GoogleProvider(; api_key))

export GoogleProvider,
GoogleResponse, generate_content, count_tokens, embed_content, list_models
export GoogleProvider, generate_content, count_tokens, embed_content, list_models

end # module GoogleGenAI

0 comments on commit 3705a26

Please sign in to comment.