mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-13 03:59:12 +00:00
Merge 96406601e8 into 780c504e00
This commit is contained in:
commit
fb528a8d37
3 changed files with 20 additions and 0 deletions
|
|
@ -76,6 +76,7 @@ OPTIONAL_KWARGS_KEYS: Final = (
|
|||
"otpm",
|
||||
"use_xai_oauth",
|
||||
"github_copilot_auth_type",
|
||||
"litellm_credential_name",
|
||||
"github_copilot_user_session",
|
||||
"fireworks_forward_user_id",
|
||||
PROVIDER_AFFINITY_HEADER_KWARG_KEY,
|
||||
|
|
|
|||
|
|
@ -5707,6 +5707,7 @@ def completion(
|
|||
*OPENAI_WIF_KWARGS_KEYS,
|
||||
*OAUTH_TOKEN_EXCHANGE_KWARGS_KEYS,
|
||||
"github_copilot_auth_type",
|
||||
"litellm_credential_name",
|
||||
"github_copilot_user_session",
|
||||
PROVIDER_AFFINITY_HEADER_KWARG_KEY,
|
||||
"fireworks_forward_user_id",
|
||||
|
|
|
|||
|
|
@ -688,6 +688,24 @@ def test_e2e_responses_per_user_credential(per_user_credential):
|
|||
assert response.usage.total_tokens == 6
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_e2e_acompletion_bridged_to_responses_per_user_credential(per_user_credential):
|
||||
with (
|
||||
github_http(_copilot_surface_responder(_responses_payload())) as requests,
|
||||
_no_authenticator(),
|
||||
):
|
||||
response = await litellm.acompletion(
|
||||
model="github_copilot/gpt-5.3-codex",
|
||||
messages=[{"role": "user", "content": "hi"}],
|
||||
litellm_credential_name="copilot-cred",
|
||||
github_copilot_auth_type="per_user_oauth",
|
||||
secret_fields=_secret_fields("user-a", "gho_a"),
|
||||
)
|
||||
_assert_exchange_then_model_call(requests, "gho_a")
|
||||
assert requests[-1].url.path == "/responses"
|
||||
assert response.usage.total_tokens == 6
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_e2e_anthropic_messages_per_user_credential(per_user_credential):
|
||||
with (
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue