Skip to content

Commit

Permalink
fix: types
Browse files Browse the repository at this point in the history
  • Loading branch information
0xcadams committed Nov 8, 2023
1 parent 7abdf35 commit 8a70728
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/nasty-knives-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"hopfield": patch
---

**Fix:** attempt to fix types.
9 changes: 6 additions & 3 deletions src/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { ZodType } from 'zod';

export abstract class BaseHopfieldSchema {
abstract get parameters(): ZodType<any, any, any>;
abstract get returnType(): ZodType<any, any, any>;
export abstract class BaseHopfieldSchema<
P = ZodType<any, any, any>,
R = ZodType<any, any, any>,
> {
abstract get parameters(): P;
abstract get returnType(): R;
}
2 changes: 1 addition & 1 deletion src/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export abstract class BaseHopfieldFunction<
DTypes extends DisabledTypes,
TTemplates extends TypeTemplates,
Template extends BaseHopfieldChatTemplate<TTemplates>,
> extends BaseHopfieldSchema {
> extends BaseHopfieldSchema<FParams> {
name: FName;
description: FDescription;

Expand Down
2 changes: 1 addition & 1 deletion src/openai/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class OpenAIFunction<
FParams extends ZodType<any, any, any>,
DTypes extends DisabledTypes,
>(opts: OpenAIFunctionProps<FName, FDescription, FParams, DTypes>) {
return new OpenAIFunction(opts);
return new OpenAIFunction<FName, FDescription, FParams, DTypes>(opts);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/openai/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export class OpenAIHopfield<
FParams extends ZodType<any, any, any>,
DTypes extends DisabledTypes, // = typeof disallowedTypes,
>(opts: OpenAIFunctionProps<FName, FDescription, FParams, DTypes>) {
return new OpenAIFunction(opts);
return new OpenAIFunction<FName, FDescription, FParams, DTypes>(opts);
}

override template(): OpenAIChatTemplate<DefaultOpenAITypeTemplates>;
Expand Down

0 comments on commit 8a70728

Please sign in to comment.