Skip to content

Commit

Permalink
examples/pinecone-vectorstore-example: use new embedder (tmc#386)
Browse files Browse the repository at this point in the history
Now that the main module's version was bumped, update the example
to use a proper embedder
  • Loading branch information
eliben authored Dec 1, 2023
1 parent 00bd62f commit 2bb1ca0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/pinecone-vectorstore-example/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.20

require (
github.com/google/uuid v1.3.1
github.com/tmc/langchaingo v0.0.0-20231130223434-98fa24d3e7d2
github.com/tmc/langchaingo v0.0.0-20231201012812-00bd62f849f8
)

require (
Expand Down
2 changes: 2 additions & 0 deletions examples/pinecone-vectorstore-example/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/tmc/langchaingo v0.0.0-20231130223434-98fa24d3e7d2 h1:3arY5l84Sp5SRx+9xY8vXiTpin932qv0BNAOSQbtlHY=
github.com/tmc/langchaingo v0.0.0-20231130223434-98fa24d3e7d2/go.mod h1:WgJkGMb5Ac/WpD6YLo3zRAiHtALrgGnH42Hcu5Rs4/A=
github.com/tmc/langchaingo v0.0.0-20231201012812-00bd62f849f8 h1:pdQMbBjNgWGpCFTBFbgoLUHRLIOnps2qmImP1jbnh+8=
github.com/tmc/langchaingo v0.0.0-20231201012812-00bd62f849f8/go.mod h1:WgJkGMb5Ac/WpD6YLo3zRAiHtALrgGnH42Hcu5Rs4/A=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ import (
"log"

"github.com/google/uuid"
"github.com/tmc/langchaingo/embeddings/openai"
"github.com/tmc/langchaingo/embeddings"
"github.com/tmc/langchaingo/llms/openai"
"github.com/tmc/langchaingo/schema"
"github.com/tmc/langchaingo/vectorstores"
"github.com/tmc/langchaingo/vectorstores/pinecone"
)

func main() {
// Create an embeddings client using the OpenAI API. Requires environment variable OPENAI_API_KEY to be set.
e, err := openai.NewOpenAI()
llm, err := openai.New()
if err != nil {
log.Fatal(err)
}

e, err := embeddings.NewEmbedder(llm)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 2bb1ca0

Please sign in to comment.