Enums

Enums for the different types of questions, language models, and inference services.

class edsl.enums.EnumWithChecks(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Base class for all enums with checks.

__module__ = 'edsl.enums'[source]
classmethod is_value_valid(value)[source]

Check if the value is valid.

class edsl.enums.InferenceServiceType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: EnumWithChecks

Enum for the inference service types.

ANTHROPIC = 'anthropic'[source]
AZURE = 'azure'[source]
BEDROCK = 'bedrock'[source]
DEEP_INFRA = 'deep_infra'[source]
GOOGLE = 'google'[source]
GROQ = 'groq'[source]
MISTRAL = 'mistral'[source]
OLLAMA = 'ollama'[source]
OPENAI = 'openai'[source]
REPLICATE = 'replicate'[source]
TEST = 'test'[source]
TOGETHER = 'together'[source]
__module__ = 'edsl.enums'[source]
__new__(value)[source]
class edsl.enums.QuestionType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: EnumWithChecks

Enum for the question types.

BUDGET = 'budget'[source]
CHECKBOX = 'checkbox'[source]
EXTRACT = 'extract'[source]
FREE_TEXT = 'free_text'[source]
FUNCTIONAL = 'functional'[source]
LIKERT_FIVE = 'likert_five'[source]
LINEAR_SCALE = 'linear_scale'[source]
LIST = 'list'[source]
MULTIPLE_CHOICE = 'multiple_choice'[source]
NUMERICAL = 'numerical'[source]
RANK = 'rank'[source]
TOP_K = 'top_k'[source]
YES_NO = 'yes_no'[source]
__module__ = 'edsl.enums'[source]
__new__(value)[source]
class edsl.enums.TokenPricing(*, model_name, prompt_token_price_per_k: float, completion_token_price_per_k: float)[source]

Bases: object

__dict__ = mappingproxy({'__module__': 'edsl.enums', '__init__': <function TokenPricing.__init__>, '__eq__': <function TokenPricing.__eq__>, '__dict__': <attribute '__dict__' of 'TokenPricing' objects>, '__weakref__': <attribute '__weakref__' of 'TokenPricing' objects>, '__doc__': None, '__hash__': None, '__annotations__': {}})[source]
__eq__(other)[source]

Return self==value.

__hash__ = None[source]
__init__(*, model_name, prompt_token_price_per_k: float, completion_token_price_per_k: float)[source]
__module__ = 'edsl.enums'[source]
__weakref__[source]

list of weak references to the object

edsl.enums.get_token_pricing(model_name)[source]