|
5 | 5 | // Created by Sergii Kryvoblotskyi on 12/19/22.
|
6 | 6 | //
|
7 | 7 |
|
8 |
| -import Foundation |
9 |
| - |
| 8 | +/// Defines all available OpenAI models supported by the library. |
10 | 9 | public typealias Model = String
|
| 10 | + |
11 | 11 | public extension Model {
|
12 |
| - |
13 |
| - // Chat Completions |
14 |
| - |
15 |
| - /// More capable than any GPT-3.5 model, able to do more complex tasks, and optimized for chat. Will be updated with our latest model iteration 2 weeks after it is released. |
16 |
| - static let gpt4 = "gpt-4" |
| 12 | + // Chat Completion |
| 13 | + // GPT-4 |
17 | 14 |
|
18 |
| - /// GPT-4 Turbo, teh latest gpt-4 model with improved instruction following, JSON mode, reproducible outputs, parallel function calling and more. |
19 |
| - /// Maximum of 4096 output tokens |
20 |
| - static let gpt4_1106_preview = "gpt-4-1106-preview" |
| 15 | + /// `gpt-4-turbo`, the latest gpt-4 model with improved instruction following, JSON mode, reproducible outputs, parallel function calling and more. Maximum of 4096 output tokens |
| 16 | + static let gpt4_turbo_preview = "gpt-4-turbo-preview" |
21 | 17 |
|
22 |
| - /// Ability to understand images, in addition to all other GPT-4 Turbo capabilities. |
| 18 | + /// `gpt-4-vision-preview`, able to understand images, in addition to all other GPT-4 Turbo capabilities. |
23 | 19 | static let gpt4_vision_preview = "gpt-4-vision-preview"
|
24 |
| - |
25 |
| - /// Snapshot of gpt-4 from March 14th 2023. Unlike gpt-4, this model will not receive updates, and will only be supported for a three month period ending on June 14th 2023. |
| 20 | + |
| 21 | + /// Snapshot of `gpt-4-turbo-preview` from January 25th 2024. This model reduces cases of “laziness” where the model doesn’t complete a task. Also fixes the bug impacting non-English UTF-8 generations. Maximum of 4096 output tokens |
| 22 | + static let gpt4_0125_preview = "gpt-4-0125-preview" |
| 23 | + |
| 24 | + /// Snapshot of `gpt-4-turbo-preview` from November 6th 2023. Improved instruction following, JSON mode, reproducible outputs, parallel function calling and more. Maximum of 4096 output tokens |
26 | 25 | @available(*, deprecated, message: "Please upgrade to the newer model")
|
27 |
| - static let gpt4_0314 = "gpt-4-0314" |
28 |
| - /// Snapshot of gpt-4 from June 13th 2023 with function calling data. Unlike gpt-4, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
| 26 | + static let gpt4_1106_preview = "gpt-4-1106-preview" |
| 27 | + |
| 28 | + /// Most capable `gpt-4` model, outperforms any GPT-3.5 model, able to do more complex tasks, and optimized for chat. |
| 29 | + static let gpt4 = "gpt-4" |
| 30 | + |
| 31 | + /// Snapshot of `gpt-4` from June 13th 2023 with function calling data. Unlike `gpt-4`, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
29 | 32 | static let gpt4_0613 = "gpt-4-0613"
|
30 |
| - /// Same capabilities as the base gpt-4 mode but with 4x the context length. Will be updated with our latest model iteration. |
| 33 | + |
| 34 | + /// Snapshot of `gpt-4` from March 14th 2023. Unlike gpt-4, this model will not receive updates, and will only be supported for a three month period ending on June 14th 2023. |
| 35 | + @available(*, deprecated, message: "Please upgrade to the newer model") |
| 36 | + static let gpt4_0314 = "gpt-4-0314" |
| 37 | + |
| 38 | + /// Same capabilities as the base `gpt-4` model but with 4x the context length. Will be updated with our latest model iteration. |
31 | 39 | static let gpt4_32k = "gpt-4-32k"
|
32 |
| - /// Snapshot of gpt-4-32 from March 14th 2023. Unlike gpt-4-32k, this model will not receive updates, and will only be supported for a three month period ending on June 14th 2023. |
| 40 | + |
| 41 | + /// Snapshot of `gpt-4-32k` from June 13th 2023. Unlike `gpt-4-32k`, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
| 42 | + static let gpt4_32k_0613 = "gpt-4-32k-0613" |
| 43 | + |
| 44 | + /// Snapshot of `gpt-4-32k` from March 14th 2023. Unlike `gpt-4-32k`, this model will not receive updates, and will only be supported for a three month period ending on June 14th 2023. |
33 | 45 | @available(*, deprecated, message: "Please upgrade to the newer model")
|
34 | 46 | static let gpt4_32k_0314 = "gpt-4-32k-0314"
|
35 |
| - /// Snapshot of gpt-4-32 from June 13th 2023. Unlike gpt-4-32k, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
36 |
| - static let gpt4_32k_0613 = "gpt-4-32k-0613" |
37 |
| - |
38 |
| - /// The latest GPT-3.5 Turbo model with improved instruction following, JSON mode, reproducible outputs, parallel function calling and more. |
39 |
| - static let gpt3_5Turbo_1106 = "gpt-3.5-turbo-1106" |
40 | 47 |
|
41 |
| - /// Most capable GPT-3.5 model and optimized for chat at 1/10th the cost of text-davinci-003. Will be updated with our latest model iteration. |
| 48 | + // GPT-3.5 |
| 49 | + |
| 50 | + /// Most capable `gpt-3.5-turbo` model and optimized for chat. Will be updated with our latest model iteration. |
42 | 51 | static let gpt3_5Turbo = "gpt-3.5-turbo"
|
43 |
| - /// Snapshot of gpt-3.5-turbo from March 1st 2023. Unlike gpt-3.5-turbo, this model will not receive updates, and will only be supported for a three month period ending on June 1st 2023. |
| 52 | + |
| 53 | + /// Snapshot of `gpt-3.5-turbo` from January 25th 2024. Decreased prices by 50%. Various improvements including higher accuracy at responding in requested formats and a fix for a bug which caused a text encoding issue for non-English language function calls. |
| 54 | + static let gpt3_5Turbo_0125 = "gpt-3.5-turbo-0125" |
| 55 | + |
| 56 | + /// Snapshot of `gpt-3.5-turbo` from November 6th 2023. The latest `gpt-3.5-turbo` model with improved instruction following, JSON mode, reproducible outputs, parallel function calling and more. |
| 57 | + @available(*, deprecated, message: "Please upgrade to the newer model") |
| 58 | + static let gpt3_5Turbo_1106 = "gpt-3.5-turbo-1106" |
| 59 | + |
| 60 | + /// Snapshot of `gpt-3.5-turbo` from June 13th 2023 with function calling data. Unlike `gpt-3.5-turbo`, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
44 | 61 | @available(*, deprecated, message: "Please upgrade to the newer model")
|
45 |
| - static let gpt3_5Turbo0301 = "gpt-3.5-turbo-0301" |
46 |
| - /// Snapshot of gpt-3.5-turbo from June 13th 2023 with function calling data. Unlike gpt-3.5-turbo, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
| 62 | + static let gpt3_5Turbo_0613 = "gpt-3.5-turbo-0613" |
| 63 | + |
| 64 | + /// Snapshot of `gpt-3.5-turbo` from March 1st 2023. Unlike `gpt-3.5-turbo`, this model will not receive updates, and will only be supported for a three month period ending on June 1st 2023. |
47 | 65 | @available(*, deprecated, message: "Please upgrade to the newer model")
|
48 |
| - static let gpt3_5Turbo0613 = "gpt-3.5-turbo-0613" |
49 |
| - /// Same capabilities as the standard gpt-3.5-turbo model but with 4 times the context. |
| 66 | + static let gpt3_5Turbo_0301 = "gpt-3.5-turbo-0301" |
| 67 | + |
| 68 | + /// Same capabilities as the standard `gpt-3.5-turbo` model but with 4 times the context. |
50 | 69 | static let gpt3_5Turbo_16k = "gpt-3.5-turbo-16k"
|
51 |
| - /// Snapshot of gpt-3.5-turbo-16k from June 13th 2023. Unlike gpt-3.5-turbo-16k, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
| 70 | + |
| 71 | + /// Snapshot of `gpt-3.5-turbo-16k` from June 13th 2023. Unlike `gpt-3.5-turbo-16k`, this model will not receive updates, and will be deprecated 3 months after a new version is released. |
52 | 72 | static let gpt3_5Turbo_16k_0613 = "gpt-3.5-turbo-16k-0613"
|
53 | 73 |
|
54 | 74 | // Completions
|
@@ -101,12 +121,14 @@ public extension Model {
|
101 | 121 | static let textSearchAda = "text-search-ada-doc-001"
|
102 | 122 | static let textSearchBabbageDoc = "text-search-babbage-doc-001"
|
103 | 123 | static let textSearchBabbageQuery001 = "text-search-babbage-query-001"
|
| 124 | + static let textEmbedding3 = "text-embedding-3-small" |
| 125 | + static let textEmbedding3Large = "text-embedding-3-large" |
104 | 126 |
|
105 | 127 | // Moderations
|
106 | 128 |
|
107 | 129 | /// Almost as capable as the latest model, but slightly older.
|
108 | 130 | static let textModerationStable = "text-moderation-stable"
|
109 | 131 | /// Most capable moderation model. Accuracy will be slightly higher than the stable model.
|
110 | 132 | static let textModerationLatest = "text-moderation-latest"
|
111 |
| - static let moderation = "text-moderation-001" |
| 133 | + static let moderation = "text-moderation-007" |
112 | 134 | }
|
0 commit comments