File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,7 @@ export type SessionInputOptions<T extends SessionType> = T extends "gte-small"
44
44
45
45
export type SessionOutput < T extends SessionType , O > = T extends "gte-small"
46
46
? number [ ]
47
- : T extends LLMProviderName
48
- ? O extends { stream : true }
49
- ? AsyncGenerator <
47
+ : T extends LLMProviderName ? O extends { stream : true } ? AsyncGenerator <
50
48
Result <
51
49
LLMProviderInstance < T > [ "output" ] ,
52
50
LLMProviderInstance < T > [ "error" ]
@@ -104,7 +102,7 @@ export class Session<T extends SessionType> {
104
102
105
103
async run < O extends SessionInputOptions < T > > (
106
104
input : SessionInput < T > ,
107
- options : O ,
105
+ options ? : O ,
108
106
) : Promise <
109
107
[ SessionOutput < T , O > , undefined ] | [ undefined , SessionOutputError < T > ]
110
108
> {
@@ -136,14 +134,14 @@ export class Session<T extends SessionType> {
136
134
await this . #init;
137
135
}
138
136
139
- const opts = options as EmbeddingInputOptions ;
137
+ const opts = options as EmbeddingInputOptions | undefined ;
140
138
141
- const mean_pool = opts . mean_pool ?? true ;
142
- const normalize = opts . normalize ?? true ;
139
+ const mean_pool = opts ? .mean_pool ?? true ;
140
+ const normalize = opts ? .normalize ?? true ;
143
141
144
142
const result = await core . ops . op_ai_run_model (
145
143
this . #model,
146
- prompt ,
144
+ input ,
147
145
mean_pool ,
148
146
normalize ,
149
147
) as SessionOutput < T , typeof options > ;
You can’t perform that action at this time.
0 commit comments