exa-py 1.0.16__tar.gz → 1.0.17__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.
- {exa_py-1.0.16 → exa_py-1.0.17}/PKG-INFO +1 -1
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py/api.py +14 -9
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py.egg-info/PKG-INFO +1 -1
- {exa_py-1.0.16 → exa_py-1.0.17}/setup.py +1 -1
- {exa_py-1.0.16 → exa_py-1.0.17}/README.md +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py/__init__.py +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py/py.typed +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py/utils.py +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py.egg-info/SOURCES.txt +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py.egg-info/dependency_links.txt +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py.egg-info/requires.txt +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/exa_py.egg-info/top_level.txt +0 -0
- {exa_py-1.0.16 → exa_py-1.0.17}/setup.cfg +0 -0
|
@@ -41,9 +41,9 @@ def snake_to_camel(snake_str: str) -> str:
|
|
|
41
41
|
components = snake_str.split("_")
|
|
42
42
|
return components[0] + "".join(x.title() for x in components[1:])
|
|
43
43
|
|
|
44
|
-
|
|
45
44
|
def to_camel_case(data: dict) -> dict:
|
|
46
|
-
"""
|
|
45
|
+
"""
|
|
46
|
+
Convert keys in a dictionary from snake_case to camelCase recursively.
|
|
47
47
|
|
|
48
48
|
Args:
|
|
49
49
|
data (dict): The dictionary with keys in snake_case format.
|
|
@@ -51,8 +51,11 @@ def to_camel_case(data: dict) -> dict:
|
|
|
51
51
|
Returns:
|
|
52
52
|
dict: The dictionary with keys converted to camelCase format.
|
|
53
53
|
"""
|
|
54
|
-
return {
|
|
55
|
-
|
|
54
|
+
return {
|
|
55
|
+
snake_to_camel(k): to_camel_case(v) if isinstance(v, dict) else v
|
|
56
|
+
for k, v in data.items()
|
|
57
|
+
if v is not None
|
|
58
|
+
}
|
|
56
59
|
|
|
57
60
|
def camel_to_snake(camel_str: str) -> str:
|
|
58
61
|
"""Convert camelCase string to snake_case.
|
|
@@ -66,9 +69,9 @@ def camel_to_snake(camel_str: str) -> str:
|
|
|
66
69
|
snake_str = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", camel_str)
|
|
67
70
|
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", snake_str).lower()
|
|
68
71
|
|
|
69
|
-
|
|
70
72
|
def to_snake_case(data: dict) -> dict:
|
|
71
|
-
"""
|
|
73
|
+
"""
|
|
74
|
+
Convert keys in a dictionary from camelCase to snake_case recursively.
|
|
72
75
|
|
|
73
76
|
Args:
|
|
74
77
|
data (dict): The dictionary with keys in camelCase format.
|
|
@@ -76,8 +79,10 @@ def to_snake_case(data: dict) -> dict:
|
|
|
76
79
|
Returns:
|
|
77
80
|
dict: The dictionary with keys converted to snake_case format.
|
|
78
81
|
"""
|
|
79
|
-
return {
|
|
80
|
-
|
|
82
|
+
return {
|
|
83
|
+
camel_to_snake(k): to_snake_case(v) if isinstance(v, dict) else v
|
|
84
|
+
for k, v in data.items()
|
|
85
|
+
}
|
|
81
86
|
|
|
82
87
|
SEARCH_OPTIONS_TYPES = {
|
|
83
88
|
"query": [str], # The query string.
|
|
@@ -430,7 +435,7 @@ class Exa:
|
|
|
430
435
|
self,
|
|
431
436
|
api_key: Optional[str],
|
|
432
437
|
base_url: str = "https://api.exa.ai",
|
|
433
|
-
user_agent: str = "exa-py 1.0.
|
|
438
|
+
user_agent: str = "exa-py 1.0.17",
|
|
434
439
|
):
|
|
435
440
|
"""Initialize the Exa client with the provided API key and optional base URL and user agent.
|
|
436
441
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|