Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "credal"

[tool.poetry]
name = "credal"
version = "0.1.6"
version = "0.1.7"
description = ""
readme = "README.md"
authors = []
Expand Down
18 changes: 10 additions & 8 deletions src/credal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@
"UserMetadataPatch": ".users",
"WebSearchResult": ".copilots",
"__version__": ".version",
"common": ".",
"copilots": ".",
"document_catalog": ".",
"document_collections": ".",
"search": ".",
"users": ".",
"common": ".common",
"copilots": ".copilots",
"document_catalog": ".document_catalog",
"document_collections": ".document_collections",
"search": ".search",
"users": ".users",
}


Expand All @@ -182,8 +182,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/common/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/copilots/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/copilots/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
4 changes: 2 additions & 2 deletions src/credal/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def __init__(

def get_headers(self) -> typing.Dict[str, str]:
headers: typing.Dict[str, str] = {
"User-Agent": "credal/0.1.6",
"User-Agent": "credal/0.1.7",
"X-Fern-Language": "Python",
"X-Fern-SDK-Name": "credal",
"X-Fern-SDK-Version": "0.1.6",
"X-Fern-SDK-Version": "0.1.7",
**(self.get_custom_headers() or {}),
}
headers["Authorization"] = f"Bearer {self._get_api_key()}"
Expand Down
6 changes: 4 additions & 2 deletions src/credal/document_catalog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/document_catalog/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/document_collections/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/document_collections/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/search/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/users/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down
6 changes: 4 additions & 2 deletions src/credal/users/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ def __getattr__(attr_name: str) -> typing.Any:
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
try:
module = import_module(module_name, __package__)
result = getattr(module, attr_name)
return result
if module_name == f".{attr_name}":
return module
else:
return getattr(module, attr_name)
except ImportError as e:
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
except AttributeError as e:
Expand Down