Home / Function/ _determine_input_key() — langchain Function Reference

_determine_input_key() — langchain Function Reference

Architecture documentation for the _determine_input_key() function in runner_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  f8d7a691_e350_4707_e02b_21cc5ffda178["_determine_input_key()"]
  8253c602_7d0c_9195_a7e1_3e9b19304131["runner_utils.py"]
  f8d7a691_e350_4707_e02b_21cc5ffda178 -->|defined in| 8253c602_7d0c_9195_a7e1_3e9b19304131
  a089196b_8c1b_51e2_42d9_a8bd76f8a276["_get_keys()"]
  a089196b_8c1b_51e2_42d9_a8bd76f8a276 -->|calls| f8d7a691_e350_4707_e02b_21cc5ffda178
  style f8d7a691_e350_4707_e02b_21cc5ffda178 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/smith/evaluation/runner_utils.py lines 471–495

def _determine_input_key(
    config: smith_eval.RunEvalConfig,
    run_inputs: list[str] | None,
) -> str | None:
    input_key = None
    if config.input_key:
        input_key = config.input_key
        if run_inputs and input_key not in run_inputs:
            logger.warning(
                "Input key %s not in chain's specified input keys %s. "
                "Evaluation behavior may be undefined.",
                input_key,
                run_inputs,
            )
    elif run_inputs and len(run_inputs) == 1:
        input_key = run_inputs[0]
    elif run_inputs is not None and len(run_inputs) > 1:
        logger.warning(
            "Chain expects multiple input keys: %s,"
            " Evaluator is likely to fail. Evaluation behavior may be undefined."
            " Specify an input_key in the RunEvalConfig to avoid this warning.",
            run_inputs,
        )

    return input_key

Domain

Subdomains

Called By

Frequently Asked Questions

What does _determine_input_key() do?
_determine_input_key() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/smith/evaluation/runner_utils.py.
Where is _determine_input_key() defined?
_determine_input_key() is defined in libs/langchain/langchain_classic/smith/evaluation/runner_utils.py at line 471.
What calls _determine_input_key()?
_determine_input_key() is called by 1 function(s): _get_keys.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free