From e4cce4d9ac23f56a0e2ff2c25a3b26469fe47234 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 13:34:03 +0000 Subject: [PATCH] mod: bump github.com/google/generative-ai-go from 0.18.0 to 0.19.0 Bumps [github.com/google/generative-ai-go](https://github.com/google/generative-ai-go) from 0.18.0 to 0.19.0. - [Release notes](https://github.com/google/generative-ai-go/releases) - [Commits](https://github.com/google/generative-ai-go/compare/v0.18.0...v0.19.0) --- updated-dependencies: - dependency-name: github.com/google/generative-ai-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../google/generative-ai-go/genai/caching.go | 2 +- .../google/generative-ai-go/genai/chat.go | 14 +++++++++++++- .../google/generative-ai-go/genai/files.go | 2 +- .../v1beta/generativelanguage-gen.go | 16 +++++++++++++--- .../genai/internal/gensupport/buffer.go | 16 +++++++++++++--- .../genai/internal/gensupport/doc.go | 16 +++++++++++++--- .../genai/internal/gensupport/error.go | 16 +++++++++++++--- .../genai/internal/gensupport/json.go | 16 +++++++++++++--- .../genai/internal/gensupport/jsonfloat.go | 16 +++++++++++++--- .../genai/internal/gensupport/media.go | 16 +++++++++++++--- .../genai/internal/gensupport/params.go | 16 +++++++++++++--- .../genai/internal/gensupport/resumable.go | 18 ++++++++++++++---- .../genai/internal/gensupport/retry.go | 16 +++++++++++++--- .../internal/gensupport/retryable_linux.go | 16 +++++++++++++--- .../genai/internal/gensupport/send.go | 16 +++++++++++++--- .../genai/internal/gensupport/version.go | 16 +++++++++++++--- .../generative-ai-go/genai/internal/version.go | 18 ++++++++++++++---- vendor/modules.txt | 2 +- 20 files changed, 203 insertions(+), 51 deletions(-) diff --git a/go.mod b/go.mod index 7b1c6797950d..91db64408bc2 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/golang-migrate/migrate/v4 v4.18.1 github.com/golangci/golangci-lint v1.62.2 github.com/google/flatbuffers v24.3.25+incompatible - github.com/google/generative-ai-go v0.18.0 + github.com/google/generative-ai-go v0.19.0 github.com/google/go-cmp v0.6.0 github.com/google/uuid v1.6.0 github.com/gorilla/handlers v1.5.2 diff --git a/go.sum b/go.sum index 4990b6dff256..7ca805361416 100644 --- a/go.sum +++ b/go.sum @@ -954,8 +954,8 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v24.3.25+incompatible h1:CX395cjN9Kke9mmalRoL3d81AtFUxJM+yDthflgJGkI= github.com/google/flatbuffers v24.3.25+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= -github.com/google/generative-ai-go v0.18.0 h1:6ybg9vOCLcI/UpBBYXOTVgvKmcUKFRNj+2Cj3GnebSo= -github.com/google/generative-ai-go v0.18.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E= +github.com/google/generative-ai-go v0.19.0 h1:R71szggh8wHMCUlEMsW2A/3T+5LdEIkiaHSYgSpUgdg= +github.com/google/generative-ai-go v0.19.0/go.mod h1:JYolL13VG7j79kM5BtHz4qwONHkeJQzOCkKXnpqtS/E= github.com/google/gnostic-models v0.6.8 h1:yo/ABAfM5IMRsS1VnXjTBvUb61tFIHozhlYvRgGre9I= github.com/google/gnostic-models v0.6.8/go.mod h1:5n7qKqH0f5wFt+aWF8CW6pZLLNOfYuF5OpfBSENuI8U= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= diff --git a/vendor/github.com/google/generative-ai-go/genai/caching.go b/vendor/github.com/google/generative-ai-go/genai/caching.go index 11d778647641..659c3a31170a 100644 --- a/vendor/github.com/google/generative-ai-go/genai/caching.go +++ b/vendor/github.com/google/generative-ai-go/genai/caching.go @@ -99,7 +99,7 @@ type CachedContentToUpdate struct { // All other fields of the argument CachedContent are ignored. func (c *Client) UpdateCachedContent(ctx context.Context, cc *CachedContent, ccu *CachedContentToUpdate) (*CachedContent, error) { if ccu == nil || ccu.Expiration == nil { - return nil, errors.New("cloud.google.com/go/vertexai/genai.UpdateCachedContent: no update specified") + return nil, errors.New("genai.UpdateCachedContent: no update specified") } cc2 := &CachedContent{ Name: cc.Name, diff --git a/vendor/github.com/google/generative-ai-go/genai/chat.go b/vendor/github.com/google/generative-ai-go/genai/chat.go index 334df1d9d08d..5e44e426b099 100644 --- a/vendor/github.com/google/generative-ai-go/genai/chat.go +++ b/vendor/github.com/google/generative-ai-go/genai/chat.go @@ -70,8 +70,20 @@ func (cs *ChatSession) addToHistory(cands []*Candidate) bool { return false } c.Role = roleModel - cs.History = append(cs.History, c) + cs.History = append(cs.History, copySanitizedModelContent(c)) return true } return false } + +// copySanitizedModelContent creates a (shallow) copy of c with role set to +// model and empty text parts removed. +func copySanitizedModelContent(c *Content) *Content { + newc := &Content{Role: roleModel} + for _, part := range c.Parts { + if t, ok := part.(Text); !ok || len(string(t)) > 0 { + newc.Parts = append(newc.Parts, part) + } + } + return newc +} diff --git a/vendor/github.com/google/generative-ai-go/genai/files.go b/vendor/github.com/google/generative-ai-go/genai/files.go index 7fe57db15fde..81e458658295 100644 --- a/vendor/github.com/google/generative-ai-go/genai/files.go +++ b/vendor/github.com/google/generative-ai-go/genai/files.go @@ -39,7 +39,7 @@ type UploadFileOptions struct { // [http.DetectContentType]. // The supported MIME types are documented on [this page]. // - // [this page]: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=go#supported_file_formats + // [this page]: https://ai.google.dev/gemini-api/docs/document-processing?lang=go#technical-details MIMEType string } diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go index 1163d73f0994..0c428008afc6 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/generativelanguage/v1beta/generativelanguage-gen.go @@ -1,6 +1,16 @@ -// Copyright 2024 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // Code generated file. DO NOT EDIT. diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go index 3d0817ede98a..a790ebc68f6e 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/buffer.go @@ -1,6 +1,16 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go index 752c4b411b24..9a60f2de1173 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/doc.go @@ -1,6 +1,16 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // Package gensupport is an internal implementation detail used by code // generated by the google-api-go-generator tool. diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go index 886c6532b153..9cc3647866fb 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/error.go @@ -1,6 +1,16 @@ -// Copyright 2022 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go index eab49a11eb18..26d8c03bbf36 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/json.go @@ -1,6 +1,16 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go index 13c2f930207b..ed9c53149f9a 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/jsonfloat.go @@ -1,6 +1,16 @@ -// Copyright 2016 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go index 7bddd7a42a16..7db2653107cf 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/media.go @@ -1,6 +1,16 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go index 5f31bc12d28d..fecd8d43658c 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/params.go @@ -1,6 +1,16 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go index 3ffa632a68fd..4268f09b8d6e 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/resumable.go @@ -1,6 +1,16 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport @@ -175,7 +185,7 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err // set to a very small value, in which case no requests will be sent before // the deadline. Return an error to avoid causing a panic. if resp == nil { - return nil, fmt.Errorf("upload request to %v not sent, choose larger value for ChunkRetryDealine", rx.URI) + return nil, fmt.Errorf("upload request to %v not sent, choose larger value for ChunkRetryDeadline", rx.URI) } return resp, nil } diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go index 20b57d925f17..eee51c5d43f3 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retry.go @@ -1,6 +1,16 @@ -// Copyright 2021 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go index a916c3da29b0..30ba0e02262c 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/retryable_linux.go @@ -1,6 +1,16 @@ -// Copyright 2020 Google LLC. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. //go:build linux // +build linux diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go index f61b00f48e0a..b0596f6ef983 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/send.go @@ -1,6 +1,16 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go index 23f6aa24eafa..d8005f9b34b6 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/gensupport/version.go @@ -1,6 +1,16 @@ -// Copyright 2020 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package gensupport diff --git a/vendor/github.com/google/generative-ai-go/genai/internal/version.go b/vendor/github.com/google/generative-ai-go/genai/internal/version.go index e6f17360da4c..caf6a73db5d1 100644 --- a/vendor/github.com/google/generative-ai-go/genai/internal/version.go +++ b/vendor/github.com/google/generative-ai-go/genai/internal/version.go @@ -1,8 +1,18 @@ -// Copyright 2022 Google LLC. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package internal // Version is the current tagged release of the library. -const Version = "0.18.0" +const Version = "0.19.0" diff --git a/vendor/modules.txt b/vendor/modules.txt index 5907641557e8..5932cf86527f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -656,7 +656,7 @@ github.com/golangci/unconvert # github.com/google/flatbuffers v24.3.25+incompatible ## explicit github.com/google/flatbuffers/go -# github.com/google/generative-ai-go v0.18.0 +# github.com/google/generative-ai-go v0.19.0 ## explicit; go 1.21 github.com/google/generative-ai-go/genai github.com/google/generative-ai-go/genai/internal