From bb77a9905d119387c06540f255de3320af6fb290 Mon Sep 17 00:00:00 2001 From: Moritz Althaus Date: Fri, 9 Aug 2024 11:32:07 +0200 Subject: [PATCH 1/2] chore: add imported functions to list of exported symbols --- aleph_alpha_client/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aleph_alpha_client/__init__.py b/aleph_alpha_client/__init__.py index b0654e4..665a901 100644 --- a/aleph_alpha_client/__init__.py +++ b/aleph_alpha_client/__init__.py @@ -77,6 +77,8 @@ "ImageControl", "ImagePromptItemExplanation", "ImageScore", + "load_base64_from_file", + "load_base64_from_url", "POOLING_OPTIONS", "Prompt", "PromptTemplate", @@ -102,4 +104,5 @@ "TokenPromptItemExplanation", "Tokens", "TokenScore", + "__version__", ] From 0b9063379061ed4597bcba21821e945608f7656e Mon Sep 17 00:00:00 2001 From: Moritz Althaus Date: Fri, 9 Aug 2024 11:48:20 +0200 Subject: [PATCH 2/2] style: remove unused imports --- aleph_alpha_client/aleph_alpha_client.py | 4 ---- aleph_alpha_client/detokenization.py | 2 +- aleph_alpha_client/explanation.py | 3 --- aleph_alpha_client/prompt_template.py | 3 +-- aleph_alpha_client/qa.py | 2 +- aleph_alpha_client/summarization.py | 2 +- 6 files changed, 4 insertions(+), 12 deletions(-) diff --git a/aleph_alpha_client/aleph_alpha_client.py b/aleph_alpha_client/aleph_alpha_client.py index ce50cb5..a039e9b 100644 --- a/aleph_alpha_client/aleph_alpha_client.py +++ b/aleph_alpha_client/aleph_alpha_client.py @@ -10,10 +10,8 @@ Optional, Dict, Sequence, - Tuple, Type, Union, - Iterator, ) import aiohttp import asyncio @@ -29,8 +27,6 @@ from aleph_alpha_client.explanation import ( ExplanationRequest, ExplanationResponse, - ExplanationRequest, - ExplanationResponse, ) from aleph_alpha_client.summarization import SummarizationRequest, SummarizationResponse from aleph_alpha_client.qa import QaRequest, QaResponse diff --git a/aleph_alpha_client/detokenization.py b/aleph_alpha_client/detokenization.py index 52bd974..c80b3b5 100644 --- a/aleph_alpha_client/detokenization.py +++ b/aleph_alpha_client/detokenization.py @@ -1,5 +1,5 @@ from dataclasses import dataclass, asdict -from typing import Any, Dict, List, Mapping, Optional, Sequence +from typing import Any, Dict, Mapping, Sequence @dataclass(frozen=True) diff --git a/aleph_alpha_client/explanation.py b/aleph_alpha_client/explanation.py index f7ae023..ed29f40 100644 --- a/aleph_alpha_client/explanation.py +++ b/aleph_alpha_client/explanation.py @@ -9,9 +9,6 @@ Union, ) -# Import Literal with Python 3.7 fallback -from typing_extensions import Literal - from aleph_alpha_client import Text from aleph_alpha_client.prompt import ControlTokenOverlap, Image, Prompt, PromptItem diff --git a/aleph_alpha_client/prompt_template.py b/aleph_alpha_client/prompt_template.py index 0f9e845..dcab716 100644 --- a/aleph_alpha_client/prompt_template.py +++ b/aleph_alpha_client/prompt_template.py @@ -1,6 +1,5 @@ from re import finditer -import re -from typing import Dict, Iterable, Mapping, NewType, Sequence, Tuple, Union +from typing import Dict, Iterable, Mapping, NewType, Tuple, Union from uuid import UUID, uuid4 from liquid import Template diff --git a/aleph_alpha_client/qa.py b/aleph_alpha_client/qa.py index d8e8891..f51a386 100644 --- a/aleph_alpha_client/qa.py +++ b/aleph_alpha_client/qa.py @@ -1,5 +1,5 @@ from dataclasses import asdict, dataclass -from typing import Any, Dict, Mapping, Optional, Sequence +from typing import Any, Mapping, Optional, Sequence from aleph_alpha_client.document import Document diff --git a/aleph_alpha_client/summarization.py b/aleph_alpha_client/summarization.py index 84809dc..e958b29 100644 --- a/aleph_alpha_client/summarization.py +++ b/aleph_alpha_client/summarization.py @@ -1,5 +1,5 @@ from dataclasses import asdict, dataclass -from typing import Any, Dict, Mapping, Sequence +from typing import Any, Mapping from aleph_alpha_client.document import Document