File tree 3 files changed +17
-16
lines changed
Sources/PerplexityApiSwift
3 files changed +17
-16
lines changed Original file line number Diff line number Diff line change 46
46
47
47
The framework supports various Perplexity AI models through the ` PerplexityModel ` enum:
48
48
49
- - ` .sonar `
50
- - ` .sonarMedium `
51
- - ` .sonarLarge `
52
- - ` .codellama34b `
53
- - ` .llama2_70b `
54
- - ` .mistral7b `
55
- - ` .mixtral8x7b `
49
+ - ` .sonarSmallOnline ` : "llama-3.1-sonar-small-128k-online"
50
+ - ` .sonarLargeOnline ` : "llama-3.1-sonar-large-128k-online"
51
+ - ` .sonarHugeOnline ` : "llama-3.1-sonar-huge-128k-online"
52
+ - ` .sonarSmallChat ` : "llama-3.1-sonar-small-128k-chat"
53
+ - ` .sonarLargeChat ` : "llama-3.1-sonar-large-128k-chat"
54
+ - ` .llama8bInstruct ` : "llama-3.1-8b-instruct"
55
+ - ` .llama70bInstruct ` : "llama-3.1-70b-instruct"
56
56
57
57
## Error Handling
58
58
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public class PerplexityApiSwift {
9
9
self . bearerToken = token
10
10
}
11
11
12
- public func chatCompletion( messages: [ Message ] , model: PerplexityModel = . sonarLarge ) async throws -> PerplexityResponse {
12
+ public func chatCompletion( messages: [ Message ] , model: PerplexityModel = . sonarLargeOnline ) async throws -> PerplexityResponse {
13
13
guard let bearerToken = bearerToken else {
14
14
throw PerplexityError . tokenNotSet
15
15
}
Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
3
public enum PerplexityModel : String {
4
- case sonar = " sonar-small-online "
5
- case sonarMedium = " sonar-medium -online "
6
- case sonarLarge = " sonar-large -online "
7
- case codellama34b = " codellama-34b-instruct "
8
- case llama2_70b = " llama-2-70b -chat "
9
- case mistral7b = " mistral-7b -instruct"
10
- case mixtral8x7b = " mixtral-8x7b -instruct"
4
+ case sonarSmallOnline = " llama-3.1- sonar-small-128k -online"
5
+ case sonarLargeOnline = " llama-3.1- sonar-large-128k -online"
6
+ case sonarHugeOnline = " llama-3.1- sonar-huge-128k -online"
7
+ case sonarSmallChat = " llama-3.1-sonar-small-128k-chat "
8
+ case sonarLargeChat = " llama-3.1-sonar-large-128k -chat "
9
+ case llama8bInstruct = " llama-3.1-8b -instruct"
10
+ case llama70bInstruct = " llama-3.1-70b -instruct"
11
11
}
12
12
13
+ // We can keep this enum if it's still useful for your application
13
14
public enum PerplexityModelSize : String {
14
15
case small = " small "
15
- case medium = " medium "
16
16
case large = " large "
17
+ case huge = " huge "
17
18
}
You can’t perform that action at this time.
0 commit comments