@@ -54,6 +54,7 @@ public class OverridingChatGPTConfiguration: ChatGPTConfiguration {
5454 public var maxTokens : Int ?
5555 public var minimumReplyTokens : Int ?
5656 public var runFunctionsAutomatically : Bool ?
57+ public var apiKey : String ?
5758
5859 public init (
5960 temperature: Double ? = nil ,
@@ -62,7 +63,8 @@ public class OverridingChatGPTConfiguration: ChatGPTConfiguration {
6263 stop: [ String ] ? = nil ,
6364 maxTokens: Int ? = nil ,
6465 minimumReplyTokens: Int ? = nil ,
65- runFunctionsAutomatically: Bool ? = nil
66+ runFunctionsAutomatically: Bool ? = nil ,
67+ apiKey: String ? = nil
6668 ) {
6769 self . temperature = temperature
6870 self . modelId = modelId
@@ -71,6 +73,7 @@ public class OverridingChatGPTConfiguration: ChatGPTConfiguration {
7173 self . maxTokens = maxTokens
7274 self . minimumReplyTokens = minimumReplyTokens
7375 self . runFunctionsAutomatically = runFunctionsAutomatically
76+ self . apiKey = apiKey
7477 }
7578 }
7679
@@ -113,5 +116,9 @@ public class OverridingChatGPTConfiguration: ChatGPTConfiguration {
113116 public var runFunctionsAutomatically : Bool {
114117 overriding. runFunctionsAutomatically ?? configuration. runFunctionsAutomatically
115118 }
119+
120+ public var apiKey : String {
121+ overriding. apiKey ?? configuration. apiKey
122+ }
116123}
117124
0 commit comments