MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / hashDatasetEntryInput

Function hashDatasetEntryInput

app/src/server/utils/nodes/hashNode.ts:28–45  ·  view source on GitHub ↗
({
  projectId,
  tool_choice,
  tools,
  messages,
  response_format,
}: {
  projectId: string;
} & Pick<ChatCompletionCreateParams, "tool_choice" | "tools" | "messages" | "response_format">)

Source from the content-addressed store, hash-verified

26};
27
28export const hashDatasetEntryInput = ({
29 projectId,
30 tool_choice,
31 tools,
32 messages,
33 response_format,
34}: {
35 projectId: string;
36} & Pick<ChatCompletionCreateParams, "tool_choice" | "tools" | "messages" | "response_format">) => {
37 return hashObject({
38 projectId,
39 tool_choice: (tool_choice ?? null) as JsonValue,
40 // default tools to empty array to match db
41 tools: (tools ?? []) as unknown as JsonValue,
42 messages: messages as unknown as JsonValue[],
43 response_format: (response_format as JsonValue) ?? null,
44 });
45};
46
47export const hashAndSaveDatasetEntryInput = async ({
48 projectId,

Callers 3

Calls 1

hashObjectFunction · 0.85

Tested by

no test coverage detected