feat: add url_join (#856)

This commit is contained in:
yetone
2024-11-17 00:39:03 +08:00
committed by GitHub
parent 8bbcd64550
commit dfc51b3247
8 changed files with 43 additions and 18 deletions

View File

@@ -86,11 +86,10 @@ M.parse_curl_args = function(provider, code_opts)
body_opts.max_tokens = nil
return {
url = Utils.trim(base.endpoint, { suffix = "/" })
.. "/"
.. base.model
.. ":streamGenerateContent?alt=sse&key="
.. provider.parse_api_key(),
url = Utils.url_join(
base.endpoint,
base.model .. ":streamGenerateContent?alt=sse&key=" .. provider.parse_api_key()
),
proxy = base.proxy,
insecure = base.allow_insecure,
headers = { ["Content-Type"] = "application/json" },