MCPcopy Index your code
hub / github.com/github/copilot-sdk / _convert_model_to_wire_format

Method _convert_model_to_wire_format

python/copilot/client.py:3378–3401  ·  view source on GitHub ↗

Convert a BYOK model definition from snake_case to camelCase wire format.

(
        self, model: ProviderModelConfig | dict[str, Any]
    )

Source from the content-addressed store, hash-verified

3376 return wire
3377
3378 def _convert_model_to_wire_format(
3379 self, model: ProviderModelConfig | dict[str, Any]
3380 ) -> dict[str, Any]:
3381 """Convert a BYOK model definition from snake_case to camelCase wire format."""
3382 wire: dict[str, Any] = {}
3383 if "id" in model:
3384 wire["id"] = model["id"]
3385 if "provider" in model:
3386 wire["provider"] = model["provider"]
3387 if "wire_model" in model:
3388 wire["wireModel"] = model["wire_model"]
3389 if "model_id" in model:
3390 wire["modelId"] = model["model_id"]
3391 if "name" in model:
3392 wire["name"] = model["name"]
3393 if "max_prompt_tokens" in model:
3394 wire["maxPromptTokens"] = model["max_prompt_tokens"]
3395 if "max_context_window_tokens" in model:
3396 wire["maxContextWindowTokens"] = model["max_context_window_tokens"]
3397 if "max_output_tokens" in model:
3398 wire["maxOutputTokens"] = model["max_output_tokens"]
3399 if "capabilities" in model:
3400 wire["capabilities"] = _capabilities_to_dict(model["capabilities"])
3401 return wire
3402
3403 def _convert_custom_agent_to_wire_format(
3404 self, agent: CustomAgentConfig | dict[str, Any]

Callers 2

create_sessionMethod · 0.95
resume_sessionMethod · 0.95

Calls 1

_capabilities_to_dictFunction · 0.85

Tested by

no test coverage detected