Skip to content

Conversation

@ianlancetaylor
Copy link
Contributor

The googleai and vertexai API support gs URIs or raw image bytes. The genkit flow doesn't permit raw bytes, so use base64 encoding of data URIs as the TypeScript code does.

This revealed that the JSON validation code didn't support Part correctly, as the JSON marshaling didn't match the type as seen by the JSON reflection code. Fortunately the JSON reflection package makes it easy to specify a different schema to use for any type.

Somehow menu.jpeg was submitted as an empty file, so fix that.

Description here...

Checklist (if applicable):

  • Tested (manually, unit tested, etc.)
  • Changelog updated
  • Docs updated
The googleai and vertexai API support gs URIs or raw image bytes.
The genkit flow doesn't permit raw bytes, so use base64 encoding
of data URIs as the TypeScript code does.

This revealed that the JSON validation code didn't support Part
correctly, as the JSON marshaling didn't match the type as seen
by the JSON reflection code. Fortunately the JSON reflection package
makes it easy to specify a different schema to use for any type.

Somehow menu.jpeg was submitted as an empty file, so fix that.
@ianlancetaylor ianlancetaylor requested review from jba and randall77 June 4, 2024 00:45
Copy link
Contributor

@jba jba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out.

@ianlancetaylor ianlancetaylor merged commit 4dd69e5 into main Jun 4, 2024
@ianlancetaylor ianlancetaylor deleted the iant branch June 4, 2024 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants