-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Streaming Response #21
Comments
erdemkose
added a commit
that referenced
this issue
Jan 5, 2024
erdemkose
added a commit
that referenced
this issue
Jan 5, 2024
erdemkose
added a commit
that referenced
this issue
Jan 5, 2024
@ahmadnajmdev How do you like the proposed streaming response change in #23? It requires You can see the example in the README.md file. $client = new GeminiAPI\Client('GEMINI_API_KEY');
$callback = function (GenerateContentResponse $response): void {
static $count = 0;
print "\nResponse #{$count}\n";
print $response->text();
$count++;
};
$client->geminiPro()->generateContentStream(
$callback,
new TextPart('PHP in less than 100 chars')
);
// Response #0
// PHP: a versatile, general-purpose scripting language for web development, popular for
// Response #1
// its simple syntax and rich library of functions. |
Erdem,
Thanks for sharing the proposed streaming response change in #23. It looks
helpful.
Thanks,
Ahmad
…On Fri, Jan 5, 2024, 9:03 AM Erdem Köse ***@***.***> wrote:
@ahmadnajmdev <https://github.com/ahmadnajmdev> How do you like the
proposed streaming response change in #23
<#23>? You can see the
example in the README.md file
https://github.com/gemini-api-php/client/pull/23/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R154
—
Reply to this email directly, view it on GitHub
<#21 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUTIETAALEWAD4IGL3SILUDYM6JTJAVCNFSM6AAAAABBHT7RMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZYGE3TANBQGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
erdemkose
added a commit
that referenced
this issue
Jan 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add Streaming Response
Here is Documentation:
https://ai.google.dev/tutorials/rest_quickstart#stream_generate_content
The text was updated successfully, but these errors were encountered: