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"
4444
4545export type SessionOutput < T extends SessionType , O > = T extends "gte-small"
4646 ? number [ ]
47- : T extends LLMProviderName
48- ? O extends { stream : true }
49- ? AsyncGenerator <
47+ : T extends LLMProviderName ? O extends { stream : true } ? AsyncGenerator <
5048 Result <
5149 LLMProviderInstance < T > [ "output" ] ,
5250 LLMProviderInstance < T > [ "error" ]
@@ -104,7 +102,7 @@ export class Session<T extends SessionType> {
104102
105103 async run < O extends SessionInputOptions < T > > (
106104 input : SessionInput < T > ,
107- options : O ,
105+ options ? : O ,
108106 ) : Promise <
109107 [ SessionOutput < T , O > , undefined ] | [ undefined , SessionOutputError < T > ]
110108 > {
@@ -136,14 +134,14 @@ export class Session<T extends SessionType> {
136134 await this . #init;
137135 }
138136
139- const opts = options as EmbeddingInputOptions ;
137+ const opts = options as EmbeddingInputOptions | undefined ;
140138
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 ;
143141
144142 const result = await core . ops . op_ai_run_model (
145143 this . #model,
146- prompt ,
144+ input ,
147145 mean_pool ,
148146 normalize ,
149147 ) as SessionOutput < T , typeof options > ;
You can’t perform that action at this time.
0 commit comments