nodejs-docs-samples
nodejs-docs-samples copied to clipboard
bug: multiparts doesn't match to defined types (Part)
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
The issue you're having must be related to a file in this repository. We are unable to provide assistance for issues unrelated to samples in this repository.
Please include as much information as possible:
In which file did you encounter the issue?
I was using generative snippets so I see this issue in generative/snippets
in a few files which uses the multipart.
-
generative/snippets/nonStreamingMultipartContent.js
-
generative/snippets/sendMultiModalPromptWithImage.js
-
generative/snippets/sendMultiModalPromptWithVideo.js
-
generative/snippets/streamMultipartContent.js
Did you change the file? If so, how?
No
Describe the issue
The issue is in using Parts inside generative/snippets
apart from text
other Parts like file, inline needs to be updated to snake_case instead of pascalCase because the types were defined in snake_case. This will be problem helpful for users who are trying with TS.
Thanks!
Hi @5war00p - thanks so much for adding the issue! Is this specifically for typescript users that you are adding this issue for? As it stands, these samples target vanilla JS and follows the request body structure stipulated in https://cloud.google.com/vertex-ai/docs/generative-ai/model-reference/gemini#request_body.
Yes, I couldn't find Typescript samples and the npm package is not running these examples properly, so I went through protos and created this PR.
But I didn't try the js mode of this npm package.
@5war00p As there aren't any ts gen ai samples at this time, we will make a note of the need to update the types when we do create ts sample equivalents. Appreciate it, thank you!