mirror of
https://github.com/Mintplex-Labs/langchain-python.git
synced 2026-08-27 19:29:56 -04:00
2163d064f3
not actually sure the desired return in add_example to example selector is actually general/good - whats the use case?
16 lines
526 B
Python
16 lines
526 B
Python
"""Interface for selecting examples to include in prompts."""
|
|
from abc import ABC, abstractmethod
|
|
from typing import Any, Dict, List
|
|
|
|
|
|
class BaseExampleSelector(ABC):
|
|
"""Interface for selecting examples to include in prompts."""
|
|
|
|
@abstractmethod
|
|
def add_example(self, example: Dict[str, str]) -> Any:
|
|
"""Add new example to store for a key."""
|
|
|
|
@abstractmethod
|
|
def select_examples(self, input_variables: Dict[str, str]) -> List[dict]:
|
|
"""Select which examples to use based on the inputs."""
|