@@ -304,7 +304,6 @@ direction LR
304
304
class PromptBuilder {
305
305
+withText(string $text) self
306
306
+withInlineImage(string $base64Blob, string $mimeType)
307
- +withLocalImage(string $path, string $mimeType)
308
307
+withRemoteImage(string $uri, string $mimeType)
309
308
+withImageFile(File $file) self
310
309
+withAudioFile(File $file) self
@@ -340,12 +339,12 @@ direction LR
340
339
+generateText() string
341
340
+generateTexts(?int $candidateCount) string[]
342
341
+streamGenerateText() Generator< string >
343
- +generateImage() FileInterface
344
- +generateImages(?int $candidateCount) FileInterface []
345
- +convertTextToSpeech() FileInterface
346
- +convertTextToSpeeches(?int $candidateCount) FileInterface []
347
- +generateSpeech() FileInterface
348
- +generateSpeeches(?int $candidateCount) FileInterface []
342
+ +generateImage() File
343
+ +generateImages(?int $candidateCount) File []
344
+ +convertTextToSpeech() File
345
+ +convertTextToSpeeches(?int $candidateCount) File []
346
+ +generateSpeech() File
347
+ +generateSpeeches(?int $candidateCount) File []
349
348
+generateEmbeddings() Embedding[]
350
349
+getModelRequirements() ModelRequirements
351
350
+isSupported() bool
@@ -468,7 +467,6 @@ direction LR
468
467
class PromptBuilder {
469
468
+withText(string $text) self
470
469
+withInlineImage(string $base64Blob, string $mimeType)
471
- +withLocalImage(string $path, string $mimeType)
472
470
+withRemoteImage(string $uri, string $mimeType)
473
471
+withImageFile(File $file) self
474
472
+withAudioFile(File $file) self
@@ -504,12 +502,12 @@ direction LR
504
502
+generateText() string
505
503
+generateTexts(?int $candidateCount) string[]
506
504
+streamGenerateText() Generator< string >
507
- +generateImage() FileInterface
508
- +generateImages(?int $candidateCount) FileInterface []
509
- +convertTextToSpeech() FileInterface
510
- +convertTextToSpeeches(?int $candidateCount) FileInterface []
511
- +generateSpeech() FileInterface
512
- +generateSpeeches(?int $candidateCount) FileInterface []
505
+ +generateImage() File
506
+ +generateImages(?int $candidateCount) File []
507
+ +convertTextToSpeech() File
508
+ +convertTextToSpeeches(?int $candidateCount) File []
509
+ +generateSpeech() File
510
+ +generateSpeeches(?int $candidateCount) File []
513
511
+generateEmbeddings() Embedding[]
514
512
+getModelRequirements() ModelRequirements
515
513
+isSupported() bool
@@ -535,26 +533,20 @@ direction LR
535
533
}
536
534
}
537
535
538
- namespace AiClientNamespace.Files.Contracts {
539
- class FileInterface {
540
- }
541
- }
542
-
543
536
namespace AiClientNamespace.Files.DTO {
544
- class InlineFile {
545
- +getMimeType() string
546
- +getBase64Data() string
547
- +getJsonSchema() array< string, mixed >$
548
- }
549
- class LocalFile {
537
+ class File {
538
+ +getFileType() FileTypeEnum
550
539
+getMimeType() string
551
- +getPath() string
540
+ +getUrl() ?string
541
+ +getBase64Data() ?string
552
542
+getJsonSchema() array< string, mixed >$
553
543
}
554
- class RemoteFile {
555
- +getMimeType() string
556
- +getUrl() string
557
- +getJsonSchema() array< string, mixed >$
544
+ }
545
+
546
+ namespace AiClientNamespace.Files.Enums {
547
+ class FileTypeEnum {
548
+ INLINE
549
+ REMOTE
558
550
}
559
551
}
560
552
@@ -567,8 +559,7 @@ direction LR
567
559
class MessagePart {
568
560
+getType() MessagePartTypeEnum
569
561
+getText() string?
570
- +getInlineFile() InlineFile?
571
- +getRemoteFile() RemoteFile?
562
+ +getFile() File?
572
563
+getFunctionCall() FunctionCall?
573
564
+getFunctionResponse() FunctionResponse?
574
565
+getJsonSchema() array< string, mixed >$
@@ -584,8 +575,7 @@ direction LR
584
575
namespace AiClientNamespace.Messages.Enums {
585
576
class MessagePartTypeEnum {
586
577
TEXT
587
- INLINE_FILE
588
- REMOTE_FILE
578
+ FILE
589
579
FUNCTION_CALL
590
580
FUNCTION_RESPONSE
591
581
}
@@ -667,14 +657,14 @@ direction LR
667
657
+getJsonSchema() array< string, mixed >$
668
658
%% The following utility methods transform the result candidates into a specific shape.
669
659
+toText() string
670
- +toImageFile() FileInterface
671
- +toAudioFile() FileInterface
672
- +toVideoFile() FileInterface
660
+ +toImageFile() File
661
+ +toAudioFile() File
662
+ +toVideoFile() File
673
663
+toMessage() Message
674
664
+toTexts() string[]
675
- +toImageFiles() FileInterface []
676
- +toAudioFiles() FileInterface []
677
- +toVideoFiles() FileInterface []
665
+ +toImageFiles() File []
666
+ +toAudioFiles() File []
667
+ +toVideoFiles() File []
678
668
+toMessages() Message[]
679
669
}
680
670
class TokenUsage {
@@ -730,26 +720,25 @@ direction LR
730
720
namespace AiClientNamespace.Util {
731
721
class CandidatesUtil {
732
722
+toTexts(Candidate[] $candidates) string[]$
733
- +toImageFiles(Candidate[] $candidates) FileInterface []$
734
- +toAudioFiles(Candidate[] $candidates) FileInterface []$
735
- +toVideoFiles(Candidate[] $candidates) FileInterface []$
723
+ +toImageFiles(Candidate[] $candidates) File []$
724
+ +toAudioFiles(Candidate[] $candidates) File []$
725
+ +toVideoFiles(Candidate[] $candidates) File []$
736
726
+toFirstText(Candidate[] $candidates) string$
737
- +toFirstImageFile(Candidate[] $candidates) FileInterface $
738
- +toFirstAudioFile(Candidate[] $candidates) FileInterface $
739
- +toFirstVideoFile(Candidate[] $candidates) FileInterface $
727
+ +toFirstImageFile(Candidate[] $candidates) File $
728
+ +toFirstAudioFile(Candidate[] $candidates) File $
729
+ +toFirstVideoFile(Candidate[] $candidates) File $
740
730
}
741
731
class MessageUtil {
742
732
+toText(Message $message) string$
743
- +toImageFile(Message $message) FileInterface $
744
- +toAudioFile(Message $message) FileInterface $
745
- +toVideoFile(Message $message) FileInterface $
733
+ +toImageFile(Message $message) File $
734
+ +toAudioFile(Message $message) File $
735
+ +toVideoFile(Message $message) File $
746
736
}
747
737
class RequirementsUtil {
748
738
+inferRequirements(Message[] $messages, ModelConfig $modelConfig) ModelRequirements$
749
739
}
750
740
}
751
741
752
- <<interface>> FileInterface
753
742
<<interface>> OperationInterface
754
743
<<interface>> ResultInterface
755
744
<<Enumeration>> MessageRoleEnum
@@ -772,8 +761,7 @@ direction LR
772
761
PromptBuilder .. EmbeddingOperation : creates
773
762
MessageBuilder .. Message : creates
774
763
Message "1" *-- "1..*" MessagePart
775
- MessagePart "1" o-- "0..1" InlineFile
776
- MessagePart "1" o-- "0..1" RemoteFile
764
+ MessagePart "1" o-- "0..1" File
777
765
MessagePart "1" o-- "0..1" FunctionCall
778
766
MessagePart "1" o-- "0..1" FunctionResponse
779
767
GenerativeAiOperation "1" o-- "0..1" GenerativeAiResult
@@ -788,9 +776,6 @@ direction LR
788
776
OperationInterface ..> OperationStateEnum
789
777
GenerativeAiOperation ..> OperationStateEnum
790
778
Candidate ..> FinishReasonEnum
791
- FileInterface <|-- InlineFile
792
- FileInterface <|-- RemoteFile
793
- FileInterface <|-- LocalFile
794
779
Message <|-- UserMessage
795
780
Message <|-- ModelMessage
796
781
Message <|-- SystemMessage
0 commit comments