diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 134ec67..4dc6494 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,15 +18,15 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version: '>=1.19.5' cache: true - name: golangci-lint - uses: golangci/golangci-lint-action@v3.1.0 + uses: golangci/golangci-lint-action@v6 with: args: --timeout=5m \ No newline at end of file diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5788121..df21777 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -10,11 +10,11 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version: '>=1.19.5' cache: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f42c192..6624ebe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,11 +14,11 @@ jobs: goreleaser: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - run: git fetch --force --tags - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v5 with: go-version: '>=1.19.5' cache: true diff --git a/cmd/escuse-me/cmds/documents/delete-by-query.go b/cmd/escuse-me/cmds/documents/delete-by-query.go index f2f5ac1..0da70cf 100644 --- a/cmd/escuse-me/cmds/documents/delete-by-query.go +++ b/cmd/escuse-me/cmds/documents/delete-by-query.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/documents/delete.go b/cmd/escuse-me/cmds/documents/delete.go index 3a3685d..0656686 100644 --- a/cmd/escuse-me/cmds/documents/delete.go +++ b/cmd/escuse-me/cmds/documents/delete.go @@ -4,8 +4,8 @@ import ( "context" "encoding/json" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/documents/get.go b/cmd/escuse-me/cmds/documents/get.go index 2c0088f..867bc8a 100644 --- a/cmd/escuse-me/cmds/documents/get.go +++ b/cmd/escuse-me/cmds/documents/get.go @@ -6,8 +6,8 @@ import ( "io" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/documents/index.go b/cmd/escuse-me/cmds/documents/index.go index 719cfd6..c817422 100644 --- a/cmd/escuse-me/cmds/documents/index.go +++ b/cmd/escuse-me/cmds/documents/index.go @@ -7,8 +7,8 @@ import ( "io" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/documents/multi-get.go b/cmd/escuse-me/cmds/documents/multi-get.go index 4330d91..3cef767 100644 --- a/cmd/escuse-me/cmds/documents/multi-get.go +++ b/cmd/escuse-me/cmds/documents/multi-get.go @@ -7,8 +7,8 @@ import ( "io" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/documents/search.go b/cmd/escuse-me/cmds/documents/search.go index 73399d8..3bf768f 100644 --- a/cmd/escuse-me/cmds/documents/search.go +++ b/cmd/escuse-me/cmds/documents/search.go @@ -5,8 +5,8 @@ import ( "context" "encoding/json" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/documents/update.go b/cmd/escuse-me/cmds/documents/update.go index 36c3765..1a1e110 100644 --- a/cmd/escuse-me/cmds/documents/update.go +++ b/cmd/escuse-me/cmds/documents/update.go @@ -7,8 +7,8 @@ import ( "strings" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/indices/clone.go b/cmd/escuse-me/cmds/indices/clone.go index 837f69b..72f3d6f 100644 --- a/cmd/escuse-me/cmds/indices/clone.go +++ b/cmd/escuse-me/cmds/indices/clone.go @@ -4,8 +4,8 @@ import ( "bytes" "context" "encoding/json" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/indices/close.go b/cmd/escuse-me/cmds/indices/close.go index 36dbeba..e3b0216 100644 --- a/cmd/escuse-me/cmds/indices/close.go +++ b/cmd/escuse-me/cmds/indices/close.go @@ -3,9 +3,12 @@ package indices import ( "context" "encoding/json" + "io" + "strings" + "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" @@ -13,8 +16,6 @@ import ( "github.com/go-go-golems/glazed/pkg/settings" "github.com/go-go-golems/glazed/pkg/types" "github.com/pkg/errors" - "io" - "strings" ) type CloseIndexCommand struct { diff --git a/cmd/escuse-me/cmds/indices/create-index.go b/cmd/escuse-me/cmds/indices/create-index.go index dc2796b..a293938 100644 --- a/cmd/escuse-me/cmds/indices/create-index.go +++ b/cmd/escuse-me/cmds/indices/create-index.go @@ -6,8 +6,8 @@ import ( "encoding/json" "io" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/cmds/indices/delete-index.go b/cmd/escuse-me/cmds/indices/delete-index.go index 288dc12..2db7462 100644 --- a/cmd/escuse-me/cmds/indices/delete-index.go +++ b/cmd/escuse-me/cmds/indices/delete-index.go @@ -3,8 +3,11 @@ package indices import ( "context" "encoding/json" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" + "io" + "strings" + es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" @@ -12,8 +15,6 @@ import ( "github.com/go-go-golems/glazed/pkg/settings" "github.com/go-go-golems/glazed/pkg/types" "github.com/pkg/errors" - "io" - "strings" ) type DeleteIndexCommand struct { diff --git a/cmd/escuse-me/cmds/indices/flush.go b/cmd/escuse-me/cmds/indices/flush.go index 98d0b5f..bbed300 100644 --- a/cmd/escuse-me/cmds/indices/flush.go +++ b/cmd/escuse-me/cmds/indices/flush.go @@ -3,8 +3,11 @@ package indices import ( "context" "encoding/json" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" + "io" + "strings" + es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" @@ -12,8 +15,6 @@ import ( "github.com/go-go-golems/glazed/pkg/settings" "github.com/go-go-golems/glazed/pkg/types" "github.com/pkg/errors" - "io" - "strings" ) type FlushCommand struct { diff --git a/cmd/escuse-me/cmds/indices/update-mapping.go b/cmd/escuse-me/cmds/indices/update-mapping.go index 04b900a..ef3c696 100644 --- a/cmd/escuse-me/cmds/indices/update-mapping.go +++ b/cmd/escuse-me/cmds/indices/update-mapping.go @@ -8,8 +8,8 @@ import ( "strings" "github.com/elastic/go-elasticsearch/v8/esapi" - "github.com/go-go-golems/escuse-me/cmd/escuse-me/pkg/helpers" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" + "github.com/go-go-golems/escuse-me/pkg/helpers" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/parameters" diff --git a/cmd/escuse-me/main.go b/cmd/escuse-me/main.go index c8da57b..8e139ab 100644 --- a/cmd/escuse-me/main.go +++ b/cmd/escuse-me/main.go @@ -258,6 +258,20 @@ func initAllCommands(helpSystem *help.HelpSystem) error { ls_commands.WithCommandDescriptionOptions( glazed_cmds.WithShort("Commands related to sqleton queries"), ), + ls_commands.WithAddCommandToRowFunc(func( + command glazed_cmds.Command, + row types.Row, + parsedLayers *glazed_layers.ParsedLayers, + ) ([]types.Row, error) { + ret := []types.Row{row} + switch command.(type) { + case *es_cmds.ElasticSearchCommand: + row.Set("type", "escuse-me") + default: + } + + return ret, nil + }), ) if err != nil { diff --git a/cmd/escuse-me/queries/examples/rag-query.yaml b/cmd/escuse-me/queries/examples/rag-query.yaml new file mode 100644 index 0000000..35bb563 --- /dev/null +++ b/cmd/escuse-me/queries/examples/rag-query.yaml @@ -0,0 +1,87 @@ +name: "rag-query" +short: "Execute RAG queries across indexes" +long: "Execute RAG (Retrieval Augmented Generation) queries across multiple indexes with support for metadata filtering and additional fields" + +flags: + - name: query_text + type: string + help: "The main query text to search for" + required: true + - name: index_names + type: stringList + help: "Optional list of indexes to query (uses default indexes if not specified)" + - name: slack_user_id + type: int + help: "Optional Slack user ID for filtering" + - name: slack_app_installation_id + type: int + help: "Optional Slack app installation ID for filtering" + - name: external_uuid + type: string + help: "Optional external UUID for tracking" + - name: show_vectors + type: bool + default: false + help: "Show vector fields in the output" + - name: show_raw_query + type: bool + default: false + help: "Show the raw Elasticsearch query" + - name: size + type: int + default: 10 + help: "Number of results to return per index" + - name: fuzziness + type: string + default: "AUTO" + help: "Fuzziness level for text matching (AUTO, 0, 1, 2)" + +query: + _source: !Concat + - ["id", "content", "metadata", "created_at", "updated_at", "title", "name", "real_name", "subject", "insight_type"] + - !If + test: !Var show_vectors + then: ["content_vector", "metadata_vector"] + else: !Void + size: !Var size + aggs: + insight_types: + terms: + field: "insight_type" + size: 20 + query: + bool: + must: !Concat + - !If + test: !Exists query_text + then: + - multi_match: + query: !Var query_text + fields: [ + "title^3", + "name", + "real_name", + "subject", + "content^2", + "metadata.*" + ] + fuzziness: !Var fuzziness + else: !Void + - !If + test: !Exists slack_user_id + then: + - term: + slack_user_id: !Var slack_user_id + else: !Void + - !If + test: !Exists slack_app_installation_id + then: + - term: + slack_app_installation_id: !Var slack_app_installation_id + else: !Void + - !If + test: !Exists external_uuid + then: + - term: + external_uuid: !Var external_uuid + else: !Void \ No newline at end of file diff --git a/go.mod b/go.mod index 6da0be7..4e6dee6 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ toolchain go1.23.3 require ( github.com/elastic/go-elasticsearch/v8 v8.17.0 - github.com/go-go-golems/clay v0.1.27 - github.com/go-go-golems/geppetto v0.4.34 - github.com/go-go-golems/glazed v0.5.29 + github.com/go-go-golems/clay v0.1.31 + github.com/go-go-golems/geppetto v0.4.36 + github.com/go-go-golems/glazed v0.5.34 github.com/go-go-golems/go-emrichen v0.0.4 - github.com/go-go-golems/parka v0.5.18 + github.com/go-go-golems/parka v0.5.20 github.com/pkg/errors v0.9.1 github.com/rs/zerolog v1.33.0 github.com/spf13/cobra v1.8.1 @@ -58,7 +58,6 @@ require ( github.com/go-logr/stdr v1.2.2 // indirect github.com/go-openapi/errors v0.22.0 // indirect github.com/go-openapi/strfmt v0.23.0 // indirect - github.com/golang-jwt/jwt v3.2.2+incompatible // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -73,7 +72,7 @@ require ( github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/kopoli/go-terminal-size v0.0.0-20170219200355-5c97524c8b54 // indirect github.com/kucherenkovova/safegroup v1.0.2 // indirect - github.com/labstack/echo/v4 v4.12.0 // indirect + github.com/labstack/echo/v4 v4.13.3 // indirect github.com/labstack/gommon v0.4.2 // indirect github.com/lithammer/shortuuid/v3 v3.0.7 // indirect github.com/lucasb-eyer/go-colorful v1.2.0 // indirect @@ -125,7 +124,7 @@ require ( golang.org/x/net v0.33.0 // indirect golang.org/x/sys v0.28.0 // indirect golang.org/x/text v0.21.0 // indirect - golang.org/x/time v0.5.0 // indirect + golang.org/x/time v0.8.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index abf2eee..56aa9f1 100644 --- a/go.sum +++ b/go.sum @@ -83,16 +83,16 @@ github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHk github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= -github.com/go-go-golems/clay v0.1.27 h1:iIaD9wzeB0AN8mzYQMFAoaYlJgG4bZ4IQoyfJXREAXE= -github.com/go-go-golems/clay v0.1.27/go.mod h1:sUiDlOnC0zP8W47TX0xJKfOdPhHgk2UVjyQCGMrjzEs= -github.com/go-go-golems/geppetto v0.4.34 h1:kVQqVqrXPPa+4tRPqAxTbvOAomM9XKd255nuUdBFCfE= -github.com/go-go-golems/geppetto v0.4.34/go.mod h1:HGEsHKvH8HKH89CLWIcueYm46bue7LdFTtsFos3Uzyo= -github.com/go-go-golems/glazed v0.5.29 h1:3KaYdZBmdIymFRwhAhscFbTrpwhLx37VIgCHN+0bDX8= -github.com/go-go-golems/glazed v0.5.29/go.mod h1:/ZgeDXELDOcAkD505fijARmbF6x5Ev7oewNV4V6Andk= +github.com/go-go-golems/clay v0.1.31 h1:5+E/vtKzNXY/VKnyXebaBcvptxSJmWPl4o5AOn/g100= +github.com/go-go-golems/clay v0.1.31/go.mod h1:SEZqdWNIgWO3ox2xSR7O3hqG/d4Sqbh/58mj7oFdGro= +github.com/go-go-golems/geppetto v0.4.36 h1:d3+GU+F9jL/5OcvRWCn1Z9gpLcGL8sfkREo/mZzgO1A= +github.com/go-go-golems/geppetto v0.4.36/go.mod h1:iLPhJydbXU/0PkZHzBxnutXYBXYTV3lSOdiv4pqOgyE= +github.com/go-go-golems/glazed v0.5.34 h1:EByXTz3aQpbApg9PaNBTl5O347GcA80aKqeqrB0IWHE= +github.com/go-go-golems/glazed v0.5.34/go.mod h1:cySRZANlIpuZNBTYkofLe8ls7M6O/aur4spck3J7O7w= github.com/go-go-golems/go-emrichen v0.0.4 h1:U8AKGaxBDjMghiZZe/7sRYiw3UPqRkkbAAc/d2Q9rK4= github.com/go-go-golems/go-emrichen v0.0.4/go.mod h1:yYf0DLUYLLZdvCODdpIBYUxgNz0ZomJFlGhhzlg+fs0= -github.com/go-go-golems/parka v0.5.18 h1:Rsw/ujSkMQ+Xw8XsZiZ/FoTPF+tzPUAXUFA0Xyqxsuo= -github.com/go-go-golems/parka v0.5.18/go.mod h1:gjUXXumO+yrysFQhbzuwKo+l2u5+eJoo51DRHFjlDoU= +github.com/go-go-golems/parka v0.5.20 h1:y5cdyhilXbRI09D148lzAzEtIzlinRgDpdV5FKjpOjI= +github.com/go-go-golems/parka v0.5.20/go.mod h1:HqUJRu52zC+X/AXUIw+pZtHlsNIcE9dkIKpZIr5aWdc= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -103,8 +103,6 @@ github.com/go-openapi/errors v0.22.0/go.mod h1:J3DmZScxCDufmIMsdOuDHxJbdOGC0xtUy github.com/go-openapi/strfmt v0.23.0 h1:nlUS6BCqcnAk0pyhi9Y+kdDVZdZMHfEKQiS4HaMgO/c= github.com/go-openapi/strfmt v0.23.0/go.mod h1:NrtIpfKtWIygRkKVsxh7XQMDQW5HKQl6S5ik2elW+K4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -151,8 +149,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kucherenkovova/safegroup v1.0.2 h1:/FSf2zmnjhRdQUXFMuz1dlakxX9O8PhFW+N/rHzB/ZE= github.com/kucherenkovova/safegroup v1.0.2/go.mod h1:cTr0xuYzcIMvvmGHWgvYQZx5TJghNoYlNvWhJkJnc20= -github.com/labstack/echo/v4 v4.12.0 h1:IKpw49IMryVB2p1a4dzwlhP1O2Tf2E0Ir/450lH+kI0= -github.com/labstack/echo/v4 v4.12.0/go.mod h1:UP9Cr2DJXbOK3Kr9ONYzNowSh7HP0aG0ShAyycHSJvM= +github.com/labstack/echo/v4 v4.13.3 h1:pwhpCPrTl5qry5HRdM5FwdXnhXSLSY+WE+YQSeCaafY= +github.com/labstack/echo/v4 v4.13.3/go.mod h1:o90YNEeQWjDozo584l7AwhJMHN0bOC4tAfg+Xox9q5g= github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= github.com/lithammer/shortuuid/v3 v3.0.7 h1:trX0KTHy4Pbwo/6ia8fscyHoGA+mf1jWbPJVuvyJQQ8= @@ -208,8 +206,8 @@ github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= @@ -242,8 +240,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tj/assert v0.0.0-20190920132354-ee03d75cd160 h1:NSWpaDaurcAJY7PkL8Xt0PhZE7qpvbZl5ljd8r6U0bI= @@ -336,8 +335,8 @@ golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.8.0 h1:9i3RxcPv3PZnitoVGMPDKZSq1xW1gK1Xy3ArNOGZfEg= +golang.org/x/time v0.8.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= diff --git a/pkg/cmds/cmd.go b/pkg/cmds/cmd.go index a1be227..b5a17fe 100644 --- a/pkg/cmds/cmd.go +++ b/pkg/cmds/cmd.go @@ -13,6 +13,7 @@ import ( "github.com/elastic/go-elasticsearch/v8/esapi" es_layers "github.com/go-go-golems/escuse-me/pkg/cmds/layers" "github.com/go-go-golems/geppetto/pkg/embeddings" + embeddings_config "github.com/go-go-golems/geppetto/pkg/embeddings/config" "github.com/go-go-golems/glazed/pkg/cmds" "github.com/go-go-golems/glazed/pkg/cmds/layers" "github.com/go-go-golems/glazed/pkg/cmds/layout" @@ -74,7 +75,7 @@ func NewElasticSearchCommand( if err != nil { return nil, err } - embeddingsLayer, err := embeddings.NewEmbeddingsFlagsLayer() + embeddingsLayer, err := embeddings_config.NewEmbeddingsParameterLayer() if err != nil { return nil, err } @@ -115,8 +116,8 @@ func (esc *ElasticSearchCommand) RunIntoGlazeProcessor( // TODO(2022-12-21, manuel): Add explain functionality // See: https://github.com/wesen/sqleton/issues/45 - embeddingsSettings := &embeddings.EmbeddingsConfig{} - err = parsedLayers.InitializeStruct(embeddings.EmbeddingsSlug, embeddingsSettings) + embeddingsSettings := &embeddings_config.EmbeddingsConfig{} + err = parsedLayers.InitializeStruct(embeddings_config.EmbeddingsSlug, embeddingsSettings) if err != nil { return err } @@ -298,8 +299,8 @@ func (esc *ElasticSearchCommand) RunQueryIntoGlaze( return err } - embeddingsSettings := &embeddings.EmbeddingsConfig{} - err = parsedLayers.InitializeStruct(embeddings.EmbeddingsSlug, embeddingsSettings) + embeddingsSettings := &embeddings_config.EmbeddingsConfig{} + err = parsedLayers.InitializeStruct(embeddings_config.EmbeddingsSlug, embeddingsSettings) if err != nil { return err } diff --git a/pkg/cmds/cobra.go b/pkg/cmds/cobra.go index 4700929..bbc1eef 100644 --- a/pkg/cmds/cobra.go +++ b/pkg/cmds/cobra.go @@ -5,7 +5,7 @@ import ( "os" "github.com/go-go-golems/escuse-me/pkg/cmds/layers" - "github.com/go-go-golems/geppetto/pkg/embeddings" + embeddings_config "github.com/go-go-golems/geppetto/pkg/embeddings/config" "github.com/go-go-golems/glazed/pkg/cli" "github.com/go-go-golems/glazed/pkg/cmds" layers2 "github.com/go-go-golems/glazed/pkg/cmds/layers" @@ -20,7 +20,7 @@ func BuildCobraCommandWithEscuseMeMiddlewares( ) (*cobra.Command, error) { options_ := append([]cli.CobraParserOption{ cli.WithCobraMiddlewaresFunc(GetCobraCommandEscuseMeMiddlewares), - cli.WithCobraShortHelpLayers(layers2.DefaultSlug, layers.EsConnectionSlug, layers.ESHelpersSlug, embeddings.EmbeddingsSlug), + cli.WithCobraShortHelpLayers(layers2.DefaultSlug, layers.EsConnectionSlug, layers.ESHelpersSlug, embeddings_config.EmbeddingsSlug), }, options...) return cli.BuildCobraCommandFromCommand(cmd, options_...) @@ -84,7 +84,7 @@ func GetCobraCommandEscuseMeMiddlewares( []string{ layers.EsConnectionSlug, layers.ESHelpersSlug, - embeddings.EmbeddingsSlug, + embeddings_config.EmbeddingsSlug, }, middlewares.GatherFlagsFromViper(parameters.WithParseStepSource("viper")), ), diff --git a/cmd/escuse-me/pkg/helpers/error.go b/pkg/helpers/error.go similarity index 100% rename from cmd/escuse-me/pkg/helpers/error.go rename to pkg/helpers/error.go