OpenInference JS
    Preparing search index...
    • Generates attributes for DECISION operations.

      Creates OpenTelemetry attributes for a call to a decision model: a model that scores or selects among candidate options supplied in the request rather than generating free-form text. Decision spans identify the model under the decision.* namespace instead of llm.*, with the same semantics as getLLMAttributes: system names the decision API ecosystem the call conforms to, provider names who hosts the model, and the model name keys follow the same request/response mirroring rules.

      Record the raw request and response with getInputAttributes and getOutputAttributes (or the default processors); decision spans have no input or output messages.

      Parameters

      • options: {
            modelName?: string;
            provider?: string;
            requestModelName?: string;
            responseModelName?: string;
            system?: string;
            tokenCount?: DecisionTokenCount;
        }

        Configuration object for DECISION attributes

        • OptionalmodelName?: string

          The name of the decision model (e.g., "jev-1.13.0")

        • Optionalprovider?: string

          Who hosts the decision model (e.g., "typesafe", "openai"). See DecisionProvider in the semantic conventions for well-known values

        • OptionalrequestModelName?: string

          The model requested by the caller, as sent in the request (e.g., the alias "jev-latest"). When modelName is omitted, decision.model_name is mirrored from responseModelName ?? requestModelName

        • OptionalresponseModelName?: string

          The model that actually produced the decision, as reported by the provider

        • Optionalsystem?: string

          The decision API ecosystem the call conforms to (e.g., "typesafe" for the System One / Jev API, "openai" for the OpenAI Decisions API). See DecisionSystem in the semantic conventions for well-known values

        • OptionaltokenCount?: DecisionTokenCount

          Token usage: the tokens sent (input) and the tokens that make up the typed answers (output)

      Returns Attributes

      OpenTelemetry attributes for DECISION operations

      const attrs = getDecisionAttributes({
      system: "typesafe",
      provider: "typesafe",
      requestModelName: "jev-latest",
      responseModelName: "jev-1.13.0",
      tokenCount: { input: 412, output: 2 },
      });