Skip to content

Commit e88924f

Browse files
author
Atharva Vaidya
committed
fix: build errors
1 parent 44ac2bf commit e88924f

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

Sources/CompilerSwiftAI/Function Calling/CompilerClient+Functions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension CompilerClient {
2222
let endpoint = "\(baseURL)/v1/function-call/\(appID.uuidString)"
2323

2424
guard let url = URL(string: endpoint) else {
25-
functionLogger.error("Invalid URL: \(baseURL)")
25+
functionLogger.error("Invalid URL: \(self.baseURL)")
2626
throw URLError(.badURL)
2727
}
2828

Sources/CompilerSwiftAI/Model Calling/CompilerClient+ModelCalling.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extension CompilerClient {
2626
) async throws -> CompletionResponse {
2727
let endpoint = "\(baseURL)/v1/apps/\(appID.uuidString)/end-users/model-call"
2828
guard let url = URL(string: endpoint) else {
29-
modelLogger.error("Invalid URL: \(baseURL)")
29+
modelLogger.error("Invalid URL: \(self.baseURL)")
3030
throw URLError(.badURL)
3131
}
3232

Sources/CompilerSwiftAI/Model Calling/CompilerClient+Streaming.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ extension CompilerClient {
2424
// Prepare all the non-async parts of the request before the Task
2525
let endpoint = "\(baseURL)/v1/apps/\(appID.uuidString)/end-users/model-call/stream"
2626
guard let url = URL(string: endpoint) else {
27-
modelLogger.error("Invalid URL: \(baseURL)")
27+
modelLogger.error("Invalid URL: \(self.baseURL)")
2828
return AsyncThrowingStream { $0.finish(throwing: URLError(.badURL)) }
2929
}
3030

Sources/CompilerSwiftAI/UI/Function Chat/FunctionChatViewModel.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,15 @@ class FunctionChatViewModel<AppState: Encodable & Sendable, Parameters: Decodabl
4040
recordingTask = Task {
4141
do {
4242
isRecording = true
43-
let stream = try await transcriber.startRecordingStream()
43+
let stream = try await transcriber.startStream()
4444

45-
for try await transcription in stream {
46-
inputText = transcription
45+
for try await signal in stream {
46+
switch signal {
47+
case let .rms(float):
48+
print("float: \(float)")
49+
case let .transcription(string):
50+
inputText = string
51+
}
4752
}
4853

4954
isRecording = false

0 commit comments

Comments
 (0)