File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
llmstack/common/blocks/llm Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 11import logging
22
3+ from pydantic import BaseModel
4+
35from llmstack .common .blocks .base .processor import (
46 BaseConfigurationType ,
57 BaseInputType ,
@@ -34,18 +36,18 @@ def parse_validate_input(self, input) -> BaseInputType:
3436 input_cls = self .__class__ .__orig_bases__ [0 ].__args__ [0 ]
3537 if self ._input_tx_cb :
3638 input = self ._input_tx_cb (input )
37- if isinstance (input_cls , type ):
38- return input
39- return input_cls ( ** input )
39+ if issubclass (input_cls , BaseModel ):
40+ return input_cls ( ** input )
41+ return input
4042
4143 def parse_validate_configuration (
4244 self ,
4345 configuration ,
4446 ) -> BaseConfigurationType :
4547 configuration_cls = self .__class__ .__orig_bases__ [0 ].__args__ [2 ]
46- if isinstance (configuration_cls , type ):
47- return configuration
48- return configuration_cls ( ** configuration )
48+ if issubclass (configuration_cls , BaseModel ):
49+ return configuration_cls ( ** configuration )
50+ return configuration
4951
5052 def parse_validate_output (self , ** kwargs ) -> BaseOutputType :
5153 output_cls = self .__class__ .__orig_bases__ [0 ].__args__ [1 ]
You can’t perform that action at this time.
0 commit comments