OpenInference JS
    Preparing search index...
    • Sets the prompt template in the given OpenTelemetry context. If OI tracer is used in spans created during this active context, the prompt template will be added to the span as an attribute.

      Parameters

      • context: Context

        The context to set the prompt template on.

      • promptTemplate: PromptTemplate

        The prompt template to set on the context.

      Returns Context

      The context

      context.with(
      setPromptTemplate(context.active(), {
      template: "hello {name}",
      variables: { name: "world" },
      version: "V1.0"
      }),
      () => {
      // Spans created here will have prompt template attributes
      }
      );