Convert provider config from snake_case to camelCase wire format. Args: provider: The provider configuration in snake_case format. Returns: The provider configuration in camelCase wire format.
(
self, provider: ProviderConfig | dict[str, Any]
)
| 3302 | ) |
| 3303 | |
| 3304 | def _convert_provider_to_wire_format( |
| 3305 | self, provider: ProviderConfig | dict[str, Any] |
| 3306 | ) -> dict[str, Any]: |
| 3307 | """ |
| 3308 | Convert provider config from snake_case to camelCase wire format. |
| 3309 | |
| 3310 | Args: |
| 3311 | provider: The provider configuration in snake_case format. |
| 3312 | |
| 3313 | Returns: |
| 3314 | The provider configuration in camelCase wire format. |
| 3315 | """ |
| 3316 | wire_provider: dict[str, Any] = {"type": provider.get("type")} |
| 3317 | if "base_url" in provider: |
| 3318 | wire_provider["baseUrl"] = provider["base_url"] |
| 3319 | if "api_key" in provider: |
| 3320 | wire_provider["apiKey"] = provider["api_key"] |
| 3321 | if "wire_api" in provider: |
| 3322 | wire_provider["wireApi"] = provider["wire_api"] |
| 3323 | if "transport" in provider: |
| 3324 | wire_provider["transport"] = provider["transport"] |
| 3325 | if "bearer_token" in provider: |
| 3326 | wire_provider["bearerToken"] = provider["bearer_token"] |
| 3327 | if provider.get("bearer_token_provider") is not None: |
| 3328 | wire_provider["hasBearerTokenProvider"] = True |
| 3329 | if "headers" in provider: |
| 3330 | wire_provider["headers"] = provider["headers"] |
| 3331 | if "model_id" in provider: |
| 3332 | wire_provider["modelId"] = provider["model_id"] |
| 3333 | if "wire_model" in provider: |
| 3334 | wire_provider["wireModel"] = provider["wire_model"] |
| 3335 | if "max_prompt_tokens" in provider: |
| 3336 | wire_provider["maxPromptTokens"] = provider["max_prompt_tokens"] |
| 3337 | if "max_output_tokens" in provider: |
| 3338 | wire_provider["maxOutputTokens"] = provider["max_output_tokens"] |
| 3339 | if "azure" in provider: |
| 3340 | azure = provider["azure"] |
| 3341 | wire_azure: dict[str, Any] = {} |
| 3342 | if "api_version" in azure: |
| 3343 | wire_azure["apiVersion"] = azure["api_version"] |
| 3344 | if wire_azure: |
| 3345 | wire_provider["azure"] = wire_azure |
| 3346 | return wire_provider |
| 3347 | |
| 3348 | def _convert_named_provider_to_wire_format( |
| 3349 | self, provider: NamedProviderConfig | dict[str, Any] |
no test coverage detected