@@ -327,6 +327,8 @@ class AzureOpenAIConnection(ApiOrAadConnection):
327
327
def __init__ (
328
328
self ,
329
329
* ,
330
+ azure_endpoint : str ,
331
+ api_key : Optional [str ] = None ,
330
332
api_version : Optional [str ] = None ,
331
333
api_type : str = "Azure" , # Required API input, hidden to allow for rare overrides
332
334
open_ai_resource_id : Optional [str ] = None ,
@@ -338,6 +340,8 @@ def __init__(
338
340
if open_ai_resource_id is None and from_rest_resource_id is not None :
339
341
open_ai_resource_id = from_rest_resource_id
340
342
super ().__init__ (
343
+ azure_endpoint = azure_endpoint ,
344
+ api_key = api_key ,
341
345
type = camel_to_snake (ConnectionCategory .AZURE_OPEN_AI ),
342
346
from_child = True ,
343
347
** kwargs ,
@@ -407,6 +411,7 @@ def open_ai_resource_id(self, value: Optional[str]) -> None:
407
411
self .tags [CONNECTION_RESOURCE_ID_KEY ] = value
408
412
409
413
414
+ @experimental
410
415
class AzureAIServicesConnection (ApiOrAadConnection ):
411
416
"""A Connection geared towards Azure AI services.
412
417
@@ -426,11 +431,15 @@ class AzureAIServicesConnection(ApiOrAadConnection):
426
431
def __init__ (
427
432
self ,
428
433
* ,
434
+ endpoint : str ,
435
+ api_key : Optional [str ] = None ,
429
436
ai_services_resource_id : str ,
430
437
** kwargs : Any ,
431
438
):
432
439
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
433
440
super ().__init__ (
441
+ endpoint = endpoint ,
442
+ api_key = api_key ,
434
443
type = ConnectionTypes .AZURE_AI_SERVICES ,
435
444
from_child = True ,
436
445
** kwargs ,
@@ -488,11 +497,16 @@ class AzureAISearchConnection(ApiOrAadConnection):
488
497
489
498
def __init__ (
490
499
self ,
500
+ * ,
501
+ endpoint : str ,
502
+ api_key : Optional [str ] = None ,
491
503
** kwargs : Any ,
492
504
):
493
505
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
494
506
495
507
super ().__init__ (
508
+ endpoint = endpoint ,
509
+ api_key = api_key ,
496
510
type = ConnectionTypes .AZURE_SEARCH ,
497
511
from_child = True ,
498
512
** kwargs ,
@@ -520,10 +534,15 @@ class AzureContentSafetyConnection(ApiOrAadConnection):
520
534
521
535
def __init__ (
522
536
self ,
537
+ * ,
538
+ endpoint : str ,
539
+ api_key : Optional [str ] = None ,
523
540
** kwargs : Any ,
524
541
):
525
542
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
526
543
super ().__init__ (
544
+ endpoint = endpoint ,
545
+ api_key = api_key ,
527
546
type = ConnectionTypes .AZURE_CONTENT_SAFETY ,
528
547
from_child = True ,
529
548
** kwargs ,
@@ -548,7 +567,7 @@ class AzureSpeechServicesConnection(ApiOrAadConnection):
548
567
:type endpoint: str
549
568
:param api_key: The api key to connect to the azure endpoint.
550
569
If unset, tries to use the user's Entra ID as credentials instead.
551
- :type api_key: str
570
+ :type api_key: Optional[ str]
552
571
:param tags: Tag dictionary. Tags can be added, removed, and updated.
553
572
:type tags: dict
554
573
"""
@@ -559,11 +578,13 @@ def __init__(
559
578
self ,
560
579
* ,
561
580
endpoint : str ,
581
+ api_key : Optional [str ] = None ,
562
582
** kwargs : Any ,
563
583
):
564
584
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
565
585
super ().__init__ (
566
586
endpoint = endpoint ,
587
+ api_key = api_key ,
567
588
type = ConnectionTypes .AZURE_SPEECH_SERVICES ,
568
589
from_child = True ,
569
590
** kwargs ,
@@ -587,7 +608,7 @@ class APIKeyConnection(ApiOrAadConnection):
587
608
:param api_base: The URL to target with this connection.
588
609
:type api_base: str
589
610
:param api_key: The API key needed to connect to the api_base.
590
- :type api_key: str
611
+ :type api_key: Optional[ str]
591
612
:param tags: Tag dictionary. Tags can be added, removed, and updated.
592
613
:type tags: dict
593
614
"""
@@ -596,11 +617,13 @@ def __init__(
596
617
self ,
597
618
* ,
598
619
api_base : str ,
620
+ api_key : Optional [str ] = None ,
599
621
** kwargs ,
600
622
):
601
623
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
602
624
super ().__init__ (
603
625
api_base = api_base ,
626
+ api_key = api_key ,
604
627
type = camel_to_snake (ConnectionCategory .API_KEY ),
605
628
allow_entra = False ,
606
629
from_child = True ,
@@ -620,18 +643,21 @@ class OpenAIConnection(ApiOrAadConnection):
620
643
:param name: Name of the connection.
621
644
:type name: str
622
645
:param api_key: The API key needed to connect to the Open AI.
623
- :type api_key: str
646
+ :type api_key: Optional[ str]
624
647
:param tags: Tag dictionary. Tags can be added, removed, and updated.
625
648
:type tags: dict
626
649
"""
627
650
628
651
def __init__ (
629
652
self ,
653
+ * ,
654
+ api_key : Optional [str ] = None ,
630
655
** kwargs ,
631
656
):
632
657
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
633
658
super ().__init__ (
634
659
type = ConnectionCategory .Open_AI ,
660
+ api_key = api_key ,
635
661
allow_entra = False ,
636
662
from_child = True ,
637
663
** kwargs ,
@@ -649,18 +675,21 @@ class SerpConnection(ApiOrAadConnection):
649
675
:param name: Name of the connection.
650
676
:type name: str
651
677
:param api_key: The API key needed to connect to the Open AI.
652
- :type api_key: str
678
+ :type api_key: Optional[ str]
653
679
:param tags: Tag dictionary. Tags can be added, removed, and updated.
654
680
:type tags: dict
655
681
"""
656
682
657
683
def __init__ (
658
684
self ,
685
+ * ,
686
+ api_key : Optional [str ] = None ,
659
687
** kwargs ,
660
688
):
661
689
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
662
690
super ().__init__ (
663
691
type = ConnectionCategory .SERP ,
692
+ api_key = api_key ,
664
693
allow_entra = False ,
665
694
from_child = True ,
666
695
** kwargs ,
@@ -680,18 +709,23 @@ class ServerlessConnection(ApiOrAadConnection):
680
709
:param endpoint: The serverless endpoint.
681
710
:type endpoint: str
682
711
:param api_key: The API key needed to connect to the endpoint.
683
- :type api_key: str
712
+ :type api_key: Optional[ str]
684
713
:param tags: Tag dictionary. Tags can be added, removed, and updated.
685
714
:type tags: dict
686
715
"""
687
716
688
717
def __init__ (
689
718
self ,
719
+ * ,
720
+ endpoint : str ,
721
+ api_key : Optional [str ] = None ,
690
722
** kwargs ,
691
723
):
692
724
kwargs .pop ("type" , None ) # make sure we never somehow use wrong type
693
725
super ().__init__ (
694
726
type = ConnectionCategory .SERVERLESS ,
727
+ endpoint = endpoint ,
728
+ api_key = api_key ,
695
729
allow_entra = False ,
696
730
from_child = True ,
697
731
** kwargs ,
0 commit comments