exa-py 1.1.4__tar.gz → 1.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of exa-py might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exa_py
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: Python SDK for Exa API.
5
5
  Home-page: https://github.com/exa-labs/exa-py
6
6
  Author: Exa
@@ -136,14 +136,13 @@ CONTENTS_OPTIONS_TYPES = {
136
136
  "highlights": [dict, bool],
137
137
  "summary": [dict, bool],
138
138
  "metadata": [dict, bool],
139
-
139
+ "livecrawl_timeout": [int],
140
+ "livecrawl": [LIVECRAWL_OPTIONS],
141
+ "filter_empty_results": [bool],
140
142
  }
141
143
 
142
144
  # the livecrawl options
143
145
  LIVECRAWL_OPTIONS = Literal["always", "fallback", "never"]
144
- CONTENTS_OPTIONS_TYPES["livecrawl_timeout"] = [int]
145
- CONTENTS_OPTIONS_TYPES["livecrawl"] = [LIVECRAWL_OPTIONS]
146
- CONTENTS_OPTIONS_TYPES["filter_empty_results"] = [bool]
147
146
 
148
147
  # FOR BETA OPTIONS
149
148
  # if is_beta:
@@ -169,6 +168,25 @@ def validate_search_options(
169
168
  f"Invalid type for option '{key}': Expected one of {expected[key]}, got {type(value)}"
170
169
  )
171
170
 
171
+ def is_instance_or_subclass(obj, class_or_tuple):
172
+ if isinstance(class_or_tuple, tuple):
173
+ return any(is_instance_or_subclass(obj, cls) for cls in class_or_tuple)
174
+
175
+ if get_origin(class_or_tuple) is Literal:
176
+ return obj in get_args(class_or_tuple)
177
+
178
+ if get_origin(class_or_tuple) is not None:
179
+ # Handle subscripted generics
180
+ origin = get_origin(class_or_tuple)
181
+ args = get_args(class_or_tuple)
182
+
183
+ if origin is list:
184
+ return isinstance(obj, list) and all(isinstance(item, args[0]) for item in obj)
185
+ elif origin is dict:
186
+ return isinstance(obj, dict) and all(isinstance(k, args[0]) and isinstance(v, args[1]) for k, v in obj.items())
187
+ # Add more cases for other generic types as needed
188
+
189
+ return isinstance(obj, class_or_tuple)
172
190
 
173
191
  class TextContentsOptions(TypedDict, total=False):
174
192
  """A class representing the options that you can specify when requesting text
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: exa-py
3
- Version: 1.1.4
3
+ Version: 1.1.5
4
4
  Summary: Python SDK for Exa API.
5
5
  Home-page: https://github.com/exa-labs/exa-py
6
6
  Author: Exa
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="exa_py",
5
- version="1.1.4",
5
+ version="1.1.5",
6
6
  description="Python SDK for Exa API.",
7
7
  long_description_content_type="text/markdown",
8
8
  long_description=open("README.md").read(),
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes