File tree Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Expand file tree Collapse file tree 3 files changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ pub trait LlmGenerationClient: Send + Sync {
5656pub struct LlmEmbeddingRequest < ' a > {
5757 pub model : & ' a str ,
5858 pub text : Cow < ' a , str > ,
59- pub output_dimension : u32 ,
59+ pub output_dimension : Option < u32 > ,
6060 pub task_type : Option < Cow < ' a , str > > ,
6161}
6262
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ impl LlmEmbeddingClient for Client {
129129 . create ( CreateEmbeddingRequest {
130130 model : request. model . to_string ( ) ,
131131 input : EmbeddingInput :: String ( request. text . to_string ( ) ) ,
132- dimensions : Some ( request. output_dimension ) ,
132+ dimensions : request. output_dimension ,
133133 ..Default :: default ( )
134134 } )
135135 . await ?;
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ struct Spec {
1414
1515struct Args {
1616 client : Box < dyn LlmEmbeddingClient > ,
17- output_dimension : u32 ,
1817 text : ResolvedOpArg ,
1918}
2019
@@ -38,7 +37,7 @@ impl SimpleFunctionExecutor for Executor {
3837 let req = LlmEmbeddingRequest {
3938 model : & self . spec . model ,
4039 text : Cow :: Borrowed ( text) ,
41- output_dimension : self . args . output_dimension ,
40+ output_dimension : self . spec . output_dimension ,
4241 task_type : self
4342 . spec
4443 . task_type
@@ -80,14 +79,7 @@ impl SimpleFunctionFactoryBase for Factory {
8079 dimension : Some ( output_dimension as usize ) ,
8180 element_type : Box :: new ( BasicValueType :: Float32 ) ,
8281 } ) ) ;
83- Ok ( (
84- Args {
85- client,
86- text,
87- output_dimension,
88- } ,
89- output_schema,
90- ) )
82+ Ok ( ( Args { client, text } , output_schema) )
9183 }
9284
9385 async fn build_executor (
You can’t perform that action at this time.
0 commit comments