Skip to content

Commit be27063

Browse files
Merge pull request #32 from AppcentMobile/feature/organization-key
🎷 [FEATURE] Organization key added, documentation updated.
2 parents 95289d9 + c4f05d3 commit be27063

File tree

196 files changed

+218
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+218
-194
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//
2+
// ACMOAIConstants.swift
3+
//
4+
5+
/// Constants for holding open ai data
6+
struct ACMOAIConstants {
7+
static let organizationHeader = "OpenAI-Organization"
8+
}

Sources/ACMOpenAI/Manager/Base/BaseManager.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@ public class BaseAPIManager: BaseManager {
2828

2929
endpoint = ACMEndpoint()
3030
.add(authHeader: ACMAuthModel(type: .bearer, value: config.apiKey))
31+
32+
if let organization = config.organization {
33+
endpoint = endpoint
34+
.add(header: ACMHeaderModel(field: ACMOAIConstants.organizationHeader, value: organization))
35+
}
3136
}
3237
}

Sources/ACMOpenAI/Models/ACMOpenAIPlistModel.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ import ACMNetworking
66

77
class ACMOpenAIPlistModel: ACMPlistModel {
88
var apiKey: String
9+
var organization: String?
910

1011
enum CodingKeys: CodingKey {
1112
case apiKey
13+
case organization
1214
}
1315

1416
required init(from decoder: Decoder) throws {
1517
let container = try decoder.container(keyedBy: CodingKeys.self)
1618
apiKey = try container.decode(String.self, forKey: .apiKey)
19+
organization = try container.decodeIfPresent(String.self, forKey: .organization)
1720
try super.init(from: decoder)
1821
}
1922
}

docs/Classes.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ <h4>Declaration</h4>
767767
</section>
768768
</section>
769769
<section id="footer">
770-
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-03)</p>
770+
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-04)</p>
771771
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
772772
</section>
773773
</article>

docs/Classes/ACMOAIAudioManager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ <h4>Parameters</h4>
502502
</section>
503503
</section>
504504
<section id="footer">
505-
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-03)</p>
505+
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-04)</p>
506506
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
507507
</section>
508508
</article>

docs/Classes/ACMOAIChatManager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ <h4>Parameters</h4>
456456
</section>
457457
</section>
458458
<section id="footer">
459-
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-03)</p>
459+
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-04)</p>
460460
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
461461
</section>
462462
</article>

docs/Classes/ACMOAICompletionsManager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ <h4>Parameters</h4>
456456
</section>
457457
</section>
458458
<section id="footer">
459-
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-03)</p>
459+
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-04)</p>
460460
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
461461
</section>
462462
</article>

docs/Classes/ACMOAIEditsManager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ <h4>Parameters</h4>
456456
</section>
457457
</section>
458458
<section id="footer">
459-
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-03)</p>
459+
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-04)</p>
460460
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
461461
</section>
462462
</article>

docs/Classes/ACMOAIEmbeddingsManager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ <h4>Parameters</h4>
456456
</section>
457457
</section>
458458
<section id="footer">
459-
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-03)</p>
459+
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-04)</p>
460460
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
461461
</section>
462462
</article>

docs/Classes/ACMOAIEnginesManager.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ <h4>Parameters</h4>
483483
</section>
484484
</section>
485485
<section id="footer">
486-
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-03)</p>
486+
<p>&copy; 2023 <a class="link" href="https://github.com/AppcentMobile/ACMOpenAI-iOS" target="_blank" rel="external noopener">burak</a>. All rights reserved. (Last updated: 2023-04-04)</p>
487487
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
488488
</section>
489489
</article>

0 commit comments

Comments
 (0)