@@ -83,15 +83,12 @@ from openai.auth import k8s_service_account_token_provider
8383
8484client = OpenAI(
8585 workload_identity = {
86- " client_id" : " your-client-id" ,
8786 " identity_provider_id" : " idp-123" ,
8887 " service_account_id" : " sa-456" ,
8988 " provider" : k8s_service_account_token_provider(
9089 " /var/run/secrets/kubernetes.io/serviceaccount/token"
9190 ),
9291 },
93- organization = " org-xyz" ,
94- project = " proj-abc" ,
9592)
9693
9794response = client.chat.completions.create(
@@ -108,7 +105,6 @@ from openai.auth import azure_managed_identity_token_provider
108105
109106client = OpenAI(
110107 workload_identity = {
111- " client_id" : " your-client-id" ,
112108 " identity_provider_id" : " idp-123" ,
113109 " service_account_id" : " sa-456" ,
114110 " provider" : azure_managed_identity_token_provider(
@@ -126,7 +122,6 @@ from openai.auth import gcp_id_token_provider
126122
127123client = OpenAI(
128124 workload_identity = {
129- " client_id" : " your-client-id" ,
130125 " identity_provider_id" : " idp-123" ,
131126 " service_account_id" : " sa-456" ,
132127 " provider" : gcp_id_token_provider(audience = " https://api.openai.com/v1" ),
@@ -146,7 +141,6 @@ def get_custom_token() -> str:
146141
147142client = OpenAI(
148143 workload_identity = {
149- " client_id" : " your-client-id" ,
150144 " identity_provider_id" : " idp-123" ,
151145 " service_account_id" : " sa-456" ,
152146 " provider" : {
@@ -165,7 +159,6 @@ from openai.auth import k8s_service_account_token_provider
165159
166160client = OpenAI(
167161 workload_identity = {
168- " client_id" : " your-client-id" ,
169162 " identity_provider_id" : " idp-123" ,
170163 " service_account_id" : " sa-456" ,
171164 " provider" : k8s_service_account_token_provider(" /var/token" ),
0 commit comments