From b54bbebc03e10f54b665858dfc93b7aae12e18de Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 24 Apr 2025 10:55:37 -0400 Subject: [PATCH] open_ai: Remove list of supported countries (#29347) This PR removes the list of supported countries from the `open_ai` crate, as it is no longer referenced in this repo. Release Notes: - N/A --- crates/open_ai/src/open_ai.rs | 4 - crates/open_ai/src/supported_countries.rs | 238 ---------------------- 2 files changed, 242 deletions(-) delete mode 100644 crates/open_ai/src/supported_countries.rs diff --git a/crates/open_ai/src/open_ai.rs b/crates/open_ai/src/open_ai.rs index f9e0b7d4e3..9faac29cac 100644 --- a/crates/open_ai/src/open_ai.rs +++ b/crates/open_ai/src/open_ai.rs @@ -1,5 +1,3 @@ -mod supported_countries; - use anyhow::{Context as _, Result, anyhow}; use futures::{ AsyncBufReadExt, AsyncReadExt, StreamExt, @@ -15,8 +13,6 @@ use std::{ }; use strum::EnumIter; -pub use supported_countries::*; - pub const OPEN_AI_API_URL: &str = "https://api.openai.com/v1"; fn is_none_or_empty, U>(opt: &Option) -> bool { diff --git a/crates/open_ai/src/supported_countries.rs b/crates/open_ai/src/supported_countries.rs deleted file mode 100644 index b8aed6970e..0000000000 --- a/crates/open_ai/src/supported_countries.rs +++ /dev/null @@ -1,238 +0,0 @@ -use std::collections::HashSet; -use std::sync::LazyLock; - -/// Returns whether the given country code is supported by OpenAI. -/// -/// -pub fn is_supported_country(country_code: &str) -> bool { - SUPPORTED_COUNTRIES.contains(&country_code) -} - -/// The list of country codes supported by OpenAI. -/// -/// https://platform.openai.com/docs/supported-countries -static SUPPORTED_COUNTRIES: LazyLock> = LazyLock::new(|| { - vec![ - "AL", // Albania - "DZ", // Algeria - "AS", // American Samoa (US) - "AI", // Anguilla (UK) - "AF", // Afghanistan - "AD", // Andorra - "AO", // Angola - "AG", // Antigua and Barbuda - "AR", // Argentina - "AM", // Armenia - "AU", // Australia - "AT", // Austria - "AZ", // Azerbaijan - "BS", // Bahamas - "BH", // Bahrain - "BD", // Bangladesh - "BB", // Barbados - "BE", // Belgium - "BZ", // Belize - "BJ", // Benin - "BM", // Bermuda (UK) - "BT", // Bhutan - "BO", // Bolivia - "BA", // Bosnia and Herzegovina - "BW", // Botswana - "BR", // Brazil - "IO", // British Indian Ocean Territory (UK) - "BN", // Brunei - "BG", // Bulgaria - "BF", // Burkina Faso - "BI", // Burundi - "CV", // Cabo Verde - "KH", // Cambodia - "CM", // Cameroon - "CA", // Canada - "KY", // Cayman Islands (UK) - "CF", // Central African Republic - "TD", // Chad - "CL", // Chile - "CX", // Christmas Island (AU) - "CC", // Cocos (Keeling) Islands (AU) - "CO", // Colombia - "KM", // Comoros - "CG", // Congo (Brazzaville) - "CD", // Congo (DRC) - "CK", // Cook Islands (NZ) - "CR", // Costa Rica - "CI", // Côte d'Ivoire - "HR", // Croatia - "CY", // Cyprus - "CZ", // Czechia (Czech Republic) - "DK", // Denmark - "DJ", // Djibouti - "DM", // Dominica - "DO", // Dominican Republic - "EC", // Ecuador - "EG", // Egypt - "SV", // El Salvador - "GQ", // Equatorial Guinea - "ER", // Eritrea - "EE", // Estonia - "SZ", // Eswatini (Swaziland) - "ET", // Ethiopia - "FK", // Falkland Islands (UK) - "FJ", // Fiji - "FI", // Finland - "FR", // France - "GF", // French Guiana (FR) - "PF", // French Polynesia (FR) - "TF", // French Southern Territories - "GA", // Gabon - "GM", // Gambia - "GE", // Georgia - "DE", // Germany - "GH", // Ghana - "GI", // Gibraltar (UK) - "GR", // Greece - "GD", // Grenada - "GT", // Guatemala - "GU", // Guam (US) - "GN", // Guinea - "GW", // Guinea-Bissau - "GY", // Guyana - "HT", // Haiti - "HM", // Heard Island and McDonald Islands (AU) - "VA", // Holy See (Vatican City) - "HN", // Honduras - "HU", // Hungary - "IS", // Iceland - "IN", // India - "ID", // Indonesia - "IQ", // Iraq - "IE", // Ireland - "IL", // Israel - "IT", // Italy - "JM", // Jamaica - "JP", // Japan - "JO", // Jordan - "KZ", // Kazakhstan - "KE", // Kenya - "KI", // Kiribati - "KW", // Kuwait - "KG", // Kyrgyzstan - "LA", // Laos - "LV", // Latvia - "LB", // Lebanon - "LS", // Lesotho - "LR", // Liberia - "LY", // Libya - "LI", // Liechtenstein - "LT", // Lithuania - "LU", // Luxembourg - "MG", // Madagascar - "MW", // Malawi - "MY", // Malaysia - "MV", // Maldives - "ML", // Mali - "MT", // Malta - "MH", // Marshall Islands - "MR", // Mauritania - "MU", // Mauritius - "MX", // Mexico - "FM", // Micronesia - "MD", // Moldova - "MC", // Monaco - "MN", // Mongolia - "MS", // Montserrat (UK) - "ME", // Montenegro - "MA", // Morocco - "MZ", // Mozambique - "MM", // Myanmar - "NA", // Namibia - "NR", // Nauru - "NP", // Nepal - "NL", // Netherlands - "NZ", // New Zealand - "NI", // Nicaragua - "NE", // Niger - "NG", // Nigeria - "NF", // Norfolk Island (AU) - "MK", // North Macedonia - "MI", // Northern Mariana Islands (UK) - "NO", // Norway - "NU", // Niue (NZ) - "OM", // Oman - "PK", // Pakistan - "PW", // Palau - "PS", // Palestine - "PA", // Panama - "PG", // Papua New Guinea - "PY", // Paraguay - "PE", // Peru - "PH", // Philippines - "PN", // Pitcairn (UK) - "PL", // Poland - "PT", // Portugal - "PR", // Puerto Rico (US) - "QA", // Qatar - "RO", // Romania - "RW", // Rwanda - "BL", // Saint Barthélemy (FR) - "KN", // Saint Kitts and Nevis - "LC", // Saint Lucia - "MF", // Saint Martin (FR) - "PM", // Saint Pierre and Miquelon (FR) - "VC", // Saint Vincent and the Grenadines - "WS", // Samoa - "SM", // San Marino - "ST", // Sao Tome and Principe - "SA", // Saudi Arabia - "SN", // Senegal - "RS", // Serbia - "SC", // Seychelles - "SH", // Saint Helena, Ascension and Tristan da Cunha (UK) - "SL", // Sierra Leone - "SG", // Singapore - "SK", // Slovakia - "SI", // Slovenia - "SB", // Solomon Islands - "SO", // Somalia - "ZA", // South Africa - "KR", // South Korea - "SS", // South Sudan - "ES", // Spain - "LK", // Sri Lanka - "SR", // Suriname - "SE", // Sweden - "CH", // Switzerland - "SD", // Sudan - "TW", // Taiwan - "TJ", // Tajikistan - "TZ", // Tanzania - "TH", // Thailand - "TL", // Timor-Leste (East Timor) - "TG", // Togo - "TK", // Tokelau (NZ) - "TO", // Tonga - "TT", // Trinidad and Tobago - "TN", // Tunisia - "TR", // Turkey - "TM", // Turkmenistan - "TC", // Turks and Caicos Islands (UK) - "TV", // Tuvalu - "UG", // Uganda - "UA", // Ukraine (with certain exceptions) - "AE", // United Arab Emirates - "GB", // United Kingdom - "UM", // United States Minor Outlying Islands (US) - "US", // United States of America - "UY", // Uruguay - "UZ", // Uzbekistan - "VU", // Vanuatu - "VN", // Vietnam - "VI", // Virgin Islands (US) - "VG", // Virgin Islands (UK) - "WF", // Wallis and Futuna (FR) - "YE", // Yemen - "ZM", // Zambia - "ZW", // Zimbabwe - ] - .into_iter() - .collect() -});