(node: {
id: string;
projectId: string;
type: T;
config: InferNodeConfig<T>;
})
| 9 | import type { ChatCompletionCreateParams, ChatCompletionMessage } from "openai/resources"; |
| 10 | |
| 11 | export const hashNode = <T extends NodeType>(node: { |
| 12 | id: string; |
| 13 | projectId: string; |
| 14 | type: T; |
| 15 | config: InferNodeConfig<T>; |
| 16 | }) => { |
| 17 | let hashableFields = {}; |
| 18 | |
| 19 | const nodeProperties = nodePropertiesByType[node.type] as NodeProperties<T>; |
| 20 | |
| 21 | if (nodeProperties.hashableFields) { |
| 22 | hashableFields = nodeProperties.hashableFields(node); |
| 23 | } |
| 24 | |
| 25 | return hashObject({ projectId: node.projectId, type: node.type, hashableFields }); |
| 26 | }; |
| 27 | |
| 28 | export const hashDatasetEntryInput = ({ |
| 29 | projectId, |
no test coverage detected