-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for search_indices (#64) * Add support for search_indices * Updated with Schnurr's comments * Add version to search (#65) * Make search query required (#67)
- Loading branch information
Showing
5 changed files
with
69 additions
and
11 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,8 +1,9 @@ | ||
from openai.api_resources.answer import Answer # noqa: F401 | ||
from openai.api_resources.classification import Classification # noqa: F401 | ||
from openai.api_resources.completion import Completion # noqa: F401 | ||
from openai.api_resources.engine import Engine # noqa: F401 | ||
from openai.api_resources.error_object import ErrorObject # noqa: F401 | ||
from openai.api_resources.file import File # noqa: F401 | ||
from openai.api_resources.answer import Answer # noqa: F401 | ||
from openai.api_resources.classification import Classification # noqa: F401 | ||
from openai.api_resources.model import Model # noqa: F401 | ||
from openai.api_resources.fine_tune import FineTune # noqa: F401 | ||
from openai.api_resources.model import Model # noqa: F401 | ||
from openai.api_resources.search import Search # noqa: F401 |
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 openai.api_resources.abstract.api_resource import APIResource | ||
|
||
|
||
class Search(APIResource): | ||
api_prefix = "v1" | ||
OBJECT_NAME = "search_indices" | ||
|
||
@classmethod | ||
def class_url(cls): | ||
return "/%s/%s" % (cls.api_prefix, cls.OBJECT_NAME) | ||
|
||
@classmethod | ||
def create_alpha(cls, **params): | ||
instance = cls() | ||
return instance.request("post", f"{cls.class_url()}/search", params) |
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 +1 @@ | ||
VERSION = "0.10.3" | ||
VERSION = "0.10.4" |