Skip to content
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

Two Issues with Google Gemini Client library using SaloonPHP #446

Open
derrickobedgiu1 opened this issue Aug 11, 2024 · 1 comment
Open

Comments

@derrickobedgiu1
Copy link

derrickobedgiu1 commented Aug 11, 2024

Hello friends,
Sorry for bundling two issues into one as it seemed fair enough to do it this way. Repository for Reference, Google Gemini API Reference

Issue 1: Inconsistent URL Format for Media Upload

  • Standard format (Consistent in entire codebase): baseUrl/apiVersion/Endpoint.
  • Media upload format: baseUrl/upload/apiVersion/Endpoint
  • Problem: Can't swap order of baseUrl and apiVersion in affected request class to introduce upload in the center to be /upload/apiVersion/Endpoint.
  • Goal: Swap the order from this particular request class instead of manually providing full URL. The only requests that should use full urls are Tuned Model Operations requests (which already are).

Reference: InitiateMediaUploadRequest.php

Issue 2: Streaming Content Response Not Working

  • Tried both SSE (?alt=sse) and JSON streaming
  • Setting stream=true in default config of the request class causes request timeout
  • Without stream=true in config, no stream is returned as the full response will instead be faked to stream.
  • streamGenerateContent excluded from initial release due to this issue

Related Discussion: #336 but didn't solve the issue.

Am looking for guidance or a voluntary PR to the repository to help resolve these issues. The streamGenerateContent request is similar to generateContent, but with a different endpoint.

Thank you @Sammyjo20 and other maintainers of Saloon for the wonderful package.

@charleskoko
Copy link

Issue 1: Inconsistent URL Format for Media Upload

As per Saloon's documentation, using a dedicated connector for media uploads could streamline this. Setting a default URL with /upload included in the connector allows centralized handling for upload requests, avoiding manual URL adjustments.

See Connector Documentation for details.

Issue 2: Streaming Content Timeout

To address streaming response timeouts, consider adjusting the timeout configuration within the request or globally in the connector, as described in the Timeout Configuration Documentation. This can mitigate excessive timeouts in streaming requests.

Looking forward to seeing this evolve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants