-
Notifications
You must be signed in to change notification settings - Fork 18
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
Don't introduce too many helper types for input and output #5
Comments
GenerateContentStream(ctx, "model", []genai.Content{{Parts: parts}}, nil) We can support both. @rakyll What do you think? |
Is there any |
There is Role field in the Content. If we use []Part, how to pass the Role field in? And how to ensure future proof. |
https://pkg.go.dev/google.golang.org/genai#Models.GenerateContent func (m Models) GenerateContent(ctx context.Context, model string, contents []*Content, config GenerateContentConfig) (GenerateContentResponse, error) We have changed the API surface change to []*Content type. |
The current API surface is extremely confusing for
GenerateContent
because it introduces a wide range of indirection with helper types such as:As a user, it's hard for me to understand what's actually supported here without reading the library implementation. Remove all of these types and stick to []Content as inputs and outputs. The following code isn't very hard to write:
The helper types don't help the average Go user because we like orthogonality and less magic. A little bit verbosity is ok to remove indirection.
The text was updated successfully, but these errors were encountered: