Skip to content

Commit 58483b0

Browse files
committed
Update
1 parent ef6dd45 commit 58483b0

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

Tool/Sources/OpenAIService/APIs/ChatCompletionsAPIDefinition.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,6 @@ public enum FunctionCallStrategy: Codable, Equatable {
119119

120120
// MARK: - Stream API
121121

122-
typealias ChatCompletionsStreamAPIBuilder = (
123-
String,
124-
ChatModel,
125-
URL,
126-
ChatCompletionsRequestBody,
127-
ChatGPTPrompt
128-
) -> any ChatCompletionsStreamAPI
129-
130122
protocol ChatCompletionsStreamAPI {
131123
func callAsFunction() async throws -> AsyncThrowingStream<ChatCompletionsStreamDataChunk, Error>
132124
}
@@ -178,15 +170,6 @@ struct ChatCompletionsStreamDataChunk: Codable {
178170

179171
// MARK: - Non Stream API
180172

181-
typealias ChatCompletionsAPIBuilder = (
182-
String,
183-
ChatModel,
184-
URL,
185-
ChatCompletionsRequestBody,
186-
ChatGPTPrompt
187-
)
188-
-> any ChatCompletionsAPI
189-
190173
protocol ChatCompletionsAPI {
191174
func callAsFunction() async throws -> ChatCompletionResponseBody
192175
}

Tool/Sources/OpenAIService/ChatGPTService.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import AIModel
12
import AsyncAlgorithms
23
import Dependencies
34
import Foundation
@@ -63,6 +64,22 @@ public struct ChatGPTError: Error, Codable, LocalizedError {
6364
}
6465
}
6566

67+
typealias ChatCompletionsStreamAPIBuilder = (
68+
String,
69+
ChatModel,
70+
URL,
71+
ChatCompletionsRequestBody,
72+
ChatGPTPrompt
73+
) -> any ChatCompletionsStreamAPI
74+
75+
typealias ChatCompletionsAPIBuilder = (
76+
String,
77+
ChatModel,
78+
URL,
79+
ChatCompletionsRequestBody,
80+
ChatGPTPrompt
81+
) -> any ChatCompletionsAPI
82+
6683
public class ChatGPTService: ChatGPTServiceType {
6784
public var memory: ChatGPTMemory
6885
public var configuration: ChatGPTConfiguration

0 commit comments

Comments
 (0)