Skip to content

Commit

Permalink
fixed azure deploys
Browse files Browse the repository at this point in the history
  • Loading branch information
algunion committed Nov 7, 2024
1 parent 4237fc1 commit 3864e1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Creates a new `Chat` object with default settings:
- `history` is set to `true`
"""
@kwdef struct Chat
service::Type{<:ServiceEndpoint} = OPENAIServiceEndpoint #AZUREServiceEndpoint #OPENAIServiceEndpoint
service::Type{<:ServiceEndpoint} = AZUREServiceEndpoint #AZUREServiceEndpoint #OPENAIServiceEndpoint
model::String = "gpt-4o"
messages::Conversation = Message[]
history::Bool = true
Expand Down
4 changes: 2 additions & 2 deletions src/requests.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
get_url(params::Chat) = get_url(params.service, params.model)
get_url(emb::Embeddings) = get_url(emb.model)
get_url(emb::Embeddings) = get_url(OPENAIServiceEndpoint, emb.model)
get_url(::Type{OPENAIServiceEndpoint}, model::String) = OPENAI_BASE_URL * _MODEL_ENDPOINTS_OPENAI[model]
get_url(::Type{OPENAIServiceEndpoint}, emb::Embeddings) = get_url(emb)
get_url(::Type{AZUREServiceEndpoint}, model::String) = ENV[AZURE_OPENAI_BASE_URL] * "/openai/deployments/" * _MODEL_ENDPOINTS_AZURE_OPENAI[model] * "/chat/completions?api-version=$(ENV[AZURE_OPENAI_API_VERSION])"
get_url(::Type{AZUREServiceEndpoint}, model::String) = ENV[AZURE_OPENAI_BASE_URL] * _MODEL_ENDPOINTS_AZURE_OPENAI[model] * "/chat/completions?api-version=$(ENV[AZURE_OPENAI_API_VERSION])"


function auth_header(::Type{OPENAIServiceEndpoint})
Expand Down

0 comments on commit 3864e1d

Please sign in to comment.