Skip to content

Commit

Permalink
Update OpenAI.jl (#67)
Browse files Browse the repository at this point in the history
Add  create_embedding function that receives a provider instead of API_KEY
  • Loading branch information
Roeya authored Nov 29, 2024
1 parent f70f44d commit 5935334
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/OpenAI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,20 @@ function create_embeddings(api_key::String,
input,
kwargs...)
end

function create_embeddings(provider::AbstractOpenAIProvider,
input;
model_id::String = DEFAULT_EMBEDDING_MODEL_ID,
http_kwargs::NamedTuple=NamedTuple(),
streamcallback=nothing,
kwargs...)
return OpenAI.openai_request("embeddings",
provider;
method="POST",
http_kwargs=http_kwargs,
model=model_id,
input,
kwargs...)
end
"""
Create images
Expand Down

0 comments on commit 5935334

Please sign in to comment.