ai code builds kinda
This commit is contained in:
parent
1b0344899f
commit
605ebd6c8b
|
@ -2,6 +2,9 @@ testgo: goimports
|
|||
# GO111MODULE=off go run aistudio.go
|
||||
go run -v aistudio.go
|
||||
|
||||
real:
|
||||
GO111MODULE=off go run aistudio.go
|
||||
|
||||
vet:
|
||||
GO111MODULE=off go vet
|
||||
|
||||
|
|
|
@ -6,7 +6,8 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/google/generative-ai-go/genai"
|
||||
// "github.com/google/generative-ai-go/genai"
|
||||
"cloud.google.com/go/ai/vertexai/genai"
|
||||
"google.golang.org/api/option"
|
||||
)
|
||||
|
||||
|
@ -33,15 +34,8 @@ func main() {
|
|||
},
|
||||
}
|
||||
|
||||
// Create user content
|
||||
userContent := &genai.Content{
|
||||
Parts: []genai.Part{
|
||||
genai.Text("what is the current version of forge on the webpage?"),
|
||||
},
|
||||
}
|
||||
|
||||
// Stream content generation
|
||||
iter := model.GenerateContentStream(ctx, []*genai.Content{userContent}...)
|
||||
iter := model.GenerateContentStream(ctx, genai.Text("what is the current version of forge on the webpage?"))
|
||||
for {
|
||||
resp, err := iter.Next()
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue