Skip to content

Commit c3c0066

Browse files
committed
fix: defineChatSessionFunction type
1 parent 6ccbca3 commit c3c0066

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/evaluator/LlamaChatSession/utils/defineChatSessionFunction.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function defineChatSessionFunction<const Params extends GbnfJsonSchema>({
1515
handler
1616
}: {
1717
description?: string,
18-
params?: Readonly<Params> & ProhibitUnknownProperties<GbnfJsonSchema, Params>,
18+
params?: Readonly<Params>,
1919
handler: (params: GbnfJsonSchemaToType<Params>) => Promise<any> | any
2020
}): ChatSessionModelFunction<Params> {
2121
return {
@@ -24,18 +24,3 @@ export function defineChatSessionFunction<const Params extends GbnfJsonSchema>({
2424
handler
2525
};
2626
}
27-
28-
/** @hidden */
29-
type ProhibitUnknownProperties<BaseType, Input extends BaseType> = BaseType extends object
30-
? Input extends object
31-
? (
32-
Input &
33-
{[K in Exclude<keyof Input, keyof BaseType>]: never} &
34-
{
35-
[K in keyof BaseType]: K extends keyof Input
36-
? ProhibitUnknownProperties<BaseType[K], Input[K]>
37-
: BaseType[K]
38-
}
39-
)
40-
: never
41-
: Input;

0 commit comments

Comments
 (0)