You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updating run parameters
* Updating run parameters
* update runs
* filtering messages for runid
* adding seed parameter to fine tune job
* Adding new GPT turbo family members
Copy file name to clipboardExpand all lines: Examples/SwiftOpenAIExample/SwiftOpenAIExample/ChatFunctionsCall/Completion/ChatFunctionCallProvider.swift
Copy file name to clipboardExpand all lines: Examples/SwiftOpenAIExample/SwiftOpenAIExample/ChatFunctionsCall/Stream/ChatFunctionsCallStreamProvider.swift
Copy file name to clipboardExpand all lines: README.md
+34-1
Original file line number
Diff line number
Diff line change
@@ -1126,6 +1126,10 @@ public struct FineTuningJobParameters: Encodable {
1126
1126
/// Your dataset must be formatted as a JSONL file. You must upload your file with the purpose fine-tune.
1127
1127
/// See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for more details.
1128
1128
let validationFile: String?
1129
+
/// A list of integrations to enable for your fine-tuning job.
1130
+
let integrations: [Integration]?
1131
+
/// The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. If a seed is not specified, one will be generated for you.
1132
+
let seed: Int?
1129
1133
1130
1134
/// Fine-tuning is [currently available](https://platform.openai.com/docs/guides/fine-tuning/what-models-can-be-fine-tuned) for the following models:
1131
1135
/// gpt-3.5-turbo-0613 (recommended)
@@ -2014,7 +2018,9 @@ Parameters
2014
2018
```swift
2015
2019
publicstruct MessageParameter:Encodable {
2016
2020
2017
-
/// The role of the entity that is creating the message. Currently only user is supported.
2021
+
/// The role of the entity that is creating the message. Allowed values include:
2022
+
/// user: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages.
2023
+
/// assistant: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation.
2018
2024
let role: String
2019
2025
/// The content of the message.
2020
2026
let content: String
@@ -2256,12 +2262,29 @@ public struct RunParameter: Encodable {
2256
2262
let instructions: String?
2257
2263
/// Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions.
2258
2264
let additionalInstructions: String?
2265
+
/// Adds additional messages to the thread before creating the run.
2266
+
let additionalMessages: [MessageParameter]?
2259
2267
/// Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis.
2260
2268
let tools: [AssistantObject.Tool]?
2261
2269
/// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
2262
2270
let metadata: [String: String]?
2271
+
/// What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
2272
+
/// Optional Defaults to 1
2273
+
let temperature: Double?
2263
2274
/// If true, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a data: [DONE] message.
2264
2275
var stream: Bool
2276
+
/// The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status complete. See incomplete_details for more info.
2277
+
let maxPromptTokens: Int?
2278
+
/// The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status complete. See incomplete_details for more info.
2279
+
let maxCompletionTokens: Int?
2280
+
2281
+
let truncationStrategy: TruncationStrategy?
2282
+
/// Controls which (if any) tool is called by the model. none means the model will not call any tools and instead generates a message. auto is the default value and means the model can pick between generating a message or calling a tool. Specifying a particular tool like {"type": "TOOL_TYPE"} or {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool.
2283
+
let toolChoice: ToolChoice?
2284
+
/// Specifies the format that the model must output. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.
2285
+
/// Setting to { "type": "json_object" } enables JSON mode, which guarantees the message the model generates is valid JSON.
2286
+
/// Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
2287
+
let responseFormat: ResponseFormat?
2265
2288
}
2266
2289
```
2267
2290
[Modify a Run](https://platform.openai.com/docs/api-reference/runs/modifyRun)
@@ -2339,6 +2362,8 @@ public struct RunObject: Decodable {
2339
2362
public let failedAt: Int?
2340
2363
/// The Unix timestamp (in seconds) for when the run was completed.
2341
2364
public let completedAt: Int?
2365
+
/// Details on why the run is incomplete. Will be null if the run is not incomplete.
2366
+
public let incompleteDetails: IncompleteDetails?
2342
2367
/// The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.
2343
2368
public let model: String
2344
2369
/// The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run.
@@ -2349,6 +2374,14 @@ public struct RunObject: Decodable {
2349
2374
public let fileIDS: [String]
2350
2375
/// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
2351
2376
public let metadata: [String: String]
2377
+
/// Usage statistics related to the run. This value will be null if the run is not in a terminal state (i.e. in_progress, queued, etc.).
2378
+
public let usage: Usage?
2379
+
/// The sampling temperature used for this run. If not set, defaults to 1.
2380
+
public let temperature: Double?
2381
+
/// The maximum number of prompt tokens specified to have been used over the course of the run.
2382
+
public let maxPromptTokens: Int?
2383
+
/// The maximum number of completion tokens specified to have been used over the course of the run.
Copy file name to clipboardExpand all lines: Sources/OpenAI/Azure/DefaultOpenAIAzureService.swift
+1-1
Original file line number
Diff line number
Diff line change
@@ -205,7 +205,7 @@ final public class DefaultOpenAIAzureService: OpenAIService {
205
205
fatalError("Currently, this API is not supported. We welcome and encourage contributions to our open-source project. Please consider opening an issue or submitting a pull request to add support for this feature.")
fatalError("Currently, this API is not supported. We welcome and encourage contributions to our open-source project. Please consider opening an issue or submitting a pull request to add support for this feature.")
Copy file name to clipboardExpand all lines: Sources/OpenAI/Public/Parameters/Chat/ChatCompletionParameters.swift
-52
Original file line number
Diff line number
Diff line change
@@ -202,42 +202,6 @@ public struct ChatCompletionParameters: Encodable {
202
202
}
203
203
}
204
204
205
-
/// string `none` means the model will not call a function and instead generates a message.
206
-
/// `auto` means the model can pick between generating a message or calling a function.
207
-
/// `object` Specifies a tool the model should use. Use to force the model to call a specific function. The type of the tool. Currently, only` function` is supported. `{"type: "function", "function": {"name": "my_function"}}`
208
-
publicenumToolChoice:Encodable,Equatable{
209
-
case none
210
-
case auto
211
-
case function(type:String="function", name:String)
/// The type of the tool. Currently, only `function` is supported.
@@ -430,22 +394,6 @@ public struct ChatCompletionParameters: Encodable {
430
394
}
431
395
}
432
396
433
-
publicstructResponseFormat:Encodable{
434
-
435
-
/// Defaults to text
436
-
/// Setting to `json_object` enables JSON mode. This guarantees that the message the model generates is valid JSON.
437
-
/// Note that your system prompt must still instruct the model to produce JSON, and to help ensure you don't forget, the API will throw an error if the string JSON does not appear in your system message.
438
-
/// Also note that the message content may be partial (i.e. cut off) if `finish_reason="length"`, which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
Copy file name to clipboardExpand all lines: Sources/OpenAI/Public/Parameters/FineTuning/FineTuningJobParameters.swift
+31-2
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,21 @@ public struct FineTuningJobParameters: Encodable {
29
29
/// Your dataset must be formatted as a JSONL file. You must upload your file with the purpose fine-tune.
30
30
/// See the [fine-tuning guide](https://platform.openai.com/docs/guides/fine-tuning) for more details.
31
31
letvalidationFile:String?
32
+
/// A list of integrations to enable for your fine-tuning job.
33
+
letintegrations:[Integration]?
34
+
/// The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. If a seed is not specified, one will be generated for you.
35
+
letseed:Int?
32
36
33
37
enumCodingKeys:String,CodingKey{
34
38
case model
35
39
case trainingFile ="training_file"
40
+
case hyperparameters
41
+
case suffix
36
42
case validationFile ="validation_file"
43
+
case integrations
44
+
case seed
37
45
}
38
46
39
-
40
47
/// Fine-tuning is [currently available](https://platform.openai.com/docs/guides/fine-tuning/what-models-can-be-fine-tuned) for the following models:
41
48
/// gpt-3.5-turbo-0613 (recommended)
42
49
/// babbage-002
@@ -64,17 +71,39 @@ public struct FineTuningJobParameters: Encodable {
64
71
}
65
72
}
66
73
74
+
publicstructIntegration:Encodable{
75
+
/// The type of integration to enable. Currently, only "wandb" (Weights and Biases) is supported.
76
+
lettype:String
77
+
78
+
letwandb:Wandb
79
+
80
+
publicstructWandb:Encodable{
81
+
/// The name of the project that the new run will be created under.
82
+
letproject:String
83
+
/// A display name to set for the run. If not set, we will use the Job ID as the name.
84
+
letname:String?
85
+
/// The entity to use for the run. This allows you to set the team or username of the WandB user that you would like associated with the run. If not set, the default entity for the registered WandB API key is used.
86
+
letentity:String?
87
+
/// A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}".
Copy file name to clipboardExpand all lines: Sources/OpenAI/Public/Parameters/Model.swift
+11
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,15 @@ public enum Model {
23
23
case gpt4TurboPreview // Currently points to gpt-4-0125-preview.
24
24
/// The latest GPT-4 model intended to reduce cases of “laziness” where the model doesn’t complete a task. Returns a maximum of 4,096 output tokens. [Learn more.](https://openai.com/blog/new-embedding-models-and-api-updates)
25
25
case gpt40125Preview // 128,000 tokens
26
+
/// GPT-4 Turbo with Vision model. Vision requests can now use JSON mode and function calling. gpt-4-turbo currently points to this version.
27
+
/// 128,000 tokens
28
+
/// Up to Dec 2023
29
+
case gpt4Turbo20240409
30
+
/// GPT-4 Turbo with Vision
31
+
/// The latest GPT-4 Turbo model with vision capabilities. Vision requests can now use JSON mode and function calling. Currently points to gpt-4-turbo-2024-04-09.
0 commit comments