-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from KevKibe/create-delete-index-refactor
Refactor: Move `create_index`, `delete_index`, `doc_model`, `config` sub-modules into utils module.
- Loading branch information
Showing
16 changed files
with
46 additions
and
121 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 was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
from .doc_index import CoherePineconeIndexer | ||
from _openai.doc_index import OpenaiPineconeIndexer | ||
import argparse | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Creates an Index on Pinecone.") | ||
parser = argparse.ArgumentParser(description="Create an Index on Pinecone.") | ||
parser.add_argument("--pinecone_api_key", type=str, help="Pinecone API key") | ||
parser.add_argument("--index_name", type=str, help="Name of the Pinecone index") | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
args = parse_args() | ||
pinecone_indexer = CoherePineconeIndexer(args.index_name, args.pinecone_api_key) | ||
pinecone_indexer = OpenaiPineconeIndexer(args.index_name, args.pinecone_api_key) | ||
pinecone_indexer.create_index() |
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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
from .doc_index import CoherePineconeIndexer | ||
from _openai.doc_index import OpenaiPineconeIndexer | ||
import argparse | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Deletes an Index on Pinecone.") | ||
parser = argparse.ArgumentParser(description="Delete an existing Index on Pinecone.") | ||
parser.add_argument("--pinecone_api_key", type=str, help="Pinecone API key") | ||
parser.add_argument("--index_name", type=str, help="Name of the Pinecone index") | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
args = parse_args() | ||
pinecone_indexer = CoherePineconeIndexer(args.index_name, args.pinecone_api_key) | ||
pinecone_indexer = OpenaiPineconeIndexer(args.index_name, args.pinecone_api_key) | ||
pinecone_indexer.delete_index() |
File renamed without changes.