You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/langchain/llms/base.py

12 lines
369 B
Python

"""Base interface for large language models to expose."""
from abc import ABC, abstractmethod
from typing import List, Optional
class LLM(ABC):
"""LLM wrapper should take in a prompt and return a string."""
@abstractmethod
def __call__(self, prompt: str, stop: Optional[List[str]] = None) -> str:
"""Run the LLM on the given prompt and input."""