mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
test(chatgpt): construct immutable request parameters
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Modules / fmt, validate, test (gcp) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
This commit is contained in:
parent
2bfb569216
commit
3fb2f3bf91
1 changed files with 7 additions and 6 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import asyncio
|
||||
import json
|
||||
from pathlib import Path
|
||||
from types import MappingProxyType
|
||||
from typing import Final
|
||||
|
||||
import httpx
|
||||
|
|
@ -191,13 +192,13 @@ async def test_requests_use_selected_subscription(
|
|||
)
|
||||
|
||||
async def request(index: int, path: Path) -> str:
|
||||
params: Final = (
|
||||
{"model": f"account-{index}"}
|
||||
if router
|
||||
else {"model": "chatgpt/gpt-6.1-sol", "chatgpt_auth_file": str(path)}
|
||||
params: Final = MappingProxyType(
|
||||
{
|
||||
"model": f"account-{index}" if router else "chatgpt/gpt-6.1-sol",
|
||||
**({"chatgpt_auth_file": str(path)} if router is None else {}),
|
||||
**({"prompt_id": "account-check"} if with_prompt else {}),
|
||||
}
|
||||
)
|
||||
if with_prompt:
|
||||
params["prompt_id"] = "account-check"
|
||||
if endpoint == "chat":
|
||||
result: Final = await (router.acompletion if router else litellm.acompletion)(
|
||||
**params, messages=[{"role": "user", "content": "Hello"}]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue