Skip to content

Commit 8d18776

Browse files
authored
Remove search, answers, classifications (openai#154) (openai#168)
* Remove search, answers, classifications * mypy * Update test with new format
1 parent 08f8378 commit 8d18776

File tree

10 files changed

+6
-355
lines changed

10 files changed

+6
-355
lines changed

openai/__init__.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
from typing import Optional, TYPE_CHECKING
88

99
from openai.api_resources import (
10-
Answer,
11-
Classification,
1210
Completion,
1311
Customer,
1412
Edit,
@@ -21,7 +19,6 @@
2119
Image,
2220
Model,
2321
Moderation,
24-
Search,
2522
)
2623
from openai.error import APIError, InvalidRequestError, OpenAIError
2724

@@ -55,8 +52,6 @@
5552

5653
__all__ = [
5754
"APIError",
58-
"Answer",
59-
"Classification",
6055
"Completion",
6156
"Customer",
6257
"Edit",
@@ -71,7 +66,6 @@
7166
"Model",
7267
"Moderation",
7368
"OpenAIError",
74-
"Search",
7569
"api_base",
7670
"api_key",
7771
"api_type",

openai/api_resources/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from openai.api_resources.answer import Answer # noqa: F401
2-
from openai.api_resources.classification import Classification # noqa: F401
31
from openai.api_resources.completion import Completion # noqa: F401
42
from openai.api_resources.customer import Customer # noqa: F401
53
from openai.api_resources.deployment import Deployment # noqa: F401
@@ -12,4 +10,3 @@
1210
from openai.api_resources.image import Image # noqa: F401
1311
from openai.api_resources.model import Model # noqa: F401
1412
from openai.api_resources.moderation import Moderation # noqa: F401
15-
from openai.api_resources.search import Search # noqa: F401

openai/api_resources/answer.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

openai/api_resources/classification.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

openai/api_resources/engine.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
from openai import util
55
from openai.api_resources.abstract import ListableAPIResource, UpdateableAPIResource
6-
from openai.error import InvalidAPIType, TryAgain
7-
from openai.util import ApiType
6+
from openai.error import TryAgain
87

98

109
class Engine(ListableAPIResource, UpdateableAPIResource):
@@ -44,22 +43,6 @@ async def agenerate(self, timeout=None, **params):
4443

4544
util.log_info("Waiting for model to warm up", error=e)
4645

47-
def search(self, **params):
48-
if self.typed_api_type in (ApiType.AZURE, ApiType.AZURE_AD):
49-
return self.request("post", self.instance_url("search"), params)
50-
elif self.typed_api_type == ApiType.OPEN_AI:
51-
return self.request("post", self.instance_url() + "/search", params)
52-
else:
53-
raise InvalidAPIType("Unsupported API type %s" % self.api_type)
54-
55-
def asearch(self, **params):
56-
if self.typed_api_type in (ApiType.AZURE, ApiType.AZURE_AD):
57-
return self.arequest("post", self.instance_url("search"), params)
58-
elif self.typed_api_type == ApiType.OPEN_AI:
59-
return self.arequest("post", self.instance_url() + "/search", params)
60-
else:
61-
raise InvalidAPIType("Unsupported API type %s" % self.api_type)
62-
6346
def embeddings(self, **params):
6447
warnings.warn(
6548
"Engine.embeddings is deprecated, use Embedding.create", DeprecationWarning

openai/api_resources/file.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ def __prepare_file_create(
2424
organization=None,
2525
user_provided_filename=None,
2626
):
27-
if purpose != "search" and model is not None:
28-
raise ValueError("'model' is only meaningful if 'purpose' is 'search'")
2927
requestor = api_requestor.APIRequestor(
3028
api_key,
3129
api_base=api_base or openai.api_base,

openai/api_resources/search.py

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)