Skip to content
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

genai: switch to v1beta #63

Merged
merged 2 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions genai/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// To get the protoveneer tool:
// go install cloud.google.com/go/internal/protoveneer/cmd/protoveneer@latest

//go:generate protoveneer -license license.txt config.yaml ../../../googleapis/google-cloud-go/ai/generativelanguage/apiv1/generativelanguagepb
//go:generate protoveneer -license license.txt config.yaml ../../../googleapis/google-cloud-go/ai/generativelanguage/apiv1beta/generativelanguagepb

package genai

Expand All @@ -27,8 +27,8 @@ import (
"reflect"
"strings"

gl "cloud.google.com/go/ai/generativelanguage/apiv1"
pb "cloud.google.com/go/ai/generativelanguage/apiv1/generativelanguagepb"
gl "cloud.google.com/go/ai/generativelanguage/apiv1beta"
pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"

"github.com/google/generative-ai-go/internal"
"github.com/google/generative-ai-go/internal/support"
Expand Down
6 changes: 3 additions & 3 deletions genai/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ func TestLive(t *testing.T) {
}

checkMatch(t,
send("Name puppy breeds.", false),
"Beagle", "Poodle")
jba marked this conversation as resolved.
Show resolved Hide resolved
send("Name the 5 most popular puppy breeds.", false),
"Retriever", "Poodle")

checkMatch(t,
send("Which is best?", true),
"best", "depends", "([Cc]onsider|research|compare)")
"best", "depends", "([Cc]onsider|research|compare|preferences)")
})

t.Run("image", func(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions genai/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package: genai

protoImportPath: cloud.google.com/go/ai/generativelanguage/apiv1/generativelanguagepb
protoImportPath: cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb
supportImportPath: github.com/google/generative-ai-go/internal/support

types:
Expand Down Expand Up @@ -83,6 +83,8 @@ types:
fields:
Index:
type: int32
GroundingAttributions:
omit: true

GenerateContentResponse_PromptFeedback:
name: PromptFeedback
Expand Down Expand Up @@ -114,7 +116,6 @@ types:
type: int32



# Omit everything not explicitly configured.
omitTypes:
- '*'
Expand Down
2 changes: 1 addition & 1 deletion genai/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package genai
import (
"fmt"

pb "cloud.google.com/go/ai/generativelanguage/apiv1/generativelanguagepb"
pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion genai/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package genai
import (
"context"

pb "cloud.google.com/go/ai/generativelanguage/apiv1/generativelanguagepb"
pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
)

// EmbeddingModel creates a new instance of the named embedding model.
Expand Down
2 changes: 1 addition & 1 deletion genai/generativelanguagepb_veneer.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package genai
import (
"fmt"

pb "cloud.google.com/go/ai/generativelanguage/apiv1/generativelanguagepb"
pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"
"github.com/google/generative-ai-go/internal/support"
)

Expand Down
4 changes: 2 additions & 2 deletions genai/list_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package genai
import (
"context"

gl "cloud.google.com/go/ai/generativelanguage/apiv1"
pb "cloud.google.com/go/ai/generativelanguage/apiv1/generativelanguagepb"
gl "cloud.google.com/go/ai/generativelanguage/apiv1beta"
pb "cloud.google.com/go/ai/generativelanguage/apiv1beta/generativelanguagepb"

"google.golang.org/api/iterator"
)
Expand Down
Loading