-
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 #8 from KevKibe/main
Update: Add `parse_args()` for creating and deleting indexes from CLI, removing `environment` as a parameter, `README.md` update
- Loading branch information
Showing
12 changed files
with
200 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[metadata] | ||
name = docindex | ||
author = Kevin Kibe | ||
version = 0.1.0 | ||
version = 0.2.0 | ||
author_email = [email protected] | ||
description = A package for fast indexing of multiple documents and their metadata on Pinecone. | ||
long_description = file: README.md | ||
|
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,15 @@ | ||
from .docindex import GooglePineconeIndexer | ||
import argparse | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Creates 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") | ||
parser.add_argument("--google_api_key", type=str, help="Google API key") | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
args = parse_args() | ||
pinecone_indexer = GooglePineconeIndexer(args.index_name, args.pinecone_api_key, args.google_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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from .docindex import GooglePineconeIndexer | ||
import argparse | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Deletes 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") | ||
parser.add_argument("--google_api_key", type=str, help="OpenAI API key") | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
args = parse_args() | ||
pinecone_indexer = GooglePineconeIndexer(args.index_name, args.pinecone_api_key, args.google_api_key) | ||
pinecone_indexer.delete_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from .docindex import OpenaiPineconeIndexer | ||
import argparse | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Index documents on Pinecone using OpenAI embeddings.") | ||
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") | ||
parser.add_argument("--openai_api_key", type=str, help="OpenAI API key") | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
args = parse_args() | ||
pinecone_indexer = OpenaiPineconeIndexer(args.index_name, args.pinecone_api_key, args.openai_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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from .docindex import OpenaiPineconeIndexer | ||
import argparse | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser(description="Index documents on Pinecone using OpenAI embeddings.") | ||
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") | ||
parser.add_argument("--openai_api_key", type=str, help="OpenAI API key") | ||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
args = parse_args() | ||
pinecone_indexer = OpenaiPineconeIndexer(args.index_name, args.pinecone_api_key, args.openai_api_key) | ||
pinecone_indexer.delete_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
Oops, something went wrong.