Spaces:
Sleeping
Sleeping
File size: 487 Bytes
7fdb8e9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from abc import ABC, abstractmethod
from typing import Any
from langchain.prompts import PromptTemplate
from pydantic import BaseModel
from .query import Query
class PromptTemplateFactory(ABC, BaseModel):
@abstractmethod
def create_template(self) -> PromptTemplate:
pass
class RAGStep(ABC):
def __init__(self, mock: bool = False) -> None:
self._mock = mock
@abstractmethod
def generate(self, query: Query, *args, **kwargs) -> Any:
pass
|