@@ -138,33 +138,31 @@ import Testing
138138 func multimodal_rejectsImageURL( ) async throws {
139139 let model = try await getModel ( )
140140 let session = LanguageModelSession ( model: model)
141- let prompt = Transcript . Prompt ( segments: [
142- . text( . init( content: " Describe this image " ) ) ,
143- . image( . init( url: testImageURL) ) ,
144- ] )
145141 do {
146- _ = try await session. respond ( to: prompt)
142+ _ = try await session. respond (
143+ to: " Describe this image " ,
144+ image: . init( url: testImageURL)
145+ )
147146 Issue . record ( " Expected error when image segments are present " )
148147 } catch {
149148 // CoreMLUnsupportedFeatureError is a private struct, so we just check that an error is thrown
150- #expect( true )
149+ #expect( Bool ( true ) )
151150 }
152151 }
153152
154153 @Test @available ( macOS 15 . 0 , iOS 18 . 0 , tvOS 18 . 0 , visionOS 2 . 0 , watchOS 11 . 0 , * )
155154 func multimodal_rejectsImageData( ) async throws {
156155 let model = try await getModel ( )
157156 let session = LanguageModelSession ( model: model)
158- let prompt = Transcript . Prompt ( segments: [
159- . text( . init( content: " Describe this image " ) ) ,
160- . image( . init( data: testImageData, mimeType: " image/jpeg " ) ) ,
161- ] )
162157 do {
163- _ = try await session. respond ( to: prompt)
158+ _ = try await session. respond (
159+ to: " Describe this image " ,
160+ image: . init( data: testImageData, mimeType: " image/jpeg " )
161+ )
164162 Issue . record ( " Expected error when image segments are present " )
165163 } catch {
166164 // CoreMLUnsupportedFeatureError is a private struct, so we just check that an error is thrown
167- #expect( true )
165+ #expect( Bool ( true ) )
168166 }
169167 }
170168 }
0 commit comments