Skip to content

Commit

Permalink
Merge pull request #27 from PromptPal/feat/gemini
Browse files Browse the repository at this point in the history
feat(gemini): add gemini support
  • Loading branch information
AnnatarHe committed Feb 21, 2024
2 parents fff2b7c + 00cf12a commit bb332f0
Show file tree
Hide file tree
Showing 7 changed files with 358 additions and 76 deletions.
12 changes: 10 additions & 2 deletions ent/schema/project.go
Expand Up @@ -19,9 +19,17 @@ func (Project) Fields() []ent.Field {
field.String("name"),
field.Bool("enabled").Default(true),
field.Int("creator_id").StorageKey("user_projects").Optional(),
field.String("openAIBaseURL").Default("https://api.openai.com/v1"),
field.String("openAIModel").Default("gpt-3.5-turbo"),

// for OpenAI
field.String("openAIBaseURL").Default("https://api.openai.com"),
field.String("openAIToken").Default("").Sensitive(),

// for Google Gemini
field.String("geminiBaseURL").Default("https://generativelanguage.googleapis.com"),
field.String("geminiToken").Default("").Sensitive(),

// the 4 below are for common use. the name just because of legacy design
field.String("openAIModel").Default("gpt-3.5-turbo"),
field.Float("openAITemperature").Default(1),
field.Float("openAITopP").Default(0.9),
field.Int("openAIMaxTokens").Default(0),
Expand Down
56 changes: 41 additions & 15 deletions go.mod
Expand Up @@ -3,56 +3,69 @@ module github.com/PromptPal/PromptPal
go 1.21

require (
entgo.io/ent v0.12.5
entgo.io/ent v0.13.0
github.com/Code-Hex/go-generics-cache v1.3.1
github.com/anargu/gin-brotli v0.0.0-20220116052358-12bf532d5267
github.com/ethereum/go-ethereum v1.13.11
github.com/ethereum/go-ethereum v1.13.12
github.com/gin-contrib/cors v1.5.0
github.com/gin-gonic/gin v1.9.1
github.com/go-sql-driver/mysql v1.7.1
github.com/golang-jwt/jwt/v5 v5.2.0
github.com/google/generative-ai-go v0.8.0
github.com/google/uuid v1.6.0
github.com/graph-gophers/graphql-go v1.5.0
github.com/joho/godotenv v1.5.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/lib/pq v1.10.9
github.com/mattn/go-sqlite3 v1.14.20
github.com/sashabaranov/go-openai v1.19.1
github.com/mattn/go-sqlite3 v1.14.22
github.com/sashabaranov/go-openai v1.19.4
github.com/sirupsen/logrus v1.9.3
github.com/speps/go-hashids/v2 v2.0.1
github.com/stretchr/testify v1.8.4
google.golang.org/api v0.165.0
)

require (
ariga.io/atlas v0.18.0 // indirect
ariga.io/atlas v0.19.1-0.20240218131225-68a53def832c // indirect
cloud.google.com/go/ai v0.3.2 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/longrunning v0.5.5 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/bytedance/sonic v1.10.2 // indirect
github.com/bytedance/sonic v1.11.0 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
github.com/chenzhuoyu/iasm v0.9.1 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v0.7.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/ethereum/c-kzg-4844 v0.4.0 // indirect
github.com/ethereum/c-kzg-4844 v0.4.1 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/inflect v0.19.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.17.0 // indirect
github.com/go-playground/validator/v10 v10.18.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/google/generative-ai-go v0.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.1 // indirect
github.com/hashicorp/hcl/v2 v2.19.1 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/leodido/go-urn v1.3.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
Expand All @@ -65,14 +78,27 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/zclconf/go-cty v1.14.2 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.48.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
go.opentelemetry.io/otel v1.23.1 // indirect
go.opentelemetry.io/otel/metric v1.23.1 // indirect
go.opentelemetry.io/otel/trace v1.23.1 // indirect
golang.org/x/arch v0.7.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/crypto v0.19.0 // indirect
golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/oauth2 v0.17.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/grpc v1.61.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
Expand Down

0 comments on commit bb332f0

Please sign in to comment.