({
projectId,
tool_choice,
tools,
messages,
response_format,
}: {
projectId: string;
} & Pick<ChatCompletionCreateParams, "tool_choice" | "tools" | "messages" | "response_format">)
| 26 | }; |
| 27 | |
| 28 | export 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 | |
| 47 | export const hashAndSaveDatasetEntryInput = async ({ |
| 48 | projectId, |
no test coverage detected