vella-backend / _utils /chains /Chain_class.py
luanpoppe
feat: melhorias no c贸digo e refatora莽玫es
12d3e1a
raw
history blame contribute delete
339 Bytes
class Chain:
def __init__(self, prompt, model):
self.prompt = prompt
self.model = model
def create_prompt_model_chain(self):
return self.prompt | self.model
def invoke_prompt_model_chain(self, invoke_params):
chain = self.create_prompt_model_chain()
return chain.invoke(invoke_params)