Skip to content

Commit

Permalink
Remove deprecated Q&A and summarization
Browse files Browse the repository at this point in the history
  • Loading branch information
mitja-kleider committed Jan 7, 2025
1 parent 346c705 commit cc670fe
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 376 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 9.0.0

- Remove deprecated QA and Summarization functionality

## 8.1.0

### Python support
Expand Down
6 changes: 0 additions & 6 deletions aleph_alpha_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
TokenPromptItemExplanation,
TokenScore,
)
from .qa import QaRequest, QaResponse
from .summarization import SummarizationRequest, SummarizationResponse
from .tokenization import TokenizationRequest, TokenizationResponse
from .utils import load_base64_from_file, load_base64_from_url
from .version import __version__
Expand Down Expand Up @@ -83,14 +81,10 @@
"Prompt",
"PromptTemplate",
"PromptGranularity",
"QaRequest",
"QaResponse",
"QuotaError",
"SemanticEmbeddingRequest",
"SemanticEmbeddingResponse",
"SemanticRepresentation",
"SummarizationRequest",
"SummarizationResponse",
"TargetGranularity",
"TargetPromptItemExplanation",
"TargetScore",
Expand Down
114 changes: 1 addition & 113 deletions aleph_alpha_client/aleph_alpha_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
ExplanationRequest,
ExplanationResponse,
)
from aleph_alpha_client.summarization import SummarizationRequest, SummarizationResponse
from aleph_alpha_client.qa import QaRequest, QaResponse

from aleph_alpha_client.completion import (
CompletionRequest,
CompletionResponse,
Expand Down Expand Up @@ -114,8 +113,6 @@ def _check_api_version(version_str: str):
SemanticEmbeddingRequest,
InstructableEmbeddingRequest,
BatchSemanticEmbeddingRequest,
QaRequest,
SummarizationRequest,
ExplanationRequest,
ExplanationRequest,
]
Expand Down Expand Up @@ -604,61 +601,6 @@ def evaluate(
)
return EvaluationResponse.from_json(response)

def qa(self, request: QaRequest) -> QaResponse:
"""DEPRECATED: `qa` is deprecated and will be removed in the next major release. New
methods of processing Q&A tasks will be provided before this is removed.
Answers a question about documents.
Parameters:
request (QaRequest, required):
Parameters for the qa request.
Examples:
>>> request = QaRequest(
query="Who likes pizza?",
documents=[Document.from_text("Andreas likes pizza.")],
)
>>> response = client.qa(request)
"""
warnings.warn(
"qa is deprecated and will be removed in the next major release. New methods of processing Q&A tasks will be provided before this is removed.",
category=DeprecationWarning,
stacklevel=2,
)
response = self._post_request("qa", request)
return QaResponse.from_json(response)

def summarize(
self,
request: SummarizationRequest,
) -> SummarizationResponse:
"""DEPRECATED: `summarize` is deprecated and will be removed in the next major release. New
methods of processing Summarization tasks will be provided before this is removed.
Summarizes a document.
Parameters:
request (SummarizationRequest, required):
Parameters for the requested summarization.
Examples:
>>> request = SummarizationRequest(
document=Document.from_text("Andreas likes pizza."),
)
>>> response = client.summarize(request, model="luminous-extended")
"""
warnings.warn(
"summarize is deprecated and will be removed in the next major release. New methods of processing Q&A tasks will be provided before this is removed.",
category=DeprecationWarning,
stacklevel=2,
)
response = self._post_request(
"summarize",
request,
)
return SummarizationResponse.from_json(response)

def explain(
self,
request: ExplanationRequest,
Expand Down Expand Up @@ -1350,60 +1292,6 @@ async def evaluate(
)
return EvaluationResponse.from_json(response)

async def qa(self, request: QaRequest) -> QaResponse:
"""DEPRECATED: `qa` is deprecated and will be removed in the next major release. New
methods of processing Q&A tasks will be provided before this is removed.
Answers a question about documents.
Parameters:
request (QaRequest, required):
Parameters for the qa request.
Examples:
>>> request = QaRequest(
query="Who likes pizza?",
documents=[Document.from_text("Andreas likes pizza.")],
)
>>> response = await client.qa(request, model="luminous-extended")
"""
warnings.warn(
"qa is deprecated and will be removed in the next major release. New methods of processing Q&A tasks will be provided before this is removed.",
category=DeprecationWarning,
stacklevel=2,
)
response = await self._post_request("qa", request)
return QaResponse.from_json(response)

async def summarize(
self,
request: SummarizationRequest,
) -> SummarizationResponse:
"""DEPRECATED: `summarize` is deprecated and will be removed in the next major release. New
methods of processing Summarization tasks will be provided before this is removed.
Summarizes a document.
Parameters:
request (SummarizationRequest, required):
Parameters for the requested summarization.
Examples:
>>> request = SummarizationRequest(
document=Document.from_text("Andreas likes pizza."),
)
>>> response = await client.summarize(request, model="luminous-extended")
"""
warnings.warn(
"summarize is deprecated and will be removed in the next major release. New methods of processing Q&A tasks will be provided before this is removed.",
category=DeprecationWarning,
stacklevel=2,
)
response = await self._post_request(
"summarize",
request,
)
return SummarizationResponse.from_json(response)

async def explain(
self,
request: ExplanationRequest,
Expand Down
76 changes: 0 additions & 76 deletions aleph_alpha_client/qa.py

This file was deleted.

57 changes: 0 additions & 57 deletions aleph_alpha_client/summarization.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aleph-alpha-client"
version = "8.1.0"
version = "9.0.0"
description = "python client to interact with Aleph Alpha api endpoints"
authors = ["Aleph Alpha <[email protected]>"]
license = "MIT"
Expand Down
74 changes: 0 additions & 74 deletions tests/test_qa.py

This file was deleted.

Loading

0 comments on commit cc670fe

Please sign in to comment.