Skip to main content

aip_sdk.PromptConfig

aip_sdk.PromptConfig(prompt_template: str, expected_variables: list[str])

A single versioned Jinja2 prompt template within a metric config.

This is stored and versioned for any metric, but is only ever read back and rendered at scoring time for an agentic trace metric that itself accepts a prompt template (e.g. agent.custom_judge_rubric) — not for GDI metrics, and not for every agentic trace metric either. Storing a PromptConfig on a metric that doesn't read it back has no effect on how that metric scores. A config may store more than one named prompt, but only one is ever used at scoring time — storing more than one and then using that config to score fails at run time rather than picking one silently.

Attributes

  • prompt_template str: Jinja2 template source, rendered with the caller-supplied variables named in expected_variables when the owning metric consumes it at scoring time. Must be non-empty and parse as valid Jinja2.
  • expected_variables list[str]: Variable names the template expects, e.g. ["question", "answer"]. Must contain at least one name, and each must be a plain Jinja2 identifier — not a dotted or indexed expression like "ctx.question".

aip_sdk.PromptConfig.expected_variables​

aip_sdk.PromptConfig.expected_variables: list[str]

No docstring is defined in the source.

aip_sdk.PromptConfig.prompt_template​

aip_sdk.PromptConfig.prompt_template: str

No docstring is defined in the source.