This commit is contained in:
Leonnardo Rabello 2026-10-11 16:18:09 +00:00 • committed by GitHub
commit fb528a8d37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 0 deletions

View file

@ -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,

View file

@ -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",

View file

@ -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 (