File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,20 +40,6 @@ const SUPPORTED_ASPECT_RATIOS = [
4040] as const ;
4141const OPENROUTER_IMAGE_MALFORMED_RESPONSE = "OpenRouter image generation response malformed" ;
4242
43- type OpenRouterImageEntry = {
44- image_url ?: { url ?: string } ;
45- imageUrl ?: { url ?: string } ;
46- } ;
47-
48- type OpenRouterChatCompletionResponse = {
49- choices ?: Array < {
50- message ?: {
51- content ?: string | unknown [ ] | null ;
52- images ?: OpenRouterImageEntry [ ] ;
53- } ;
54- } > ;
55- } ;
56-
5743function isRecord ( value : unknown ) : value is Record < string , unknown > {
5844 return Boolean ( value && typeof value === "object" && ! Array . isArray ( value ) ) ;
5945}
@@ -150,7 +136,7 @@ function extractImagesFromPart(
150136}
151137
152138export function extractOpenRouterImagesFromResponse (
153- body : OpenRouterChatCompletionResponse | unknown ,
139+ body : unknown ,
154140 options : { malformedResponseError ?: string } = { } ,
155141) : GeneratedImageAsset [ ] {
156142 if ( ! isRecord ( body ) ) {
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ export function generatedImageAssetFromOpenAiCompatibleEntry(
186186}
187187
188188export function parseOpenAiCompatibleImageResponse (
189- payload : OpenAiCompatibleImageResponsePayload | unknown ,
189+ payload : unknown ,
190190 options : {
191191 defaultMimeType ?: string ;
192192 fileNamePrefix ?: string ;
You can’t perform that action at this time.
0 commit comments