This repository has been archived by the owner on Oct 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: knowledge import to import datasets from knowledge base export a…
…rchives
- Loading branch information
1 parent
29e4400
commit ae7b5f8
Showing
10 changed files
with
149 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
type ClientImportDatasets struct { | ||
Client | ||
} | ||
|
||
func (s *ClientImportDatasets) Customize(cmd *cobra.Command) { | ||
cmd.Use = "import <path> [<dataset-id>...]" | ||
cmd.Short = "Import one or more datasets from an archive (zip) (default: all datasets)" | ||
cmd.Long = `Import one or more datasets from an archive (zip) (default: all datasets). | ||
## IMPORTANT: Embedding functions | ||
Embedding functions are not part of exported knowledge base archives, so you'll have to know the embedding function used to import the archive. | ||
This primarily concerns the choice of the embeddings provider (model) and the embedding dimension. | ||
Note: This is only relevant if you plan to add more documents to the dataset after importing it. | ||
` | ||
cmd.Args = cobra.MinimumNArgs(1) | ||
} | ||
|
||
func (s *ClientImportDatasets) Run(cmd *cobra.Command, args []string) error { | ||
c, err := s.getClient() | ||
if err != nil { | ||
return err | ||
} | ||
|
||
return c.ImportDatasets(cmd.Context(), args[0], args[1:]...) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters