@@ -75,7 +75,6 @@ $texts = AiClient::generateTextResult(
75
75
``` php
76
76
$imageFile = AiClient::prompt('Generate an illustration of the PHP elephant in the Carribean sea.')
77
77
->usingProvider('openai')
78
- ->usingModelSupportingImages() // Optional.
79
78
->generateImage();
80
79
```
81
80
@@ -99,7 +98,6 @@ $imageFile = AiClient::generateImageResult(
99
98
##### Fluent API
100
99
``` php
101
100
$imageFile = AiClient::prompt('Generate an illustration of the PHP elephant in the Carribean sea.')
102
- ->usingModelSupportingImages() // Optional.
103
101
->generateImage();
104
102
```
105
103
@@ -123,8 +121,17 @@ _Note: This does effectively the exact same as [the first code example](#generat
123
121
124
122
##### Fluent API
125
123
``` php
124
+ $providerModelsMetadata = AiClient::defaultRegistry()->findModelsMetadataForSupport(
125
+ new AiModelRequirements([AiCapability::TEXT_GENERATION])
126
+ );
127
+
126
128
$text = AiClient::prompt('Write a 2-verse poem about PHP.')
127
- ->usingModelSupportingText() // Optional.
129
+ ->withModel(
130
+ AiClient::defaultRegistry()->getProviderModel(
131
+ $providerModelsMetadata[0]->getProvider()->getId(),
132
+ $providerModelsMetadata[0]->getModels()[0]->getId()
133
+ )
134
+ )
128
135
->generateText();
129
136
```
130
137
@@ -320,20 +327,6 @@ direction LR
320
327
+withMessageParts(...MessagePart $part) self
321
328
+withHistory(...Message $messages) self
322
329
+usingModel(AiModel $model) self
323
- +usingModelSupporting(...AiCapability|AiOption $aiCapabilityOrOption) self
324
- +usingModelSupportingCapability(...AiCapability $aiCapability) self
325
- +usingModelSupportingOption(...AiOption $aiOption) self
326
- +usingModelSupportingAudio() self
327
- +usingModelSupportingHistory() self
328
- +usingModelSupportingEmbeddings() self
329
- +usingModelSupportingImages() self
330
- +usingModelSupportingJsonOutput() self
331
- +usingModelSupportingMusic() self
332
- +usingModelSupportingOutputSchema() self
333
- +usingModelSupportingSpeech() self
334
- +usingModelSupportingText() self
335
- +usingModelSupportingTextToSpeech() self
336
- +usingModelSupportingVideo() self
337
330
+usingSystemInstruction(string|MessagePart[]|Message $systemInstruction) self
338
331
+usingMaxTokens(int $maxTokens) self
339
332
+usingTemperature(float $temperature) self
@@ -507,20 +500,6 @@ direction LR
507
500
+withMessageParts(...MessagePart $part) self
508
501
+withHistory(...Message $messages) self
509
502
+usingModel(AiModel $model) self
510
- +usingModelSupporting(...AiCapability|AiOption $aiCapabilityOrOption) self
511
- +usingModelSupportingCapability(...AiCapability $aiCapability) self
512
- +usingModelSupportingOption(...AiOption $aiOption) self
513
- +usingModelSupportingAudio() self
514
- +usingModelSupportingHistory() self
515
- +usingModelSupportingEmbeddings() self
516
- +usingModelSupportingImages() self
517
- +usingModelSupportingJsonOutput() self
518
- +usingModelSupportingMusic() self
519
- +usingModelSupportingOutputSchema() self
520
- +usingModelSupportingSpeech() self
521
- +usingModelSupportingText() self
522
- +usingModelSupportingTextToSpeech() self
523
- +usingModelSupportingVideo() self
524
503
+usingSystemInstruction(string|MessagePart[]|Message $systemInstruction) self
525
504
+usingMaxTokens(int $maxTokens) self
526
505
+usingTemperature(float $temperature) self
0 commit comments