Skip to content

Commit

Permalink
refactor: marks images as optional (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhermawan authored Jul 30, 2024
1 parent 38f738d commit 85a7c55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/OllamaKit/RequestData/OKChatRequestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public struct OKChatRequestData: Encodable {
public let content: String

/// An optional array of base64-encoded images.
public let images: [String]
public let images: [String]?

public init(role: Role, content: String, images: [String] = []) {
public init(role: Role, content: String, images: [String]? = nil) {
self.role = role
self.content = content
self.images = images
Expand Down
4 changes: 2 additions & 2 deletions Sources/OllamaKit/RequestData/OKGenerateRequestData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public struct OKGenerateRequestData: Encodable {
public let prompt: String

/// /// An optional array of base64-encoded images.
public let images: [String]
public let images: [String]?

/// An optional string specifying the system message.
public var system: String?
Expand All @@ -29,7 +29,7 @@ public struct OKGenerateRequestData: Encodable {
/// Optional ``OKCompletionOptions`` providing additional configuration for the generation request.
public var options: OKCompletionOptions?

public init(model: String, prompt: String, images: [String] = []) {
public init(model: String, prompt: String, images: [String]? = nil) {
self.stream = true
self.model = model
self.prompt = prompt
Expand Down

0 comments on commit 85a7c55

Please sign in to comment.