Skip to content

Commit

Permalink
fix: bump langchaingo version and go version to latest
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
  • Loading branch information
Abirdcfly committed Jan 3, 2024
1 parent a2fd073 commit c8893d6
Show file tree
Hide file tree
Showing 18 changed files with 118 additions and 74 deletions.
1 change: 1 addition & 0 deletions .github/workflows/example_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
- name: Build operator image
if: steps.cache.outputs.cache-hit != 'true'
run: |
go version
make docker-build
- name: Save operator image to /tmp
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
tags:
- 'v*'
env:
GO_VER: 1.20
GO_VER: 1.21
GO_TAGS: ""
GOPROXY: https://proxy.golang.org/,direct

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.20 as builder
FROM golang:1.21 as builder
ARG GOPROXY=https://goproxy.cn,direct
WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v3.8.7
CONTROLLER_TOOLS_VERSION ?= v0.9.2
CONTROLLER_TOOLS_VERSION ?= v0.13.0

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
.PHONY: kustomize
Expand Down
2 changes: 1 addition & 1 deletion controllers/knowledgebase_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func (r *KnowledgeBaseReconciler) handleFile(ctx context.Context, log logr.Logge
if err != nil {
return err
}
if err = s.AddDocuments(ctx, documents); err != nil {
if _, err = s.AddDocuments(ctx, documents); err != nil {
return err
}
}
Expand Down
3 changes: 2 additions & 1 deletion examples/beijing_gjj_bot/pkg/embedding.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ func (d *Bot) EmbeddingFileTitle(ctx context.Context, fileName string) (err erro
documents = append(documents, schema.Document{PageContent: t})
}
//fmt.Println(d.Tree.String())
return d.DB.AddDocuments(ctx, documents)
_, err = d.DB.AddDocuments(ctx, documents)
return err
}

func (d *Bot) Query(ctx context.Context, text string, chatHistory []string, lastNode *Node) (res string, foundNode *Node, err error) {
Expand Down
4 changes: 2 additions & 2 deletions examples/chat_with_document/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ func (w Workload) EmbedAndStoreDocument(ctx context.Context) error {
if err != nil {
return err
}

return chroma.AddDocuments(ctx, documents)
_, err = chroma.AddDocuments(ctx, documents)
return err
}

func StreamQueryHandler(c *fiber.Ctx) error {
Expand Down
4 changes: 2 additions & 2 deletions examples/chat_with_document/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,6 @@ func loadPDFFiles(ctx context.Context, path string) error {
}

fmt.Printf("Adding %v documents...\n", len(docs))

return db.AddDocuments(ctx, docs)
_, err = db.AddDocuments(ctx, docs)
return err
}
4 changes: 2 additions & 2 deletions examples/embedding/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func main() {
}

// add documents
err = chroma.AddDocuments(context.TODO(), []schema.Document{
_, err = chroma.AddDocuments(context.TODO(), []schema.Document{
{PageContent: "This is a document about cats. Cats are great.",
Metadata: map[string]interface{}{"about": "cat"}},
})
Expand All @@ -58,7 +58,7 @@ func main() {
panic(fmt.Errorf("error add documents to chroma db: %s", err.Error()))
}

err = chroma.AddDocuments(context.TODO(), []schema.Document{
_, err = chroma.AddDocuments(context.TODO(), []schema.Document{
{PageContent: "This is a document about dogs. Dogs are great.",
Metadata: map[string]interface{}{"about": "dog"}},
})
Expand Down
21 changes: 12 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/kubeagi/arcadia

go 1.20
go 1.21

toolchain go1.21.5

require (
github.com/99designs/gqlgen v0.17.40
Expand All @@ -9,18 +11,18 @@ require (
github.com/coreos/go-oidc/v3 v3.7.0
github.com/gin-contrib/requestid v0.0.6
github.com/gin-gonic/gin v1.9.1
github.com/go-logr/logr v1.2.0
github.com/go-logr/logr v1.2.3
github.com/gofiber/fiber/v2 v2.49.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/onsi/ginkgo v1.16.5
github.com/onsi/gomega v1.18.1
github.com/onsi/gomega v1.27.3
github.com/r3labs/sse/v2 v2.10.0
github.com/spf13/cobra v1.4.0
github.com/stretchr/testify v1.8.4
github.com/swaggo/files v1.0.1
github.com/swaggo/gin-swagger v1.6.0
github.com/swaggo/swag v1.16.2
github.com/tmc/langchaingo v0.0.0-20231209214832-00f364f27fe2
github.com/tmc/langchaingo v0.1.3-0.20240102195114-e498d12eb400
github.com/valyala/fasthttp v1.49.0
github.com/vektah/gqlparser/v2 v2.5.10
k8s.io/api v0.24.2
Expand Down Expand Up @@ -48,6 +50,7 @@ require (
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.16.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/goph/emperror v0.17.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.3 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
Expand All @@ -58,6 +61,7 @@ require (
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/nikolalohinski/gonja v1.5.3 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/xid v1.5.0 // indirect
Expand All @@ -67,6 +71,7 @@ require (
github.com/spf13/cast v1.3.1 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/yargevad/filepathx v1.0.0 // indirect
go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 // indirect
golang.org/x/arch v0.6.0 // indirect
golang.org/x/tools v0.16.1 // indirect
Expand All @@ -84,7 +89,7 @@ require (
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/PuerkitoBio/goquery v1.8.1 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/andybalholm/cascadia v1.3.1 // indirect
github.com/andybalholm/cascadia v1.3.2 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
Expand Down Expand Up @@ -117,7 +122,7 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/microcosm-cc/bluemonday v1.0.24 // indirect
github.com/microcosm-cc/bluemonday v1.0.26 // indirect
github.com/minio/minio-go/v7 v7.0.63
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand All @@ -142,7 +147,7 @@ require (
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea // indirect
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.13.0
golang.org/x/sys v0.15.0 // indirect
Expand All @@ -167,5 +172,3 @@ require (
)

replace github.com/amikos-tech/chroma-go => github.com/bjwswang/chroma-go v0.0.0-20231011091545-0041221c9bb3

replace github.com/tmc/langchaingo => github.com/Abirdcfly/langchaingo v0.0.0-20231225085033-c0e23696c583 // TODO remove this replace after https://github.com/tmc/langchaingo/pull/411 is merged and bug https://github.com/tmc/langchaingo/issues/455 is fixed
Loading

0 comments on commit c8893d6

Please sign in to comment.