nv_ingest_api.util.string_processing package#

Module contents#

nv_ingest_api.util.string_processing.generate_url(url) str[source]#

Examines the user defined URL for http*://. If that pattern is detected the URL is used as provided by the user. If that pattern does not exist then the assumption is made that the endpoint is simply http:// and that is prepended to the user supplied endpoint.

Parameters:

str (url) – Endpoint where the Rest service is running

Returns:

Fully validated URL

Return type:

str

nv_ingest_api.util.string_processing.remove_url_endpoints(url) str[source]#

Some configurations provide the full endpoint in the URL. Ex: http://deplot:8000/v1/chat/completions. For hitting the health endpoint we need to get just the hostname:port combo that we can append the health/ready endpoint to so we attempt to parse that information here.

Parameters:

str (url) – Incoming URL

Returns:

URL with just the hostname:port portion remaining

Return type:

str