mirror of
https://github.com/katanemo/plano.git
synced 2026-04-25 00:36:34 +02:00
add ability to specify custom http headers in api endpoint (#386)
This commit is contained in:
parent
e82f8f216f
commit
2bd61d628c
11 changed files with 179 additions and 10 deletions
|
|
@ -89,6 +89,18 @@ def get_llm_provider_access_keys(arch_config_file):
|
|||
if acess_key is not None:
|
||||
access_key_list.append(acess_key)
|
||||
|
||||
for prompt_target in arch_config_yaml.get("prompt_targets", []):
|
||||
for k, v in prompt_target.get("endpoint", {}).get("http_headers", {}).items():
|
||||
if k.lower() == "authorization":
|
||||
print(
|
||||
f"found auth header: {k} for prompt_target: {prompt_target.get('name')}/{prompt_target.get('endpoint').get('name')}"
|
||||
)
|
||||
auth_tokens = v.split(" ")
|
||||
if len(auth_tokens) > 1:
|
||||
access_key_list.append(auth_tokens[1])
|
||||
else:
|
||||
access_key_list.append(v)
|
||||
|
||||
return access_key_list
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue