-
Notifications
You must be signed in to change notification settings - Fork 273
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 initial prototype supporting the files API #249
Conversation
google/generativeai/client.py
Outdated
request = googleapiclient.http.HttpRequest( | ||
http=httplib2.Http(), | ||
postproc=lambda resp, content: (resp, content), | ||
uri=f"https://{end_point}/$discovery/rest?version=v1beta&labels=GOOGLE_INTERNAL&key={api_key}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove: &labels=GOOGLE_INTERNAL. Also, should we always point to generativelanguage.googleapis.com here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
&labels=GOOGLE_INTERNAL
Done.
always point to
If they override the endpoint shouldn't we respect that? I can't really test this code without that.
Hi @MarkDaoust, thanks for this api. That would be helpful. Though I meet the following error:
Also, does it means it support type: application/pdf now? Though it could by uploading pdf to aistudio, but api wise I don't know how to do it. That would be nice if you could help me with this issue! Thanks in advance! |
Hi @Qxxxx - The API is currently in private preview, so that error is expected. We will not support PDFs via the API. I would recommend taking a look at LlamaIndex for pdf parsing on the client side |
Thanks a lot, this repo is very helpful! |
WIP
When this is done, the code below should work