2121
2222
2323class JigsawStack :
24- audio : Audio
25- vision : Vision
26- image_generation : ImageGeneration
27- file : Store
28- web : Web
29- search : Search
30- classification : Classification
31- prompt_engine : PromptEngine
3224 api_key : str
3325 api_url : str
3426 headers : Dict [str , str ]
35- # disable_request_logging: bool
27+ audio : Audio
28+ classification : Classification
29+ embedding : Embedding
30+ embedding_v2 : EmbeddingV2
31+ store : Store
32+ image_generation : ImageGeneration
33+ prediction : Prediction
34+ prompt_engine : PromptEngine
35+ sentiment : Sentiment
36+ summary : Summary
37+ text_to_sql : SQL
38+ translate : Translate
39+ validate : Validate
40+ vision : Vision
41+ web : Web
3642
3743 def __init__ (
3844 self ,
3945 api_key : Union [str , None ] = None ,
4046 api_url : Union [str , None ] = None ,
41- # disable_request_logging: Union[bool, None] = None,
4247 headers : Union [Dict [str , str ], None ] = None ,
4348 ) -> None :
4449 if api_key is None :
@@ -66,16 +71,19 @@ def __init__(
6671 api_url = api_url + "/v1" ,
6772 disable_request_logging = disable_request_logging ,
6873 )
74+
6975 self .web = Web (
7076 api_key = api_key ,
7177 api_url = api_url + "/v1" ,
7278 disable_request_logging = disable_request_logging ,
7379 )
80+
7481 self .sentiment = Sentiment (
7582 api_key = api_key ,
7683 api_url = api_url + "/v1" ,
7784 disable_request_logging = disable_request_logging ,
7885 ).analyze
86+
7987 self .validate = Validate (
8088 api_key = api_key ,
8189 api_url = api_url + "/v1" ,
@@ -86,21 +94,25 @@ def __init__(
8694 api_url = api_url + "/v1" ,
8795 disable_request_logging = disable_request_logging ,
8896 ).summarize
97+
8998 self .vision = Vision (
9099 api_key = api_key ,
91100 api_url = api_url + "/v1" ,
92101 disable_request_logging = disable_request_logging ,
93102 )
103+
94104 self .prediction = Prediction (
95105 api_key = api_key ,
96106 api_url = api_url + "/v1" ,
97107 disable_request_logging = disable_request_logging ,
98108 ).predict
109+
99110 self .text_to_sql = SQL (
100111 api_key = api_key ,
101112 api_url = api_url + "/v1" ,
102113 disable_request_logging = disable_request_logging ,
103114 ).text_to_sql
115+
104116 self .store = Store (
105117 api_key = api_key ,
106118 api_url = api_url + "/v1" ,
@@ -118,7 +130,7 @@ def __init__(
118130 disable_request_logging = disable_request_logging ,
119131 ).execute
120132
121- self .embeddingV2 = EmbeddingV2 (
133+ self .embedding_v2 = EmbeddingV2 (
122134 api_key = api_key ,
123135 api_url = api_url + "/v2" ,
124136 disable_request_logging = disable_request_logging ,
@@ -144,16 +156,24 @@ def __init__(
144156
145157
146158class AsyncJigsawStack :
147- validate : AsyncValidate
148- web : AsyncWeb
159+ api_key : str
160+ api_url : str
161+ headers : Dict [str , str ]
149162 audio : AsyncAudio
150- vision : AsyncVision
163+ classification : AsyncClassification
164+ embedding : AsyncEmbedding
165+ embedding_v2 : AsyncEmbeddingV2
151166 image_generation : AsyncImageGeneration
152- store : AsyncStore
167+ prediction : AsyncPrediction
153168 prompt_engine : AsyncPromptEngine
154- api_key : str
155- api_url : str
156- disable_request_logging : bool
169+ sentiment : AsyncSentiment
170+ store : AsyncStore
171+ summary : AsyncSummary
172+ text_to_sql : AsyncSQL
173+ translate : AsyncTranslate
174+ validate : AsyncValidate
175+ vision : AsyncVision
176+ web : AsyncWeb
157177
158178 def __init__ (
159179 self ,
@@ -176,6 +196,7 @@ def __init__(
176196
177197 self .api_key = api_key
178198 self .api_url = api_url
199+ disable_request_logging = self .headers .get ("x-jigsaw-no-request-log" )
179200
180201 self .web = AsyncWeb (
181202 api_key = api_key ,
@@ -217,6 +238,7 @@ def __init__(
217238 api_url = api_url + "/v1" ,
218239 disable_request_logging = disable_request_logging ,
219240 ).predict
241+
220242 self .text_to_sql = AsyncSQL (
221243 api_key = api_key ,
222244 api_url = api_url + "/v1" ,
@@ -241,7 +263,7 @@ def __init__(
241263 disable_request_logging = disable_request_logging ,
242264 ).execute
243265
244- self .embeddingV2 = AsyncEmbeddingV2 (
266+ self .embedding_v2 = AsyncEmbeddingV2 (
245267 api_key = api_key ,
246268 api_url = api_url + "/v2" ,
247269 disable_request_logging = disable_request_logging ,
0 commit comments