Skip to content
1 min read · 130 words

Function: fingerprintOpenAIResponsesPrefix()

ts
function fingerprintOpenAIResponsesPrefix(input: {
  input: OpenAIResponsesInputItem[];
  instructions?: string;
  model: string;
  throughItem?: number;
  tools?: OpenAIResponsesTool[];
}): Promise<string>;

Defined in: src/batteries/llm/openai_responses/helpers.ts:610

Implements OpenAIResponsesHelpers.fingerprintOpenAIResponsesPrefix.

Parameters

ParameterType
input{ input: OpenAIResponsesInputItem[]; instructions?: string; model: string; throughItem?: number; tools?: OpenAIResponsesTool[]; }
input.inputOpenAIResponsesInputItem[]
input.instructions?string
input.modelstring
input.throughItem?number
input.tools?OpenAIResponsesTool[]

Returns

Promise<string>

Remarks

Computes the fingerprint used for OpenAI Responses reasoning-item replay. The input is the exact assembled request prefix: model, instructions, tools, and input through (but not including) the item at throughItem. Assembles the Responses-shaped prefix object and delegates canonicalisation + hashing to the shared, wire-agnostic canonicalFingerprint primitive — mirroring fingerprintAnthropicMessagesPrefix's shape-and-slice pattern exactly: object keys are recursively sorted; array order and item boundaries are preserved.