Skip to content

Remove search, answers, classifications #168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions openai/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from typing import Optional, TYPE_CHECKING

from openai.api_resources import (
Answer,
Classification,
Completion,
Customer,
Edit,
Expand All @@ -21,7 +19,6 @@
Image,
Model,
Moderation,
Search,
)
from openai.error import APIError, InvalidRequestError, OpenAIError

Expand Down Expand Up @@ -55,8 +52,6 @@

__all__ = [
"APIError",
"Answer",
"Classification",
"Completion",
"Customer",
"Edit",
Expand All @@ -71,7 +66,6 @@
"Model",
"Moderation",
"OpenAIError",
"Search",
"api_base",
"api_key",
"api_type",
Expand Down
3 changes: 0 additions & 3 deletions openai/api_resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
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.customer import Customer # noqa: F401
from openai.api_resources.deployment import Deployment # noqa: F401
Expand All @@ -12,4 +10,3 @@
from openai.api_resources.image import Image # noqa: F401
from openai.api_resources.model import Model # noqa: F401
from openai.api_resources.moderation import Moderation # noqa: F401
from openai.api_resources.search import Search # noqa: F401
17 changes: 0 additions & 17 deletions openai/api_resources/answer.py

This file was deleted.

17 changes: 0 additions & 17 deletions openai/api_resources/classification.py

This file was deleted.

19 changes: 1 addition & 18 deletions openai/api_resources/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@

from openai import util
from openai.api_resources.abstract import ListableAPIResource, UpdateableAPIResource
from openai.error import InvalidAPIType, TryAgain
from openai.util import ApiType
from openai.error import TryAgain


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

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

def search(self, **params):
if self.typed_api_type in (ApiType.AZURE, ApiType.AZURE_AD):
return self.request("post", self.instance_url("search"), params)
elif self.typed_api_type == ApiType.OPEN_AI:
return self.request("post", self.instance_url() + "/search", params)
else:
raise InvalidAPIType("Unsupported API type %s" % self.api_type)

def asearch(self, **params):
if self.typed_api_type in (ApiType.AZURE, ApiType.AZURE_AD):
return self.arequest("post", self.instance_url("search"), params)
elif self.typed_api_type == ApiType.OPEN_AI:
return self.arequest("post", self.instance_url() + "/search", params)
else:
raise InvalidAPIType("Unsupported API type %s" % self.api_type)

def embeddings(self, **params):
warnings.warn(
"Engine.embeddings is deprecated, use Embedding.create", DeprecationWarning
Expand Down
2 changes: 0 additions & 2 deletions openai/api_resources/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ def __prepare_file_create(
organization=None,
user_provided_filename=None,
):
if purpose != "search" and model is not None:
raise ValueError("'model' is only meaningful if 'purpose' is 'search'")
requestor = api_requestor.APIRequestor(
api_key,
api_base=api_base or openai.api_base,
Expand Down
51 changes: 0 additions & 51 deletions openai/api_resources/search.py

This file was deleted.

Loading