-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
515c072
commit b9bbe18
Showing
3 changed files
with
67 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
//import Foundation | ||
// | ||
//public class PipelineSession { | ||
// public static let shared = PipelineSession() | ||
// | ||
// public func completion(_ request: Pipeline.Request, runLoopLimit: Int = 10) async throws -> Pipeline.Response { | ||
// var pipelineResponse = Pipeline.Response(steps: []) | ||
// | ||
// for step in request.steps { | ||
// let instructions = PromptTemplate(step.instructions, with: step.inputs) | ||
// | ||
// var req = ChatSessionRequest(service: step.service, model: step.model) | ||
// req.with(history: [.user(content: instructions)]) | ||
// | ||
// let resp = try await ChatSession.shared.completion(req) | ||
// let stepCompletion = Pipeline.Response.Step( | ||
// instructions: instructions, | ||
// inputs: step.inputs, | ||
// outputs: step.outputs, | ||
// messages: resp.messages | ||
// ) | ||
// pipelineResponse.steps.append(stepCompletion) | ||
// | ||
// // TODO: Extract the expected output variables | ||
// } | ||
// | ||
// return pipelineResponse | ||
// } | ||
//} | ||
// | ||
//public struct Pipeline { | ||
// | ||
// public struct Request: Sendable { | ||
// public var steps: [Step] | ||
// | ||
// public struct Step: Sendable { | ||
// public var service: ChatService | ||
// public var model: Model | ||
// public var instructions: String | ||
// public var inputs: [String: String] | ||
// public var outputs: [String: String] | ||
// } | ||
// } | ||
// | ||
// public struct Response: Codable, Sendable { | ||
// public var steps: [Step] | ||
// | ||
// public struct Step: Codable, Sendable { | ||
// public var instructions: String | ||
// public var inputs: [String: String] | ||
// public var outputs: [String: String] | ||
// public var messages: [Message] | ||
// } | ||
// } | ||
//} | ||
// | ||
//enum PipelineSessionError: Error { | ||
// case unknown | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters