1616from .image_generation import ImageGeneration , AsyncImageGeneration
1717from .classification import Classification , AsyncClassification
1818from .prompt_engine import PromptEngine , AsyncPromptEngine
19+ from .embeddingV2 import EmbeddingV2 , AsyncEmbeddingV2
1920
2021
2122class JigsawStack :
@@ -50,7 +51,7 @@ def __init__(
5051 if api_url is None :
5152 api_url = os .environ .get ("JIGSAWSTACK_API_URL" )
5253 if api_url is None :
53- api_url = f"https://api.jigsawstack.com/v1 "
54+ api_url = f"https://api.jigsawstack.com/"
5455
5556 self .api_key = api_key
5657 self .api_url = api_url
@@ -61,69 +62,76 @@ def __init__(
6162
6263 self .audio = Audio (
6364 api_key = api_key ,
64- api_url = api_url ,
65+ api_url = api_url + "/v1" ,
6566 disable_request_logging = disable_request_logging ,
6667 )
6768 self .web = Web (
6869 api_key = api_key ,
69- api_url = api_url ,
70+ api_url = api_url + "/v1" ,
7071 disable_request_logging = disable_request_logging ,
7172 )
7273 self .sentiment = Sentiment (
7374 api_key = api_key ,
74- api_url = api_url ,
75+ api_url = api_url + "/v1" ,
7576 disable_request_logging = disable_request_logging ,
7677 ).analyze
7778 self .validate = Validate (
7879 api_key = api_key ,
79- api_url = api_url ,
80+ api_url = api_url + "/v1" ,
8081 disable_request_logging = disable_request_logging ,
8182 )
8283 self .summary = Summary (
8384 api_key = api_key ,
84- api_url = api_url ,
85+ api_url = api_url + "/v1" ,
8586 disable_request_logging = disable_request_logging ,
8687 ).summarize
8788 self .vision = Vision (
8889 api_key = api_key ,
89- api_url = api_url ,
90+ api_url = api_url + "/v1" ,
9091 disable_request_logging = disable_request_logging ,
9192 )
9293 self .prediction = Prediction (
9394 api_key = api_key ,
94- api_url = api_url ,
95+ api_url = api_url + "/v1" ,
9596 disable_request_logging = disable_request_logging ,
9697 ).predict
9798 self .text_to_sql = SQL (
9899 api_key = api_key ,
99- api_url = api_url ,
100+ api_url = api_url + "/v1" ,
100101 disable_request_logging = disable_request_logging ,
101102 ).text_to_sql
102103 self .store = Store (
103104 api_key = api_key ,
104- api_url = api_url ,
105+ api_url = api_url + "/v1" ,
105106 disable_request_logging = disable_request_logging ,
106107 )
107108 self .translate = Translate (
108109 api_key = api_key ,
109- api_url = api_url ,
110+ api_url = api_url + "/v1" ,
110111 disable_request_logging = disable_request_logging ,
111112 )
112113
113114 self .embedding = Embedding (
114115 api_key = api_key ,
115- api_url = api_url ,
116+ api_url = api_url + "/v1" ,
116117 disable_request_logging = disable_request_logging ,
117118 ).execute
119+
120+ self .embeddingV2 = EmbeddingV2 (
121+ api_key = api_key ,
122+ api_url = api_url + "/v2" ,
123+ disable_request_logging = disable_request_logging ,
124+ ).execute
125+
118126 self .image_generation = ImageGeneration (
119127 api_key = api_key ,
120- api_url = api_url ,
128+ api_url = api_url + "/v1" ,
121129 disable_request_logging = disable_request_logging ,
122130 ).image_generation
123131
124132 self .classification = Classification (
125133 api_key = api_key ,
126- api_url = api_url ,
134+ api_url = api_url + "/v1" ,
127135 disable_request_logging = disable_request_logging ,
128136 ).classify
129137
@@ -163,84 +171,90 @@ def __init__(
163171 if api_url is None :
164172 api_url = os .environ .get ("JIGSAWSTACK_API_URL" )
165173 if api_url is None :
166- api_url = f"https://api.jigsawstack.com/v1 "
174+ api_url = f"https://api.jigsawstack.com/"
167175
168176 self .api_key = api_key
169177 self .api_url = api_url
170178
171179 self .web = AsyncWeb (
172180 api_key = api_key ,
173- api_url = api_url ,
181+ api_url = api_url + "/v1" ,
174182 disable_request_logging = disable_request_logging ,
175183 )
176184
177185 self .validate = AsyncValidate (
178186 api_key = api_key ,
179- api_url = api_url ,
187+ api_url = api_url + "/v1" ,
180188 disable_request_logging = disable_request_logging ,
181189 )
182190 self .audio = AsyncAudio (
183191 api_key = api_key ,
184- api_url = api_url ,
192+ api_url = api_url + "/v1" ,
185193 disable_request_logging = disable_request_logging ,
186194 )
187195
188196 self .vision = AsyncVision (
189197 api_key = api_key ,
190- api_url = api_url ,
198+ api_url = api_url + "/v1" ,
191199 disable_request_logging = disable_request_logging ,
192200 )
193201
194202 self .store = AsyncStore (
195203 api_key = api_key ,
196- api_url = api_url ,
204+ api_url = api_url + "/v1" ,
197205 disable_request_logging = disable_request_logging ,
198206 )
199207
200208 self .summary = AsyncSummary (
201209 api_key = api_key ,
202- api_url = api_url ,
210+ api_url = api_url + "/v1" ,
203211 disable_request_logging = disable_request_logging ,
204212 ).summarize
205213
206214 self .prediction = AsyncPrediction (
207215 api_key = api_key ,
208- api_url = api_url ,
216+ api_url = api_url + "/v1" ,
209217 disable_request_logging = disable_request_logging ,
210218 ).predict
211219 self .text_to_sql = AsyncSQL (
212220 api_key = api_key ,
213- api_url = api_url ,
221+ api_url = api_url + "/v1" ,
214222 disable_request_logging = disable_request_logging ,
215223 ).text_to_sql
216224
217225 self .sentiment = AsyncSentiment (
218226 api_key = api_key ,
219- api_url = api_url ,
227+ api_url = api_url + "/v1" ,
220228 disable_request_logging = disable_request_logging ,
221229 ).analyze
222230
223231 self .translate = AsyncTranslate (
224232 api_key = api_key ,
225- api_url = api_url ,
233+ api_url = api_url + "/v1" ,
226234 disable_request_logging = disable_request_logging ,
227235 )
228236
229237 self .embedding = AsyncEmbedding (
230238 api_key = api_key ,
231- api_url = api_url ,
239+ api_url = api_url + "/v1" ,
240+ disable_request_logging = disable_request_logging ,
241+ ).execute
242+
243+ self .embeddingV2 = AsyncEmbeddingV2 (
244+ api_key = api_key ,
245+ api_url = api_url + "/v2" ,
232246 disable_request_logging = disable_request_logging ,
233247 ).execute
234248
235249 self .image_generation = AsyncImageGeneration (
236250 api_key = api_key ,
237- api_url = api_url ,
251+ api_url = api_url + "/v1" ,
238252 disable_request_logging = disable_request_logging ,
239253 ).image_generation
240254
241255 self .classification = AsyncClassification (
242256 api_key = api_key ,
243- api_url = api_url ,
257+ api_url = api_url + "/v1" ,
244258 disable_request_logging = disable_request_logging ,
245259 ).classify
246260
0 commit comments