sapiopycommons 2025.10.21a791__py3-none-any.whl → 2025.10.21a792__py3-none-any.whl

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 sapiopycommons might be problematic. Click here for more details.

@@ -979,37 +979,32 @@ class AgentBase(ABC):
979
979
  """
980
980
  pass
981
981
 
982
- def get_credentials(self, category: str = None, host: str = None) -> ExternalCredentials:
982
+ def get_credentials(self, name: str | None = None, category: str | None = None) -> ExternalCredentials:
983
983
  """
984
984
  Get credentials for the given category and host.
985
985
 
986
+ :param name: The host name of the credentials to retrieve.
986
987
  :param category: The category of the credentials to retrieve.
987
- :param host: The host for which to retrieve the credentials.
988
988
  :return: An ExternalCredentials object containing the credentials for the given category and host.
989
989
  """
990
990
  if not self.__is_setup:
991
991
  raise Exception("Cannot call this function before the agent has been set up to respond to a request.")
992
992
  # Remove leading/trailing whitespace
993
+ name = name.strip() if name else None
993
994
  category = category.strip() if category else None
994
- host = host.strip() if host else None
995
995
 
996
996
  matching_creds: list[ExternalCredentialsPbo] = []
997
997
  for cred in self.request.external_credential:
998
998
  # Do case insensitive comparison
999
+ if name and cred.display_name.lower != name.lower():
1000
+ continue
999
1001
  if category and cred.category.lower() != category.lower():
1000
1002
  continue
1001
- if host:
1002
- # Parse the URL to get the host and compare
1003
- from urllib.parse import urlparse
1004
- parsed_url = urlparse(cred.url)
1005
- if parsed_url.hostname is None or parsed_url.hostname.lower() != host.lower():
1006
- continue
1007
-
1008
1003
  matching_creds.append(cred)
1009
1004
  if len(matching_creds) == 0:
1010
- raise ValueError(f"No credentials found for category '{category}' and host '{host}'.")
1005
+ raise ValueError(f"No credentials found for name '{name}' and category '{category}'.")
1011
1006
  if len(matching_creds) > 1:
1012
- raise ValueError(f"Multiple credentials found for category '{category}' and host '{host}'.")
1007
+ raise ValueError(f"Multiple credentials found for name '{name}' and category '{category}'.")
1013
1008
 
1014
1009
  return ExternalCredentials.from_pbo(matching_creds[0])
1015
1010
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sapiopycommons
3
- Version: 2025.10.21a791
3
+ Version: 2025.10.21a792
4
4
  Summary: Official Sapio Python API Utilities Package
5
5
  Project-URL: Homepage, https://github.com/sapiosciences
6
6
  Author-email: Jonathan Steck <jsteck@sapiosciences.com>, Yechen Qiao <yqiao@sapiosciences.com>
@@ -1,6 +1,6 @@
1
1
  sapiopycommons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  sapiopycommons/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- sapiopycommons/ai/agent_service_base.py,sha256=XrfIa4g6qaZcVw4aIp1d7yM3zUrSd4rSXBivT0WYWA4,63863
3
+ sapiopycommons/ai/agent_service_base.py,sha256=s3OY4UdzxBgIvT5PPbnq2MQ_n_3ihnPor4sJZDDo5NQ,63661
4
4
  sapiopycommons/ai/converter_service_base.py,sha256=HiUXmwqv1STgyQeF9_eTFXzjIFXp5-NJ7sEhMpV3aAU,6351
5
5
  sapiopycommons/ai/external_credentials.py,sha256=ki_xIH4J843b_sSwEa8YHr8vW9erVv-jowZJXSgPQs8,4347
6
6
  sapiopycommons/ai/protobuf_utils.py,sha256=cBjbxoFAwU02kNUxEce95WnMU2CMuDD-qFaeWgvQJMQ,24599
@@ -106,7 +106,7 @@ sapiopycommons/webhook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
106
106
  sapiopycommons/webhook/webhook_context.py,sha256=D793uLsb1691SalaPnBUk3rOSxn_hYLhdvkaIxjNXss,1909
107
107
  sapiopycommons/webhook/webhook_handlers.py,sha256=7o_wXOruhT9auNh8OfhJAh4WhhiPKij67FMBSpGPICc,39939
108
108
  sapiopycommons/webhook/webservice_handlers.py,sha256=cvW6Mk_110BzYqkbk63Kg7jWrltBCDALOlkJRu8h4VQ,14300
109
- sapiopycommons-2025.10.21a791.dist-info/METADATA,sha256=bQa43tNthQ6Nj8OUw7tVaFMwSEQUY-o8RB_hsupFXw4,3143
110
- sapiopycommons-2025.10.21a791.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
111
- sapiopycommons-2025.10.21a791.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
112
- sapiopycommons-2025.10.21a791.dist-info/RECORD,,
109
+ sapiopycommons-2025.10.21a792.dist-info/METADATA,sha256=FBXgjKxmW_SKUAbzNUgTj5J-1h5PQMRXM6ek8hxyCq0,3143
110
+ sapiopycommons-2025.10.21a792.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
111
+ sapiopycommons-2025.10.21a792.dist-info/licenses/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
112
+ sapiopycommons-2025.10.21a792.dist-info/RECORD,,