nv_ingest_api.util.string_processing package#
Submodules#
nv_ingest_api.util.string_processing.configuration module#
- nv_ingest_api.util.string_processing.configuration.dump_pipeline_to_graphviz(
- config: PipelineConfigSchema,
- output_path: str,
Generates a Graphviz visualization of the pipeline configuration.
- Parameters:
config (PipelineConfigSchema) – The pipeline configuration object.
output_path (str) – The path to save the Graphviz DOT file.
- nv_ingest_api.util.string_processing.configuration.pretty_print_pipeline_config(
- config: PipelineConfigSchema,
- config_path: str = None,
Generate a comprehensive, human-readable representation of a pipeline configuration.
This function creates a detailed, formatted string that displays all aspects of a pipeline configuration including stages, dependencies, scaling settings, and execution topology in a clear, hierarchical format.
- Parameters:
config (PipelineConfigSchema) – The pipeline configuration to format and display.
config_path (str, optional) – The file path of the configuration file to display in the header.
- Returns:
A comprehensive pretty-printed string of the pipeline structure and runtime details.
- Return type:
str
nv_ingest_api.util.string_processing.yaml module#
- nv_ingest_api.util.string_processing.yaml.substitute_env_vars_in_yaml_content(raw_content: str) str [source]#
Substitutes environment variables in a YAML string.
This function finds all occurrences of environment variable placeholders ($VAR, ${VAR}, $VAR|default, ${VAR|default}) in the input string and replaces them with their corresponding environment variable values.
- Parameters:
raw_content – The raw string content of a YAML file.
- Returns:
The YAML string with environment variables substituted.
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