Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42bf122

Browse files
committed
update
1 parent 7daa730 commit 42bf122

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

jigsawstack/image_generation.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing_extensions import Literal, NotRequired, Required, TypedDict
44

55
from ._config import ClientConfig
6-
from .async_request import AsyncRequest
6+
from .async_request import AsyncRequest, AsyncRequestConfig
77
from .request import Request, RequestConfig
88

99

@@ -103,6 +103,7 @@ def image_generation(
103103
self, params: ImageGenerationParams
104104
) -> Union[ImageGenerationResponse, bytes]:
105105
path = "/ai/image_generation"
106+
106107
resp = Request(
107108
config=self.config,
108109
path=path,
@@ -113,7 +114,7 @@ def image_generation(
113114

114115

115116
class AsyncImageGeneration(ClientConfig):
116-
config: RequestConfig
117+
config: AsyncRequestConfig
117118

118119
def __init__(
119120
self,
@@ -122,7 +123,7 @@ def __init__(
122123
headers: Union[Dict[str, str], None] = None,
123124
):
124125
super().__init__(api_key, base_url, headers)
125-
self.config = RequestConfig(
126+
self.config = AsyncRequestConfig(
126127
base_url=base_url,
127128
api_key=api_key,
128129
headers=headers,

tests/test_image_generation.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@
2828
)
2929

3030
IMAGE_URL = "https://images.unsplash.com/photo-1494588024300-e9df7ff98d78?q=80&w=1284&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
31-
FILE_STORE_KEY = jigsaw.store.upload(
32-
requests.get(IMAGE_URL).content,
33-
{"filename": "test_image.jpg", "content_type": "image/jpeg", "overwrite": True},
34-
)
31+
# FILE_STORE_KEY = jigsaw.store.upload(
32+
# requests.get(IMAGE_URL).content,
33+
# {"filename": "test_image.jpg", "content_type": "image/jpeg", "overwrite": True},
34+
# )
3535

3636
TEST_CASES = [
3737
{
@@ -110,13 +110,13 @@
110110
"return_type": "base64",
111111
},
112112
},
113-
{
114-
"name": "with_file_store_key",
115-
"params": {
116-
"prompt": "Apply a cyberpunk style to this image",
117-
"file_store_key": FILE_STORE_KEY,
118-
},
119-
},
113+
# {
114+
# "name": "with_file_store_key",
115+
# "params": {
116+
# "prompt": "Apply a cyberpunk style to this image",
117+
# "file_store_key": FILE_STORE_KEY,
118+
# },
119+
# },
120120
]
121121

122122

0 commit comments

Comments
 (0)